/* ========================================
   Karim Web Store - Main Stylesheet
   ======================================== */

/* ===== Font Face ===== */
@font-face {
    font-family: 'Somar';
    src: url('../fonts/Somar-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Fallback font metrics to reduce CLS from font swap */
@font-face {
    font-family: 'Somar-fallback';
    src: local('Arial');
    ascent-override: 95%;
    descent-override: 25%;
    line-gap-override: 0%;
    size-adjust: 105%;
}

/* ===== Variables ===== */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #ea580c;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0891b2;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    --radius-4xl: 40px;
    
    --transition: all 0.3s ease;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100%;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 14px;
    z-index: 9999;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid white;
    outline-offset: 2px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

svg {
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Somar', 'Somar-fallback', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fcfcfd;
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    max-width: 100%;
}

/* منع الـ overflow الأفقي بدون التأثير على sticky positioning */
body > *:not(.navbar):not(nav) {
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== Container ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* منع الـ overflow الأفقي على المحتوى الرئيسي */
main#main-content {
    overflow-x: clip;
    max-width: 100%;
}

/* ===== Announcement Bar ===== */
.announcement-bar {
    background: #111827;
    color: white;
    padding: 12px 20px;
    position: relative;
    overflow: hidden;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.1), transparent, rgba(99, 102, 241, 0.1));
    animation: pulse 2s ease-in-out infinite;
}

.announcement-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.announcement-icon {
    font-size: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.announcement-content p {
    font-size: 13px;
    font-weight: 600;
}

.announcement-content .highlight {
    color: #38bdf8;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.announcement-content .code {
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 14px;
    border-radius: 8px;
    border: 2px dashed rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    font-weight: 900;
    margin-right: 12px;
    letter-spacing: 1.5px;
    display: inline-block;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
    text-transform: uppercase;
}

.close-announcement {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 24px;
    transition: var(--transition);
}

.close-announcement:hover {
    color: white;
}

/* ===== Navbar (base - overridden by header.php inline styles) ===== */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.nav-brand { flex-shrink: 0; min-width: 0; }

.logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    transition: color 0.3s;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    padding: 5px 7px;
    border-radius: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.nav-link:hover { color: var(--primary-color); background: var(--bg-secondary); }

.nav-categories-btn { font-family: inherit; }

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* أزرار الهيدر على سطح المكتب - حجم مناسب */
.nav-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-lg);
}

.nav-actions .btn svg {
    width: 15px;
    height: 15px;
}

