/* --- Variables & Reset --- */
:root {
    /* Luxury Monochrome Palette */
    --color-black: #080808;        /* Deep Black for headings */
    --color-bg: #FFFFFF;           /* Pure White */
    --color-bg-sec: #F5F5F5;       /* Light Gray for sections */
    --color-border: #F0F0F0;       /* Lighter border */
    --color-text: #111111;         /* Main text color */
    --color-text-light: #555555;   /* High-contrast secondary text */
    --color-hover: #333333;        /* Dark gray for hover states */

    /* Modern Luxury Fonts */
    --font-heading: 'IBM Plex Sans Arabic', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;
    --font-english: 'Montserrat', sans-serif; /* For numbers & English */

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Refined transition */
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.07); /* Subtle depth on hover */
    --border-radius: 4px; /* Sharp, official radius */
}

/* --- Dark Mode Palette --- */
body.dark-mode {
    --color-black: #F5F5F5;        /* Light Gray for headings in dark mode */
    --color-bg: #121212;           /* Deepest Gray for background */
    --color-bg-sec: #1E1E1E;       /* Lighter Gray for sections */
    --color-border: #333333;       /* Dark border for definition */
    --color-text: #EAEAEA;         /* Main light text color */
    --color-text-light: #999999;   /* Lighter secondary text */
    --color-hover: #444444;        /* Lighter gray for hover states */
}

/* --- Custom Scrollbar (Minimalist Black) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { 
    background: #333; 
    border-radius: 10px; 
    transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-black); }

/* Dark mode specific overrides */
body.dark-mode .btn-outline:hover { background-color: var(--color-black); color: var(--color-bg); }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.8; /* Increased line-height for breathability */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-black);
    font-weight: 400; /* Light/Regular weight for elegance */
    line-height: 1.6; /* Increased line-height for calm & spacious feel */
}

/* Luxury large headings */
h1, h2 {
    font-weight: 300; /* Thinner weight for larger text */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Layout Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0; /* Increased padding for more breathing room */
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 14px 35px;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid var(--color-black);
    transition: var(--transition);
    text-align: center;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--color-black);
    color: var(--color-bg);
    border-color: var(--color-black);
}

.btn-primary:hover {
    background-color: var(--color-hover);
    border-color: var(--color-hover);
    color: var(--color-bg);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-black);
    border-color: var(--color-black);
}

.btn-outline:hover {
    background-color: var(--color-black);
    color: var(--color-bg);
}

.btn-whatsapp {
    border-color: transparent;
    background-color: #25D366; /* WhatsApp Green */
    color: #fff;
    margin-top: 10px;
    width: 100%;
    display: block;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: var(--border-radius);
}

.btn-whatsapp:hover {
    background-color: #1ebc57;
}

/* --- Cart Badge --- */
.cart-icon { position: relative; }
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-black);
    color: var(--color-bg);
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.9); /* White with transparency */
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    padding: 12px 0; /* Slimmer navbar */
}
body.dark-mode .navbar {
    background-color: rgba(18, 18, 18, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}


.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 2rem; /* Strong Geometric Logo */
    font-weight: 700;
    letter-spacing: 0;
    display: block; /* Ensure it takes its own line/space context */
}

.logo span {
    color: var(--color-black); /* Dot is now black */
}

