/* ==========================================================================
   1. الإعدادات الأساسية ومتغيرات الألوان (Luxury Design Tokens)
   ========================================================================== */
:root {
    --color-primary-black: #0d0d0d;   /* الأسود الملكي */
    --color-cream-bg: #fdfbf7;        /* الخلفية الكريمية الهادئة */
    --color-pure-white: #ffffff;
    --color-gold-matte: #c5a059;      /* الذهبي المطفي الراقي */
    --color-gold-hover: #b38f46;
    --color-text-dark: #262626;
    --color-text-muted: #737373;
    --color-border: #e5e5e5;
    
    --font-heading: 'Cinzel', 'Cairo', serif;
    --font-body: 'Cairo', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-cream-bg);
    color: var(--color-text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

button, select, input, textarea {
    font-family: var(--font-body);
    outline: none;
}

/* الأزرار الاحترافية */
.btn {
    display: inline-block;
    padding: 12px 35px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    border: none;
}

.btn-gold {
    background-color: var(--color-gold-matte);
    color: var(--color-pure-white);
}

.btn-gold:hover {
    background-color: var(--color-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.2);
}

.btn-black {
    background-color: var(--color-primary-black);
    color: var(--color-pure-white);
}

.btn-black:hover {
    background-color: #262626;
    transform: translateY(-2px);
}

.w-100 { width: 100%; }

/* العناوين والخطوط الذهبية */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-primary-black);
    margin-bottom: 10px;
    font-weight: 700;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.gold-line {
    width: 60px;
    height: 2px;
    background-color: var(--color-gold-matte);
    margin: 15px auto 0 auto;
}

/* ==========================================================================
   2. شريط التنقل العلوي (Header)
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(197, 160, 89, 0.15);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo a {
    font-family: 'Cinzel', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--color-primary-black);
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-menu ul a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dark);
    position: relative;
    padding: 5px 0;
}

.nav-menu ul a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-gold-matte);
    transition: var(--transition-smooth);
}

.nav-menu ul a:hover::after,
.nav-menu ul a.active::after {
    width: 100%;
}

.nav-menu ul a:hover,
.nav-menu ul a.active {
    color: var(--color-gold-matte);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-toggle-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--color-primary-black);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.cart-toggle-btn:hover {
    color: var(--color-gold-matte);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--color-gold-matte);
    color: var(--color-pure-white);
    font-size: 0.75rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--color-primary-black);
    cursor: pointer;
}

/* ==========================================================================
   3. القسم الترحيبي (Hero Section)
   ========================================================================== */
.hero-section {
    position: relative;
    height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1441986300917-64674bd600d8?q=80&w=1600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: var(--color-pure-white);
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    color: var(--color-gold-matte);
    font-size: 1.1rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 35px;
    color: #e5e5e5;
}

/* ==========================================================================
   4. الأقسام (Categories)
   ========================================================================== */
.categories-section {
    padding: 100px 0;
    background-color: var(--color-pure-white);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 15fr);
    gap: 30px;
}

.category-card {
    position: relative;
    height: 400px;
    overflow: hidden;
    cursor: pointer;
}

.category-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: var(--transition-smooth);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--color-pure-white);
    text-align: center;
}

.category-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.category-card:hover .category-img {
    transform: scale(1.08);
}

/* ==========================================================================
   5. معرض المنتجات (Products Gallery)
   ========================================================================== */
.products-section {
    padding: 100px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
}

.product-card {
    background-color: var(--color-pure-white);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.01);
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.product-img-wrapper {
    position: relative;
    height: 380px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.quick-view-btn {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    padding: 12px 0;
    background-color: rgba(13, 13, 13, 0.9);
    color: var(--color-pure-white);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.product-card:hover .quick-view-btn {
    bottom: 20px;
}

.quick-view-btn:hover {
    background-color: var(--color-gold-matte);
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-family: var(--font-heading);
    color: var(--color-gold-matte);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ==========================================================================
   6. السلة الجانبية (Cart Sidebar)
   ========================================================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--color-pure-white);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 25px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text-dark);
}