/* ===== Cart Button ===== */
.cart-btn {
    position: relative;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    transition: all 0.3s;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cart-btn:hover, .cart-btn:focus-visible {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.cart-btn svg { width: 20px; height: 20px; }

.cart-count,
.wishlist-count,
.compare-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.btn-login svg { width: 18px; height: 18px; }
.btn-login .btn-text { display: inline; }

/* ===== Nav Toggle (hamburger) ===== */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    order: -1;
}

.nav-toggle:hover, .nav-toggle:focus-visible {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-toggle svg { width: 22px; height: 22px; }

.mobile-menu-toggle { display: none; }

/* ===== Categories Dropdown ===== */
.categories-dropdown {
    display: none;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
    box-shadow: var(--shadow-md);
}

.categories-dropdown.active {
    display: block;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    
    .category-item {
        padding: 10px;
    }
    
    .category-name {
        font-size: 13px;
    }
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.category-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.category-icon {
    font-size: 24px;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.category-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* ===== Legal Notice ===== */
.legal-notice {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: var(--radius-xl);
    padding: 16px;
    margin: 16px 0;
    text-align: center;
}

.legal-notice p {
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 40px 0;
    width: 100%;
    overflow: hidden;
}

.hero-container {
    background: white;
    border-radius: var(--radius-4xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 500px;
}

.hero-content {
    flex: 1;
    padding: 64px;
    min-width: 0;
}

.hero-title {
    font-size: clamp(22px, 4vw, 48px);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.text-orange {
    color: var(--secondary-color);
}

.text-blue {
    color: var(--primary-color);
}

.text-cyan {
    color: var(--info-color);
}

.text-green {
    color: var(--success-color);
}

.hero-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 600px;
}

.hero-image {
    flex: 0 0 40%;
    max-width: 500px;
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-wrapper {
    position: relative;
    width: min(380px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-3xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.hero-image-wrapper:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-color);
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: white;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: unset;
}

.hero-image-wrapper picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-image-wrapper:hover img {
    transform: scale(1.1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: #374151;
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
    border-radius: var(--radius-2xl);
}

.btn-large .icon {
    width: 20px;
    height: 20px;
}

.btn-small {
    padding: 10px 16px;
    font-size: 13px;
}

.btn-small .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    color: white;
}

.free-badge {
    background: #059669 !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 40px 0;
}

.empty-state svg {
    width: 120px;
    height: 120px;
    color: var(--text-light);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ===== Cart Page Styles ===== */
.cart-section {
    padding: 64px 0;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: flex-start;
}

.empty-cart {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-cart svg {
    width: 120px;
    height: 120px;
    color: var(--text-light);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-cart h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-cart p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    background: white;
    padding: 20px;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 120px 1fr auto auto auto;
    align-items: center;
    gap: 24px;
    transition: var(--transition);
}

.cart-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.cart-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.cart-item-details h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cart-item-details .price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 12px;
}

.cart-item-quantity button {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.cart-item-total {
    font-weight: 800;
    color: var(--text-primary);
    min-width: 100px;
    text-align: left;
}

.remove-item {
    color: var(--danger-color);
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
}

.remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

.remove-item svg {
    width: 20px;
    height: 20px;
}

.cart-summary {
    background: white;
    padding: 32px;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-weight: 600;
}

.summary-row.discount {
    color: var(--success-color);
}

.summary-row.total {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 900;
}

.cart-notification {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

/* ===== Checkout Page Styles ===== */
.checkout-section {
    padding: 64px 0;
    background-color: var(--bg-secondary);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: flex-start;
}

.checkout-details, .order-summary {
    background: white;
    padding: 32px;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.checkout-details h3, .order-summary h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.payment-methods {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.payment-method {
    position: relative;
    cursor: pointer;
}

.payment-method input {
    position: absolute;
    opacity: 0;
}

.payment-method-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.payment-method input:checked + .payment-method-content {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.payment-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-method-content strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
}

.payment-method-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.order-items {
    margin-bottom: 24px;
}

.checkout-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.checkout-item-info {
    flex: 1;
}

.checkout-item-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.checkout-item-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-totals {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.summary-row.total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
}

.summary-row.discount {
    color: var(--success-color);
}

.coupon-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.coupon-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
}

#coupon-message {
    padding: 8px;
    border-radius: 8px;
    margin-top: 8px;
}

#coupon-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

#coupon-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

@media (max-width: 992px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        order: -1;
    }
}

/* ===== Sections ===== */
.services-section,
.products-section {
    padding: 64px 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dbeafe, transparent);
}

.section-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* ===== Services Grid ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.service-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

.bg-blue {
    background: #dbeafe;
    color: #2563eb;
}

.bg-orange {
    background: #fed7aa;
    color: #ea580c;
}

.bg-green {
    background: #d1fae5;
    color: #10b981;
}

.bg-cyan {
    background: #cffafe;
    color: #0891b2;
}

.service-card h3 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
}

.service-card p {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.15);
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.product-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    z-index: 10;
}

.product-card:hover .product-shine {
    opacity: 1;
    animation: shine 1.5s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
}

/* ===== Featured Ribbon ===== */
.featured-ribbon {
    position: absolute;
    top: 18px;
    left: -8px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px 5px 16px;
    border-radius: 0 4px 4px 0;
    z-index: 20;
    letter-spacing: 0.5px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.25);
    clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%);
}

.featured-ribbon::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    border-width: 0 0 6px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #b91c1c;
}

.product-image {
    position: relative;
    width: calc(100% - 24px);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    aspect-ratio: unset !important;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.browser-dots {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dot.red {
    background: #ff5f57;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #28c840;
}

.product-content {
    padding: 20px;
    padding-top: 12px;
}

.product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.product-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    transition: color 0.3s;
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.product-price {
    color: var(--primary-color);
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.5px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.product-price .old-price {
    font-size: 14px;
    color: #6b7280;
    text-decoration: line-through;
    font-weight: 600;
}

.product-price .current-price {
    color: var(--primary-color);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    gap: 6px;
}

.product-category {
    font-size: 11px;
    color: #4b5563;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: visible;
}

.product-actions .btn-secondary {
    background: var(--btn-preview-bg, #6b7280);
    color: white;
    border-color: var(--btn-preview-bg, #6b7280);
}

.product-actions .btn-secondary:hover {
    background: var(--btn-preview-bg, #4b5563);
    color: white;
    border-color: var(--btn-preview-bg, #4b5563);
    opacity: 0.88;
}

.product-actions .btn-primary {
    background: var(--btn-cart-bg, var(--primary-color));
    color: white;
}

.product-actions .btn-primary:hover {
    background: var(--btn-cart-bg, var(--primary-dark));
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.product-actions .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

.product-actions .wishlist-btn {
    flex: 0 0 auto;
    color: var(--text-secondary, #94a3b8);
    transition: all 0.2s;
}

.product-actions .wishlist-btn:hover,
.product-actions .wishlist-btn.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.product-actions .wishlist-btn.active svg {
    fill: #ef4444;
    stroke: #ef4444;
}

/* ===== Footer Wave ===== */
.footer-wave {
    line-height: 0;
    overflow: hidden;
    margin-top: -2px;
    background: #fcfcfd; /* نفس خلفية الـ body */
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 100px;
    will-change: auto;
}

.footer-wave path {
    will-change: d;
}

/* ===== Footer ===== */
.footer {
    background: #111827;
    position: relative;
    color: white;
    padding: 64px 0 24px;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 16px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-heading {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-right: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    margin-bottom: 8px;
}

.footer-credit a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Empty State ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-container {
        flex-direction: column;
    }
    
    .hero-content {
        padding: 40px 32px;
        text-align: center;
        align-items: center;
    }
    
    .hero-title {
        font-size: 32px;
    }

    /* تقليص أزرار الهيدر على الشاشات المتوسطة */
    .nav-actions .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .nav-link {
        font-size: 12px;
        padding: 5px 6px;
        gap: 3px;
    }

    .nav-icon {
        width: 14px;
        height: 14px;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-content {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu { display: none; }

    .nav-actions .btn span,
    .nav-actions .btn .btn-text,
    .nav-actions .user-name { display: none; }

    .nav-actions .btn {
        padding: 0;
        width: 42px;
        height: 42px;
        min-width: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }

    /* إخفاء زر التسجيل على الموبايل والإبقاء على تسجيل الدخول فقط */
    .nav-actions .btn-primary:not(.user-btn) { display: none; }

    .nav-actions { gap: 6px; }
    .nav-content { gap: 8px; }
    .nav-brand .logo { font-size: 18px; }

    .cart-container { grid-template-columns: 1fr; }

    .cart-item {
        grid-template-columns: 90px 1fr auto;
        gap: 12px;
    }

    .cart-item img { width: 90px; height: 90px; }

    .cart-summary { position: static; padding: 24px; }

    .checkout-grid { grid-template-columns: 1fr; }

    .checkout-details, .order-summary { padding: 24px; }

    .hero-container { flex-direction: column; min-height: auto; overflow: visible; }
    .hero-title { font-size: 22px; line-height: 1.3; }
    .hero-content { padding: 32px 16px; text-align: center; align-items: center; }

    .hero-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        padding: 0 0 24px;
    }

    .hero-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        max-width: 280px;
        border-radius: var(--radius-2xl);
    }

    .hero-description { font-size: 14px; margin-bottom: 24px; }
    .hero-actions .btn { width: 100%; }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .product-content { padding: 12px; }
    .product-title { font-size: 14px; }
    .product-price { font-size: 16px; }

    .footer-content { grid-template-columns: 1fr; gap: 32px; text-align: center; }
    .social-links { justify-content: center; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .hero-title {
        font-size: 20px;
    }

    .nav-actions {
        gap: 6px;
    }

    .cart-btn {
        width: 38px;
        height: 38px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .announcement-content p {
        font-size: 11px;
    }

    .logo {
        font-size: 18px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-image {
        margin: 8px;
        width: calc(100% - 16px);
    }

    .product-content {
        padding: 8px;
        padding-top: 6px;
    }

    .product-header {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 8px;
    }

    .product-title {
        font-size: 12px;
        line-height: 1.3;
    }

    .product-price {
        font-size: 14px;
        align-items: flex-start;
    }

    .product-price .old-price {
        font-size: 11px;
    }

    .product-meta {
        margin-bottom: 8px;
    }

    .product-category {
        font-size: 10px;
        padding: 3px 7px;
    }

    .product-actions {
        gap: 5px;
    }

    .product-actions .btn {
        padding: 7px 6px;
        font-size: 11px;
        border-radius: 8px;
        gap: 3px;
    }

    .product-actions .btn .icon {
        width: 13px;
        height: 13px;
    }

    /* إخفاء نص زر المقارنة وإبقاء الأيقونة فقط */
    .product-actions .btn-secondary:not(.wishlist-btn) {
        flex: 0 0 auto;
        padding: 7px 8px;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
    }

    .cart-item img { width: 60px; height: 60px; }

    .cart-item-quantity { padding: 6px 10px; gap: 8px; }

    .cart-item-total { min-width: unset; font-size: 14px; }

    .cart-summary { padding: 16px; }

    .checkout-details, .order-summary { padding: 16px; }

    .payment-method-content { padding: 12px; gap: 10px; }

    .payment-icon { width: 40px; height: 40px; font-size: 20px; }
}

/* ===== Header Style Variants ===== */

/* Dark header */
.navbar--dark {
    background: #111827;
    border-bottom-color: rgba(255,255,255,0.08);
    box-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.navbar--dark .logo,
.navbar--dark .nav-link,
.navbar--dark .nav-toggle {
    color: rgba(255,255,255,0.9);
}
.navbar--dark .nav-link:hover,
.navbar--dark .logo:hover {
    color: #a5b4fc;
}
.navbar--dark .cart-btn {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}
.navbar--dark .cart-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: #a5b4fc;
    color: #a5b4fc;
}
.navbar--dark .nav-toggle {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
.navbar--dark .btn-secondary {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
}
.navbar--dark .btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}
.navbar--dark .user-btn {
    color: rgba(255,255,255,0.9);
}
.navbar--dark .user-dropdown {
    background: #1f2937;
    border-color: rgba(255,255,255,0.1);
}
.navbar--dark .user-dropdown a {
    color: rgba(255,255,255,0.8);
}
.navbar--dark .user-dropdown a:hover {
    background: rgba(255,255,255,0.08);
}

/* Transparent header — sits over hero, blurs on scroll */
.navbar--transparent {
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.navbar--transparent.scrolled {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(0,0,0,0.08);
    box-shadow: var(--shadow-sm);
}
.navbar--transparent .logo,
.navbar--transparent .nav-link {
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.navbar--transparent.scrolled .logo,
.navbar--transparent.scrolled .nav-link {
    color: var(--text-primary);
    text-shadow: none;
}
.navbar--transparent .cart-btn {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}
.navbar--transparent.scrolled .cart-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.navbar--transparent .nav-toggle {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}
.navbar--transparent.scrolled .nav-toggle {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.navbar--transparent .btn-secondary {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    color: white;
}
.navbar--transparent.scrolled .btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Minimal header — centered logo only */
.navbar--minimal {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}
.navbar--minimal .nav-content {
    justify-content: center;
}
.navbar--minimal .nav-menu,
.navbar--minimal .nav-actions,
.navbar--minimal .nav-toggle {
    display: none !important;
}
.navbar--minimal .logo {
    font-size: 28px;
    letter-spacing: -1px;
    color: var(--primary-color);
}

/* Scroll handler for transparent navbar — see footer.php inline script */

/* ===== Footer Style Variants ===== */

/* Simple footer — single centered row */
.footer--simple {
    background: #1f2937;
    padding: 32px 0;
    margin-top: 96px;
}
.footer--simple .footer-content {
    display: none;
}
.footer--simple .footer-bottom {
    border-top: none;
    padding-top: 0;
}
.footer--simple .footer-bottom p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.footer--simple .footer-credit {
    margin-top: 6px;
}

/* Dark minimal — 2 columns */
.footer--dark-minimal {
    background: #0f172a;
    padding: 48px 0 24px;
    margin-top: 96px;
}
.footer--dark-minimal .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.footer--dark-minimal .footer-section:nth-child(3),
.footer--dark-minimal .footer-section:nth-child(4) {
    display: none;
}
.footer--dark-minimal .footer-description {
    color: rgba(255,255,255,0.65);
}
.footer--dark-minimal .footer-bottom p {
    color: rgba(255,255,255,0.5);
}

/* Light footer — white background */
.footer--light {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #111827;
    margin-top: 96px;
}
.footer--light .footer-title {
    color: #111827;
}
.footer--light .footer-description {
    color: #6b7280;
}
.footer--light .footer-heading {
    color: #111827;
}
.footer--light .footer-links a {
    color: #6b7280;
}
.footer--light .footer-links a:hover {
    color: var(--primary-color);
}
.footer--light .social-link {
    background: #e5e7eb;
    color: #374151;
}
.footer--light .social-link:hover {
    background: var(--primary-color);
    color: white;
}
.footer--light .footer-bottom {
    border-top-color: #e5e7eb;
}
.footer--light .footer-bottom p {
    color: #6b7280;
}
.footer--light .footer-credit a {
    color: var(--primary-color);
}

/* ===== Categories Section (Home) ===== */
.categories-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.category-card-link {
    text-decoration: none;
    display: block;
}

.category-card-home {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card-home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category-card-home:hover::before {
    transform: scaleX(1);
}

.category-icon-home {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.category-icon-home svg {
    width: 100%;
    height: 100%;
}

.category-card-home:hover .category-icon-home {
    transform: scale(1.1) rotate(5deg);
}

.category-card-home h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.category-card-home p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.category-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.category-arrow svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.category-card-home:hover .category-arrow {
    background: var(--primary-color);
    transform: translateX(-4px);
}

.category-card-home:hover .category-arrow svg {
    color: white;
}

@media (max-width: 768px) {
    .categories-section { padding: 60px 0; }
    .categories-grid { grid-template-columns: 1fr; gap: 16px; }
    .category-card-home { padding: 24px; }
}

@media (max-width: 480px) {
    .categories-section { padding: 40px 0; }
    .categories-grid { gap: 12px; }
    .category-card-home { padding: 20px; border-radius: 14px; }
    .category-card-home h3 { font-size: 16px; margin-bottom: 6px; }
    .category-card-home p { font-size: 13px; }
    .category-icon-home { width: 48px; height: 48px; margin-bottom: 12px; }
    .category-arrow { width: 32px; height: 32px; }
}

/* ===== Promo Banner ===== */
.promo-banner {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    position: relative;
    z-index: 200;
    text-align: center;
}
.promo-banner__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.promo-banner__label {
    background: #e74c3c;
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
.promo-banner__text { color: #e0e0e0; }
.promo-banner__coupon { color: #ccc; white-space: nowrap; }
.promo-banner__code {
    background: rgba(255,255,255,0.15);
    border: 1px dashed rgba(255,255,255,0.5);
    color: #fff;
    padding: 3px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 4px;
}
.promo-banner__code:hover { background: rgba(255,255,255,0.25); }
.promo-banner__close {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
.promo-banner__close:hover { color: #fff; }
@media (max-width: 600px) {
    .promo-banner { font-size: 12px; padding: 8px 36px 8px 12px; }
    .promo-banner__code { font-size: 12px; }
}

/* ===== Nav Toggle ===== */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
}
.nav-toggle:hover { background: white; border-color: var(--primary-color); color: var(--primary-color); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ===== User Menu ===== */
.user-menu { position: relative; }
.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
    white-space: nowrap;
}
.user-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.user-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 8px; /* مسافة وهمية داخلية بدلاً من الخارجية لمنع انغلاق القائمة عند التحرك */
    background: transparent;
    min-width: 180px;
    z-index: 200;
}
.user-dropdown-inner {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
}
@media (hover: hover) { .user-menu:hover .user-dropdown { display: block; } }
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.user-dropdown a svg { width: 16px; height: 16px; flex-shrink: 0; }
.user-dropdown a:hover { background: #f3f4f6; color: var(--primary-color); }

/* ===== Sidebar ===== */
.categories-sidebar {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
}
.categories-sidebar.active { pointer-events: auto; visibility: visible; }
.sidebar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.categories-sidebar.active .sidebar-overlay { opacity: 1; }
.sidebar-content {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: white;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    will-change: transform;
}
.categories-sidebar.active .sidebar-content { transform: translateX(0); }
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}
.sidebar-header h2 { font-size: 18px; font-weight: 900; color: var(--text-primary); }
.sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sidebar-close:hover { background: var(--border-color); }
.sidebar-close svg { width: 20px; height: 20px; }
.sidebar-menu { flex: 1; padding: 12px; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    margin-bottom: 2px;
}
.sidebar-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-icon svg, .sidebar-item svg { width: 20px; height: 20px; }
.sidebar-item:hover { background: var(--bg-secondary); color: var(--primary-color); padding-right: 18px; }
.sidebar-divider { height: 1px; background: var(--border-color); margin: 10px 0; }
.sidebar-section-title {
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

/* ===== Navbar Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu { display: none; }
    .nav-brand .logo { font-size: 18px; }
    .nav-content { gap: 8px; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn span, .nav-actions .user-name { display: none; }
    .nav-actions .btn { padding: 0; width: 40px; height: 40px; min-width: 40px; border-radius: 10px; justify-content: center; }
    .user-btn { padding: 0; width: 40px; height: 40px; min-width: 40px; border-radius: 10px; justify-content: center; }
    .user-btn svg { width: 20px; height: 20px; }
    .user-dropdown { left: auto; right: 0; min-width: 160px; }

    /* إخفاء العملة وزر تسجيل الدخول على الموبايل */
    .currency-switcher { display: none !important; }
    /* إخفاء زر التسجيل */
    .nav-actions .btn-primary:not(.user-btn) { display: none !important; }
    /* إخفاء المفضلة */
    .wishlist-btn-nav { display: none !important; }
}
@media (max-width: 480px) {
    .nav-actions { gap: 4px; }
    .nav-actions .btn, .user-btn { width: 38px; height: 38px; min-width: 38px; }
    .cart-btn { width: 38px !important; height: 38px !important; }
}

/* ===== Currency Switcher ===== */
.currency-switcher {
    position: relative;
    margin-left: 10px;
}
.currency-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.currency-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.currency-btn .curr-symbol {
    color: #64748b;
    font-weight: 500;
}
.currency-btn .chevron {
    color: #94a3b8;
    transition: transform 0.2s ease;
}
.currency-switcher.open .chevron {
    transform: rotate(180deg);
}
.currency-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    animation: dropdownFade 0.2s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-header {
    padding: 10px 15px;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    background: #f8fafc;
    letter-spacing: 0.5px;
}
.currency-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.currency-item:hover {
    background: #f1f5f9;
    color: var(--primary-color, #4f46e5);
}
.currency-item.active {
    background: #eff6ff;
    color: #2563eb;
}
.item-name {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}
.check-icon {
    margin-right: auto;
    color: #2563eb;
}
@media (max-width: 768px) {
    .currency-switcher {
        display: flex !important;
    }
    .compare-btn {
        display: none !important;
    }
}