.nav-links ul {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-weight: 400;
    font-size: 0.95rem;
    position: relative;
    color: var(--color-text);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-black);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input {
    width: 0;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
    outline: none;
    transition: width 0.4s ease;
    font-family: var(--font-body);
}
.search-input.active {
    width: 180px;
    padding: 8px 10px;
}
.search-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    padding: 0;
}
.theme-toggle-btn:hover {
    color: var(--color-hover);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section Removed for direct product display */
.hero-section, .hero-content {
    display: none !important;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-bg-sec);
    color: var(--color-text-light);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.filter-btn:hover {
    background-color: var(--color-bg-sec);
    color: var(--color-black);
}

.filter-btn.active {
    background-color: var(--color-black);
    color: var(--color-bg);
    border-color: var(--color-black);
}

/* --- Product Grid --- */
.section-header {
    text-align: center;
    margin-bottom: 80px; /* Extra breathing room */
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.subtitle {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    transition: var(--transition);    
    border: none;
    overflow: hidden;
    border-radius: 8px; /* زوايا أكثر انسيابية */
    position: relative; /* من أجل الشارات */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); /* ظل أنعم وأفخم */
}

.product-image {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: var(--color-bg-sec);
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image .product-actions {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    width: auto;
    padding: 0;
    transform: translateY(20px);
    opacity: 0;
    transition: bottom 0.3s ease-in-out;
    transition: all 0.4s ease;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-card:hover .product-image .product-actions {
    transform: translateY(0);
    opacity: 1;
}

.product-image .product-actions .btn {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--color-black);
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 4px;
}
body.dark-mode .product-image .product-actions .btn {
    background-color: rgba(40, 40, 40, 0.95);
    color: var(--color-bg);
}


.product-size-options {
    position: absolute;
    bottom: 0;
    left: 0; 
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Badge Style */
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--color-black);
    color: var(--color-bg);
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 2px;
    z-index: 2;
}

.size-btn {
    background: #fff;
    color: var(--color-black);
    border: 1px solid #ddd;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    font-family: var(--font-body);
}
body.dark-mode .size-btn {
    background: #222;
    color: #eee;
    border-color: #444;
}
.size-btn:hover {
    background: var(--color-black);
    color: #fff;
}

.product-info {
    padding: 25px 15px; /* More padding */
    flex-grow: 1; /* Allows the info to take up remaining space */
    text-align: center;
}

.product-category {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.2rem;
    font-family: var(--font-english); /* Montserrat for geometric numbers */
    font-weight: 700; /* Bold for hierarchy */
    margin-bottom: 15px;    
    color: var(--color-black);
    letter-spacing: 1px; /* Slight spacing for numbers */
}
.btn-block {
    display: block;
    width: 100%;
}

/* --- Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1020; /* رفع الطبقة لتكون أعلى من Modal التفاصيل */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cart-overlay.active { display: block; opacity: 1; }

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden by default for RTL */
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--color-bg);
    z-index: 1021; /* رفع الطبقة لتكون أعلى من Modal التفاصيل */
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.cart-sidebar.active { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.close-cart { background: none; border: none; font-size: 2rem; cursor: pointer; }

.cart-items { flex: 1; overflow-y: auto; }
.empty-msg { text-align: center; color: #999; margin-top: 50px; }

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--color-bg-sec);
    padding-bottom: 15px;
}
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.cart-item-details { flex: 1; }
.cart-item-title { font-size: 0.95rem; font-weight: 700; }
.cart-item-price { 
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 4px;
    font-family: var(--font-english);
    font-weight: 600;
}
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.quantity-controls button {
    background: var(--color-bg-sec);
    border: none;
    width: 25px; height: 25px;
    cursor: pointer;
}
.quantity-controls span { font-family: var(--font-english); padding: 0 5px; }
.cart-remove-btn { color: #ff4d4d; font-size: 0.8rem; cursor: pointer; background: none; border: none; padding: 0; }

.cart-footer { border-top: 1px solid #eee; padding-top: 20px; }
.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-english);
}

/* Checkout Form */
.checkout-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--color-bg-sec);
    border-radius: 4px;
    font-family: var(--font-ar);
}

/* --- Why SADA Section --- */
.why-sada-section {
    background-color: var(--color-bg-sec);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item svg {
    width: 48px;
    height: 48px;
    color: var(--color-black);
    margin-bottom: 15px;
}

.feature-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-item p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* --- Footer --- */
.footer {
    background-color: var(--color-black); /* Will be light in dark mode */
    color: var(--color-bg); /* Will be dark in dark mode */
    padding: 80px 0 30px; /* More padding */
    margin-top: 50px; 
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col p {
    margin-bottom: 20px;
}

.footer-col h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}
.footer-col h3, .footer-col h4 {
    color: var(--color-bg);
}

.footer-col h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col p, .footer-col ul li a {
    color: var(--color-bg-sec);
    opacity: 0.7;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover { opacity: 1; }

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--color-border);
    opacity: 0.5;
    padding-top: 20px;
    font-size: 0.9rem;    
    color: var(--color-bg);
}

/* --- Responsive --- */

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none; /* Hidden by default, shown in media query */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-bg-sec);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 999;
    justify-content: space-around;
    padding: 8px 0;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-light);
    font-size: 0.7rem;
    flex-grow: 1;
}

