/* ═══════════════════════════════════════════════════════
   FASCANO — PREMIUM DESIGN SYSTEM v2.0
   ═══════════════════════════════════════════════════════ */

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── DESIGN TOKENS ──────────────────────────────────── */
:root {
    /* Brand Colors (Food Red Style) */
    --primary: #DC2626; /* أحمر احترافي */
    --primary-light: #F87171;
    --primary-dark: #B91C1C;
    --primary-gradient: linear-gradient(135deg, #DC2626 0%, #F97316 100%);
    --primary-gradient-v: linear-gradient(180deg, #DC2626 0%, #F97316 100%);
    
    --accent: #F97316; /* برتقالي خفيف للأكل */
    --accent-light: #FDBA74;

    /* Neutrals */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --surface: #FFF7F7; /* خلفية دافئة خفيفة */
    --surface-elevated: #FFFFFF;
    --surface-muted: #FEF2F2;
    --border: #FEE2E2;
    --border-strong: #FCA5A5;

    /* Status Colors */
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.14);
    --shadow-primary: 0 8px 24px rgba(220, 38, 38, 0.25);
    --shadow-primary-lg: 0 16px 40px rgba(220, 38, 38, 0.30);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: 20px;

    /* Border Radius */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 100px;

    /* Transitions */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.35s;
    --duration-slow: 0.5s;

    /* Layout */
    --header-height: 320px;
    --bottom-nav-height: 80px;
    --max-width: 480px;

    /* Legacy compat */
    --primary-color: var(--primary);
    --secondary-color: var(--surface-muted);
    --bg-white: var(--surface-elevated);
    --border-color: var(--border);
}
/* ── TYPOGRAPHY ─────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Cairo', 'Outfit', system-ui, sans-serif;
    background-color: var(--surface-muted);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[dir="rtl"] { font-family: 'Cairo', system-ui, sans-serif; }
[dir="ltr"] { font-family: 'Outfit', system-ui, sans-serif; }

/* ── APP CONTAINER ──────────────────────────────────── */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--surface-elevated);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

/* ═══════════════════════════════════════════════════════
   BOTTOM NAVIGATION — Frosted Glass
   ═══════════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 88%;
    max-width: 420px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    height: 72px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    transition: color var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-spring);
    padding: 8px 16px;
    position: relative;
    border-radius: var(--radius-sm);
}

.nav-item:hover { color: var(--primary); }

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 6px;
    height: 6px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(232, 85, 61, 0.4);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 3px;
    transition: transform var(--duration-fast) var(--ease-spring);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════
   CATEGORY TABS — Premium Scrollable Pills
   ═══════════════════════════════════════════════════════ */
.category-tabs {
    display: flex;
    gap: 10px;
    padding: 16px 20px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--surface-elevated);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
    background: var(--surface-muted);
    border: 1.5px solid transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--duration-normal) var(--ease-spring);
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
    /* overflow: hidden; */
}

.category-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    border-radius: inherit;
    transition: opacity var(--duration-normal) var(--ease-smooth);
    z-index: -1;
}

.category-tab:hover {
    border-color: rgba(232, 85, 61, 0.2);
    color: var(--primary);
}

.category-tab.active {
    background: transparent;
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
    transform: scale(1.03);
}

.category-tab.active::before {
    opacity: 1;
}

.category-section {
    padding: 10px;
}

.category-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 20px 0 14px;
    padding-inline-start: 10px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--primary-gradient);
    border-radius: 4px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   MENU ITEMS — Premium Cards
   ═══════════════════════════════════════════════════════ */
.menu-section {
    padding-bottom: 100px;
    background: var(--surface-elevated);
}

.menu-item {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    border: 1.5px solid var(--border);
    transition: transform var(--duration-normal) var(--ease-spring),
                border-color var(--duration-normal),
                box-shadow var(--duration-normal);
    cursor: pointer;
    contain: content;
    position: relative;
}

.menu-item:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 85, 61, 0.15);
    box-shadow: var(--shadow-md);
}

.menu-item:active {
    transform: scale(0.98);
}