.cart-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.empty-cart-msg {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 50px;
}

/* عناصر السلة الفردية */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f5f5f5;
    align-items: center;
}

.cart-item-img {
    width: 70px;
    height: 90px;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 0.95rem;
    color: var(--color-gold-matte);
    font-weight: 700;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #cc3333;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid var(--color-border);
    background-color: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-total #cartTotalValue {
    color: var(--color-gold-matte);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* ==========================================================================
   7. النوافذ المنبثقة (Modal System) التفاصيل والدفع
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--color-pure-white);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    transform: translateY(-30px);
    transition: var(--transition-smooth);
}

.modal.open .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--color-primary-black);
    transition: var(--transition-smooth);
    z-index: 10;
}

.close-modal-btn:hover {
    color: var(--color-gold-matte);
}

/* شبكة تفاصيل المنتج داخل الـ Modal */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
}

.modal-img-side img {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.modal-info-side h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-price {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-gold-matte);
    font-weight: 700;
    display: block;
    margin-bottom: 15px;
}

.modal-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* حقول الاختيارات */
.product-options {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 18px;
}

.option-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    background-color: var(--color-cream-bg);
    font-size: 0.9rem;
}

/* التحكم بالكمية */
.quantity-control {
    display: flex;
    align-items: center;
    max-width: 130px;
    border: 1px solid var(--color-border);
}

.quantity-control button {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.quantity-control button:hover {
    background-color: var(--color-border);
}

.quantity-control input {
    width: 50px;
    height: 40px;
    text-align: center;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-top: none;
    border-bottom: none;
    font-weight: 700;
}

/* نموذج إتمام الشراء */
.checkout-content {
    max-width: 550px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 25px;
}

.checkout-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.checkout-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
    background-color: #fafafa;
}

.checkout-summary {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: rgba(197, 160, 89, 0.08);
    border: 1px dashed var(--color-gold-matte);
    margin: 20px 0;
    font-size: 1.05rem;
}

.checkout-summary strong {
    color: var(--color-gold-matte);
}

/* ==========================================================================
   8. أسفل الموقع (Footer)
   ========================================================================== */
.main-footer {
    background-color: var(--color-primary-black);
    color: #cccccc;
    padding: 70px 0 20px 0;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 50px;
    border-bottom: 1px solid #262626;
    padding-bottom: 40px;
}

.footer-about h3 {
    font-family: var(--font-heading);
    color: var(--color-pure-white);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.footer-links h4, .footer-contact h4 {
    color: var(--color-pure-white);
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul a:hover {
    color: var(--color-gold-matte);
    padding-right: 5px;
}

.footer-contact p {
    margin-bottom: 12px;
}

.footer-contact i {
    color: var(--color-gold-matte);
    margin-left: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    width: 35px;
    height: 35px;
    border: 1px solid #262626;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: var(--color-pure-white);
}

.social-icons a:hover {
    background-color: var(--color-gold-matte);
    border-color: var(--color-gold-matte);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   9. حواسب وهواتف - التجاوب الكامل (Responsive Design)
   ========================================================================== */
@media (max-width: 992px) {
    .hero-title { font-size: 2.8rem; }
    .categories-grid { grid-template-columns: 1fr; gap: 20px; }
    .category-card { height: 300px; }
    .modal-grid { grid-template-columns: 1fr; gap: 20px; }
    .modal-img-side img { height: 300px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 768px) {
    .menu-toggle-btn { display: block; }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--color-pure-white);
        transition: var(--transition-smooth);
        padding: 40px;
        border-top: 1px solid var(--color-border);
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }
    
    .nav-menu ul a { font-size: 1.2rem; }
    
    .hero-section { text-align: center; justify-content: center; }
    .hero-title { font-size: 2.3rem; }
    
    .cart-sidebar { width: 100%; right: -100%; }
    .modal-content { padding: 25px; width: 95%; }
}