.mobile-bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
    color: var(--color-black);
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* Prevent content from being hidden by the nav */
    }
    .navbar-content {
        flex-wrap: wrap;
    }
    .nav-links {
        width: 100%;
        order: 3;
        background: var(--color-bg);
        /* Smooth transition for menu */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
        margin-top: 0;
    }
    .nav-links.active {
        max-height: 500px; /* Large enough value to not clip content */
        margin-top: 15px;
    }
    .nav-links ul {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 10px 0;
    }
    
    .menu-toggle {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
    }
    
    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--color-black);
        margin-bottom: 5px;
    }

    .mobile-bottom-nav {
        display: flex; /* Show on mobile */
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
        gap: 15px;
    }
    
    .cart-sidebar { width: 100%; max-width: 100%; }

    /* Hero Mobile Adjustment */
    .hero-section {
        justify-content: center;
        align-items: flex-end;
        height: 80vh;
        padding: 40px 20px;
    }
    .hero-content {
        max-width: 100%;
        text-align: center;
        align-items: center;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        margin-bottom: 40px;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none; /* Explicitly hide on desktop */
    }
}

@media (min-width: 1025px) {
    .product-grid {
        /* 4 columns for large desktops */
        grid-template-columns: repeat(4, 1fr);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroZoomIn {
    from { transform: scale(1.1); }
    to { transform: scale(1); }
}

/* --- Product Detail Modal (Quick View) --- */
.product-detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 1010; /* أقل من السلة الآن */
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-detail-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.product-detail-modal-content {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    padding: 0;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.product-detail-modal-overlay.active .product-detail-modal-content {
    transform: scale(1);
}

.close-detail-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    right: auto;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}
body.dark-mode .close-detail-btn {
    background: rgba(30, 30, 30, 0.8);
    color: var(--color-bg);
}
.close-detail-btn:hover {
    background: var(--color-black);
    color: var(--color-bg);
    transform: rotate(90deg);
}

.product-detail-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.product-detail-gallery {
    width: 50%;
    height: 100%;
    background: #f8f8f8;
    position: relative;
    overflow: hidden;
}

.main-image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-in;
}

#detail-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    will-change: transform; /* تحسين الأداء للأنيميشن */
}

.thumbnail-container {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
}

.thumbnail-container img {
    width: 50px;
    height: 50px;
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
    object-fit: cover;
}
.thumbnail-container img.active {
    opacity: 1;
    border-color: var(--color-black);
}

.product-detail-info {
    width: 50%;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.product-detail-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.product-detail-info .product-price {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--color-black);
}

.product-detail-info p {
    line-height: 1.8;
    margin-bottom: 25px;
    color: var(--color-text-light);
    overflow-wrap: break-word; /* يمنع النص الطويل من كسر التصميم */
}

.detail-options {
    margin-bottom: 20px;
}

.detail-options label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
}

.size-selector-detail {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quantity-input {
    width: 80px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-english);
}

.size-selector-detail .size-btn {
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #EAEAEA;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

body.dark-mode .size-selector-detail .size-btn {
    border-color: #444;
}

.size-selector-detail .size-btn:hover {
    border-color: var(--color-black);
}

.size-selector-detail .size-btn.active {
    background: var(--color-black);
    color: var(--color-bg);
    border-color: var(--color-black);
}

/* Responsive for detail view */
@media (max-width: 768px) {
    .product-detail-modal-content {
        height: auto;
        max-height: 95vh;
        overflow-y: auto;
    }
    .product-detail-layout {
        flex-direction: column;
    }
    .product-detail-gallery {
        width: 100%;
        height: 350px;
        flex-shrink: 0;
    }
    .product-detail-info {
        width: 100%;
        height: auto;
        padding: 25px;
        overflow-y: visible;
    }
    .close-detail-btn {
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}
body.dark-mode .close-detail-btn {
    background: #222;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        /* 2 columns for tablet */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Dashboard Styles (Unified) --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    direction: rtl;
    background-color: var(--color-bg-sec);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--color-black);
    color: var(--color-bg);
    padding: 30px;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed; /* تغيير الوضع ليكون ثابتاً */
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 10000;
}

.sidebar .logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
    font-family: var(--font-heading);
}

.sidebar .logo span {
    font-family: var(--font-body);
}
.sidebar nav ul li { list-style: none; margin-bottom: 15px; }
.sidebar nav ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    transition: var(--transition);
    display: block;
    text-decoration: none;
}
.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    color: var(--color-bg);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    margin-right: 250px; /* ترك مساحة للـ Sidebar الثابت */
    overflow-y: auto; 
    background-color: var(--color-bg);
    transition: margin-right 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    scroll-padding-top: 100px;
}

/* Sidebar Active State for Mobile */
.sidebar.active { transform: translateX(0) !important; }

/* Dashboard Cards & Forms */
.card {
    background: var(--color-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.02);
    margin-bottom: 40px;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}
.card:hover { box-shadow: 0 15px 50px rgba(0,0,0,0.04); }

.card h2 { margin-bottom: 20px; font-size: 1.2rem; }