.item-image {
    width: 92px;
    height: 92px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: var(--surface-muted);
}

.skeleton-shimmer,
.shimmer-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--surface-muted) 25%, #efe9e5 50%, var(--surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
    border-radius: inherit;
}

.item-image.loaded .skeleton-shimmer,
.item-image.loaded .shimmer-placeholder {
    display: none;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.menu-item:hover .item-image img {
    transform: scale(1.08);
}

/* Premium "New" Badge */
.premium-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(232, 85, 61, 0.35);
    z-index: 2;
    letter-spacing: 0.3px;
}

[dir="rtl"] .premium-badge {
    left: auto;
    right: 6px;
}

.badge-dot {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1s infinite alternate;
}

@keyframes dotPulse {
    from { opacity: 0.5; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); }
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.item-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.item-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.item-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.item-price {
    font-size: 17px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.currency {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
}

.add-btn-wrapper {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    box-shadow: var(--shadow-primary);
    transition: transform var(--duration-fast) var(--ease-spring),
                box-shadow var(--duration-fast);
    flex-shrink: 0;
}

.add-btn-wrapper:active {
    transform: scale(0.88);
}

.menu-item:hover .add-btn-wrapper {
    transform: rotate(90deg) scale(1.05);
    box-shadow: var(--shadow-primary-lg);
}

/* ═══════════════════════════════════════════════════════
   INFO CARDS
   ═══════════════════════════════════════════════════════ */
.info-card-wrapper {
    height: 100%;
}

.info-card {
    background: var(--surface-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    height: 100%;
    transition: transform var(--duration-normal) var(--ease-spring),
                box-shadow var(--duration-normal),
                border-color var(--duration-normal);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.info-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.info-card:hover::before { opacity: 1; }

.info-card-icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(232, 85, 61, 0.08), rgba(245, 166, 35, 0.08));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.info-card:hover .info-card-icon-wrapper {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-primary);
    transform: scale(1.05);
}

.info-card:hover .info-icon { color: #fff; }

.info-icon {
    font-size: 18px;
    color: var(--primary);
    transition: color var(--duration-fast);
}

.info-status {
    font-size: 13px;
    margin-bottom: 3px;
    font-weight: 700;
}

.info-detail {
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   SERVICE OPTIONS (Pill Toggle)
   ═══════════════════════════════════════════════════════ */
.service-options-container {
    background: var(--surface-muted);
    padding: 5px;
    border-radius: var(--radius-pill);
    position: relative;
}

.service-options-pills { position: relative; z-index: 1; }

.service-pill {
    border: none;
    background: transparent;
    padding: 11px 10px;
    border-radius: var(--radius-pill);
    transition: all var(--duration-normal) var(--ease-spring);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.service-pill .pill-content { display: flex; align-items: center; justify-content: center; gap: 8px; }
.service-pill .pill-icon { font-size: 16px; color: var(--text-secondary); transition: color var(--duration-fast); }
.service-pill .pill-text { font-size: 13px; font-weight: 700; color: var(--text-secondary); transition: color var(--duration-fast); }

.service-pill.active .pill-icon,
.service-pill.active .pill-text { color: #fff; }

.service-pill.active {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-primary);
}

.service-pill:hover:not(.active) .pill-text { color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   HEADER / HERO SECTION (for legacy pages)
   ═══════════════════════════════════════════════════════ */
.header-section {
    height: var(--header-height);
    overflow: hidden;
    position: relative;
    will-change: transform;
}

.header-image {
    object-fit: cover;
    height: 100%;
    width: 100%;
    transition: transform 10s ease-out;
}

.header-section:hover .header-image { transform: scale(1.08); }

.header-overlay {
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.5) 100%);
}

.btn-header-action {
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-spring);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-header-action:hover {
    background: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════
   CAFE INFO SECTION
   ═══════════════════════════════════════════════════════ */
.cafe-info-section {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    background-color: var(--surface-elevated);
    padding: 30px 25px !important;
}

.cafe-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.cafe-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cafe-logo {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    padding: 2px;
    background: #fff;
    animation: logoGlow 3s infinite alternate;
}

@keyframes logoGlow {
    from { box-shadow: 0 0 5px rgba(232, 85, 61, 0.15); }
    to { box-shadow: 0 0 20px rgba(232, 85, 61, 0.35); }
}

/* ═══════════════════════════════════════════════════════
   FILTER & ANIMATION UTILITIES
   ═══════════════════════════════════════════════════════ */
.hidden, .filter-hidden { display: none !important; }

.filter-visible {
    display: flex !important;
    animation: fadeInFilter 0.4s ease forwards;
}

@keyframes fadeInFilter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s forwards var(--ease-out);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.scroll-item {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.7s var(--ease-out);
}

.scroll-item.scroll-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════
   CART SIDEBAR (Legacy support)
   ═══════════════════════════════════════════════════════ */
.cart-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal);
}

.cart-overlay.show { opacity: 1; visibility: visible; }

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 1999;
    transition: all var(--duration-slow) var(--ease-spring);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

[dir="ltr"] .cart-sidebar { right: auto; left: -100%; }
.cart-sidebar.open { right: 0; }
[dir="ltr"] .cart-sidebar.open { left: 0; }

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-muted);
}

.cart-header h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.close-cart {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all var(--duration-fast);
}

.close-cart:hover { background: var(--border); color: var(--text-primary); }

.cart-body { flex: 1; overflow-y: auto; padding: 20px; }
.cart-items { display: flex; flex-direction: column; gap: 15px; }

.cart-item {
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-item-image {
    width: 60px; height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden; flex-shrink: 0;
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.cart-item-price { font-size: 14px; color: var(--primary); font-weight: 700; }

.quantity-controls { display: flex; align-items: center; gap: 10px; }

.quantity-btn {
    width: 30px; height: 30px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast);
    font-size: 12px;
}

.quantity-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quantity-display { font-weight: 700; min-width: 20px; text-align: center; }

.remove-item {
    background: var(--danger);
    border: none;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast);
    font-size: 12px;
}

.remove-item:hover { background: #dc2626; transform: scale(1.1); }

.cart-empty { text-align: center; padding: 50px 20px; color: var(--text-secondary); }
.cart-empty i { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
}

.total-amount { color: var(--primary); }

.checkout-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    box-shadow: var(--shadow-primary);
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.checkout-btn:disabled { background: var(--text-secondary); cursor: not-allowed; box-shadow: none; }

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATION — Modern Slide-in
   ═══════════════════════════════════════════════════════ */
.toast-notification {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: linear-gradient(135deg, #1B1D21, #2d3038);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transition: transform 0.5s var(--ease-spring);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

.toast-notification__icon {
    width: 28px;
    height: 28px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    font-size: 13px;
    flex-shrink: 0;
}

/* Legacy .toast support */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: linear-gradient(135deg, #1B1D21, #2d3038);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transition: transform 0.5s var(--ease-spring);
    font-weight: 600;
    box-shadow: var(--shadow-xl);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════
   PRODUCT DETAIL MODAL (Legacy support)
   ═══════════════════════════════════════════════════════ */
.product-detail-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-detail-modal.show { display: flex; opacity: 1; }

.product-detail-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.product-detail-container {
    position: relative;
    width: 100%; height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.4s var(--ease-smooth);
    overflow-y: auto;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.product-close-btn {
    position: absolute;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    z-index: 10;
    transition: all var(--duration-fast);
    backdrop-filter: blur(10px);
    background: var(--glass-bg);
}

[dir="ltr"] .product-close-btn { right: auto; left: 20px; }
.product-close-btn:hover { background: rgba(0, 0, 0, 0.2); transform: scale(1.1); color: #fff; }

.product-image-section {
    position: relative;
    width: 100%; height: 60vh;
    background: var(--surface-muted);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.product-detail-img { width: 100%; height: 100%; object-fit: cover; }

.product-info-section {
    flex: 1;
    padding: 30px 20px 20px;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -25px;
    position: relative;
    z-index: 2;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

.product-detail-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-detail-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.size-selection { margin-bottom: 28px; }
.selection-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }
.size-options { display: flex; flex-direction: column; gap: 10px; }

.size-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    background: white;
}

.size-option:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.size-option.selected {
    border-color: var(--primary);
    background: rgba(232, 85, 61, 0.04);
}

.size-label { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.size-price { font-size: 14px; color: var(--text-secondary); font-weight: 600; }

.size-check {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 16px;
    opacity: 0;
    transition: opacity var(--duration-fast);
}

[dir="ltr"] .size-check { right: auto; left: 18px; }
.size-option.selected .size-check { opacity: 1; }

.quantity-section { margin-bottom: 28px; display: flex; justify-content: center; }

.quantity-controls-detail {
    display: flex; align-items: center; gap: 18px;
    background: var(--surface-muted);
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
}

.quantity-btn-detail {
    width: 34px; height: 34px;
    border: none;
    background: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-spring);
    box-shadow: var(--shadow-xs);
}

.quantity-btn-detail:hover { background: var(--primary); color: white; transform: scale(1.08); }
.quantity-btn-detail:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.quantity-display-detail { font-size: 18px; font-weight: 800; color: var(--text-primary); min-width: 30px; text-align: center; }

.product-action-section {
    padding: 18px;
    background: white;
    border-top: 1px solid var(--border);
}

.add-to-cart-detail {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 22px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}

.add-to-cart-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.add-to-cart-detail:hover::before { left: 100%; }
.add-to-cart-detail:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-lg); }
.add-to-cart-detail:active { transform: translateY(0); }
.cart-price { font-size: 17px; font-weight: 800; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .product-image-section { height: 50vh; }
    .product-info-section { padding: 24px 16px 16px; }
    .product-detail-title { font-size: 22px; }
    .product-detail-description { font-size: 14px; }
    .size-option { padding: 12px 14px; }
    .quantity-controls-detail { gap: 14px; padding: 5px 14px; }
    .add-to-cart-detail { padding: 14px 18px; font-size: 14px; }
}

@media (max-width: 375px) {
    .product-close-btn { top: 15px; right: 15px; width: 36px; height: 36px; font-size: 16px; }
    [dir="ltr"] .product-close-btn { right: auto; left: 15px; }
    .product-image-section { height: 45vh; }
    .product-info-section { padding: 20px 12px 12px; margin-top: -20px; }
    .product-detail-title { font-size: 20px; margin-bottom: 10px; }
    .product-detail-description { font-size: 13px; margin-bottom: 22px; }
    .selection-title { font-size: 15px; margin-bottom: 10px; }
    .size-option { padding: 10px 12px; }
    .size-label { font-size: 14px; }
    .size-price { font-size: 12px; }
    .quantity-controls-detail { gap: 12px; padding: 5px 12px; }
    .quantity-btn-detail { width: 30px; height: 30px; font-size: 12px; }
    .quantity-display-detail { font-size: 16px; }
    .product-action-section { padding: 14px 12px; }
    .add-to-cart-detail { padding: 12px 14px; font-size: 13px; }
    .cart-price { font-size: 15px; }
}

.product-detail-modal.opening .product-detail-container { animation: slideUpModal 0.4s var(--ease-smooth); }
.product-detail-modal.closing .product-detail-container { animation: slideDownModal 0.3s var(--ease-smooth); }

@keyframes slideDownModal {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.product-detail-loading {
    display: flex; align-items: center; justify-content: center;
    height: 200px; color: var(--text-secondary);
}

.product-detail-loading::after {
    content: '';
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-inline-start: 15px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.size-option,
.quantity-btn-detail,
.add-to-cart-detail {
    position: relative;
    overflow: hidden;
}

.product-info-section > * {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.5s ease forwards;
}

.product-detail-title { animation-delay: 0.1s; }
.product-detail-description { animation-delay: 0.15s; }
.size-selection { animation-delay: 0.2s; }
.quantity-section { animation-delay: 0.25s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}