.form-group { margin-bottom: 15px; }
.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }

label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.9rem; }
input, select {
    width: 100%;
    padding: 14px; 
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background: var(--color-bg);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--color-black);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
    outline: none;
}

.btn-dark {
    background: var(--color-black);
    color: var(--color-bg);
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: var(--transition);
}
.btn-dark:hover { 
    background-color: var(--color-hover); 
    color: var(--color-bg);
}

body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
    background-color: var(--color-bg-sec);
    border-color: var(--color-border);
    color: var(--color-text);
}

/* --- Skeleton Screens --- */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg-sec) 25%, var(--color-border) 50%, var(--color-bg-sec) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Custom Confirmation Modal --- */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    display: none; justify-content: center; align-items: center;
    z-index: 20000; opacity: 0; transition: 0.4s;
}
.custom-modal-overlay.active { display: flex; opacity: 1; }
.custom-modal {
    background: var(--color-bg); padding: 40px; border-radius: 8px;
    width: 90%; max-width: 450px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transform: translateY(20px); transition: 0.4s;
}
.custom-modal-overlay.active .custom-modal { transform: translateY(0); }

/* --- Animations --- */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Section Transitions --- */
.content-section {
    display: none;
    animation: sectionFade 0.5s ease;
}
@keyframes sectionFade { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* Dashboard Product Items */
.products-list { display: grid; gap: 15px; }
.product-item {
    background: var(--color-bg); padding: 15px; border-radius: var(--border-radius);
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); border: 1px solid var(--color-bg-sec);
}
.product-info-wrap { display: flex; align-items: center; gap: 15px; }
.product-thumb {
    width: 60px; height: 60px; object-fit: cover;
    border-radius: var(--border-radius); background: var(--color-bg-sec);
}
.product-details h4 { font-size: 1rem; margin-bottom: 5px; }
.product-details span { font-size: 0.85rem; color: var(--color-text-light); }
.btn-delete {
    background: #ff4d4d; color: white; border: none; padding: 8px 15px;
    border-radius: var(--border-radius); cursor: pointer; transition: var(--transition);
}
.btn-delete:hover { background: #d93636; }

.btn-edit {
    background: #4d94ff; color: white; border: none; padding: 8px 15px;
    border-radius: var(--border-radius); cursor: pointer; transition: var(--transition);
    margin-left: 5px;
}
.btn-edit:hover { background: #2b7de9; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { background: var(--color-bg); padding: 25px; border-radius: var(--border-radius); box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-align: center; border-bottom: 4px solid var(--color-black); }
.stat-card h3 { font-size: 1rem; color: var(--color-text-light); margin-bottom: 10px; }
.stat-card p { font-size: 2rem; font-weight: 700; color: var(--color-black); font-family: var(--font-accent); }
.content-section { animation: fadeIn 0.3s ease-in-out; }

/* Chart Container */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.chart-container {
    height: 300px;
    position: relative;
}

/* --- Scroll Reveal Animation --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
    transition-delay: var(--reveal-delay, 0s);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Dashboard Responsiveness --- */
/* Admin UI Extensions */
.menu-toggle-admin { display: none; position: fixed; top: 15px; left: 15px; z-index: 10001; background: var(--color-black); color: #fff; border: none; padding: 10px; border-radius: 4px; cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; }
.sidebar-overlay.active { display: block; }

.multi-image-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.thumb-wrap { position: relative; width: 80px; height: 80px; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 1px solid var(--color-border); }
.thumb-wrap button { position: absolute; top: -5px; right: -5px; background: red; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; }

.admin-list { list-style: none; padding: 0; }
.admin-list li { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--color-bg-sec); align-items: center; }
.admin-list button { background: #ff4d4d; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--color-black);
    color: var(--color-bg);
    padding: 15px 30px;
    border-radius: 4px;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-size: 0.9rem;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-error { background: #ff4d4d; }

/* --- Admin UI Adjustments --- */
.stock-warning {
    background: #fff5f5;
    color: #ff4d4d;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 2px;
    margin-right: 10px;
    border: 1px solid #ffebeb;
}

@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .menu-toggle-admin { display: block; }
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        z-index: 10000;
        transition: 0.3s;
    }
    .sidebar.open { left: 0; }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .sidebar .logo { margin-bottom: 20px; padding-bottom: 10px; }
    .sidebar nav ul {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .sidebar nav ul li { margin-bottom: 0; white-space: nowrap; }
    .main-content {
        padding: 20px;
    }
    .form-row { flex-direction: column; gap: 0; }
}
