﻿/* =============================================
   CSS Variables - پالت رنگی جدید
============================================= */
:root {
    /* Colors - رنگ‌های پایه بر اساس لوگو محرم */
    --primary: #9B1829; /* قرمز شرابی اصلی لوگو */
    --primary-dark: #6D1520; /* قرمز شرابی تیره‌تر */
    --primary-light: #FFE8EB; /* قرمز بسیار روشن برای پس‌زمینه */
    --secondary: #C9A961; /* طلایی کرم لوگو */
    --secondary-dark: #A08845; /* طلایی تیره‌تر */
    --secondary-light: #F5EFE0; /* کرم بسیار روشن */
    --accent: #4A3426; /* قهوه‌ای حاشیه لوگو */
    --accent-light: #8B7355; /* قهوه‌ای روشن‌تر */

    --success: #6b8e23;
    --warning: #cd853f;
    --danger: #9B1829; /* همان قرمز اصلی */
    --info: #708090;
    /* Light Theme - حالت روشن بهینه شده */
    --bg-main: #FFFFFF; /* پس‌زمینه سفید خالص */
    --bg-header: #FFFFFF; /* هدر سفید */
    --bg-card: #FFFFFF; /* کارت‌ها سفید */
    --bg-card2: #FEFCF8; /* کارت‌ها با لمس کرم */
    --bg-hover: #FFF9F0; /* هاور با لمس طلایی */
    --bg-accent: #F5EFE0; /* پس‌زمینه تاکیدی کرمی */

    --text-primary: #2D1A1A; /* متن اصلی تیره */
    --text-secondary: #4A3426; /* متن ثانویه قهوه‌ای */
    --text-muted: #8B7355; /* متن کم‌رنگ */
    --text-inverse: #FFFFFF; /* متن معکوس */
    /* Borders - مرزهای مشخص‌تر در حالت روشن */
    --border: #E5DFD4; /* حاشیه اصلی کرم کم‌رنگ */
    --border-light: #F2EDE3; /* حاشیه کم‌رنگ */
    --border-dark: #D4C4B0; /* حاشیه تیره‌تر */
    --border-accent: #C9A961; /* حاشیه تاکیدی طلایی */
    --border-focus: #9B1829; /* حاشیه فوکوس قرمز */
    /* Shadows - سایه‌های بهتر */
    --shadow-sm: 0 1px 2px 0 rgba(155, 24, 41, 0.05);
    --shadow: 0 1px 3px 0 rgba(74, 52, 38, 0.08);
    --shadow-lg: 0 4px 6px -1px rgba(74, 52, 38, 0.1);
    --shadow-xl: 0 10px 15px -3px rgba(74, 52, 38, 0.12);
    --shadow-colored: 0 2px 8px 0 rgba(155, 24, 41, 0.15);
    /* Gradients - گرادیانت‌های زیباتر */
    --gradient-primary: linear-gradient(135deg, #9B1829 0%, #6D1520 100%);
    --gradient-secondary: linear-gradient(135deg, #C9A961 0%, #A08845 100%);
    --gradient-accent: linear-gradient(135deg, #F5EFE0 0%, #E5DFD4 100%);
    --gradient-success: #6b8e23;
    --gradient-card: linear-gradient(135deg, #FFFFFF 0%, #FEFCF8 100%);
    --gradient-header: linear-gradient(180deg, #FFFFFF 0%, #FEFCF8 100%);
    /* Spacing */
    --border-radius: 12px;
    --border-radius-sm: 4px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    /* Viewport height for mobile */
    --vh: 1vh;
}

/* Dark Theme - حالت تاریک بهینه شده */
[data-theme="dark"] {
    --primary: #C92D3F; /* قرمز روشن‌تر برای حالت تاریک */
    --primary-dark: #9B1829;
    --primary-light: #E05566;
    --secondary: #D4AF37; /* طلایی روشن‌تر برای خوانایی بهتر */
    --secondary-dark: #A08845;
    --secondary-light: #E5C758;
    --bg-main: #1A0F0F; /* پس‌زمینه تیره با لمس قرمز */
    --bg-header: #221515; /* هدر تیره */
    --bg-card: #2A1818; /* کارت‌ها */
    --bg-card2: #321E1E; /* کارت‌های ثانویه */
    --bg-hover: #3D2626; /* هاور */
    --bg-accent: #2D1A1A; /* پس‌زمینه تاکیدی */

    --text-primary: #F5E8E8; /* متن اصلی روشن */
    --text-secondary: #E5D5C8; /* متن ثانویه */
    --text-muted: #C9A961; /* متن کم‌رنگ با طلایی */
    --text-inverse: #1A0F0F; /* متن معکوس */
    /* Borders - مرزهای واضح در حالت تاریک */
    --border: #4A3426; /* حاشیه اصلی قهوه‌ای */
    --border-light: #3D2626; /* حاشیه کم‌رنگ */
    --border-dark: #5C3A3A; /* حاشیه تیره‌تر */
    --border-accent: #C9A961; /* حاشیه تاکیدی طلایی */
    --border-focus: #E5C758; /* حاشیه فوکوس طلایی روشن */
    /* Shadows - سایه‌های قوی‌تر برای حالت تاریک */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-colored: 0 2px 8px 0 rgba(201, 169, 97, 0.2);
    /* Gradients - گرادیانت‌های حالت تاریک */
    --gradient-primary: linear-gradient(135deg, #C92D3F 0%, #9B1829 100%);
    --gradient-secondary: linear-gradient(135deg, #D4AF37 0%, #A08845 100%);
    --gradient-accent: linear-gradient(135deg, #2D1A1A 0%, #3D2626 100%);
    --gradient-success: #6b8e23;
    --gradient-card: linear-gradient(135deg, #2A1818 0%, #321E1E 100%);
    --gradient-header: linear-gradient(180deg, #221515 0%, #2A1818 100%);
}

/* =============================================
   Base Styles
============================================= */

@font-face {
    font-family: 'Shabnam';
    src: url('../webfonts/Shabnam.eot');
    src: url('../webfonts/Shabnam.eot?#iefix') format('embedded-opentype'), url('../webfonts/Shabnam.woff2') format('woff2'), url('../webfonts/Shabnam.woff') format('woff'), url('../webfonts/Shabnam.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Shabnam';
    src: url('../webfonts/Shabnam-Bold.eot');
    src: url('../webfonts/Shabnam-Bold.eot?#iefix') format('embedded-opentype'), url('../webfonts/Shabnam-Bold.woff2') format('woff2'), url('../webfonts/Shabnam-Bold.woff') format('woff'), url('../webfonts/Shabnam-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Shabnam', Tahoma, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    direction: rtl;
}

/* =============================================
   Header
============================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
}

[data-theme="dark"] .header {
    background: transparent;
}

/* Header Background Image */
.header-background {
    position: relative;
    height: 80px;
    overflow: hidden;
    background-color:#fff;
}

.header-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 35%, black 100%);
    mask-image: linear-gradient(to top, transparent 0%, black 35%, black 100%);
}

/* Logo Container */
.header-logo-container {
    position: absolute;
    top: 40px;
    right: 1rem;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*background: var(--gradient-accent);
    border: 1px solid var(--border-accent);*/
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-top: none;
    /*border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);*/
    padding: 0.5rem 0.5rem 0.5rem;
    position: relative;
}

.header-spacer {
    width: 90px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

/* Dark Theme */
[data-theme="dark"] .logo {
    border-color: var(--bg-card);
}

[data-theme="dark"] .header-bg-image {
    filter: brightness(0.7);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.theme-toggle,
.search-btn,
.sign-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

    .theme-toggle:hover,
    .search-btn:hover,
    .sign-btn:hover {
        background: var(--bg-hover);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

/* User Status */
.user-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-main);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .user-info:hover {
        background: var(--bg-hover);
    }

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-background {
        height: 120px;
    }

    .header-logo-container {
        top: 70px;
        right: 0.5rem;
    }

    .logo {
        width: 90px;
        height: 90px;
    }

    .header-spacer {
        width: 70px;
    }
}

/* =============================================
   Categories
============================================= */
.categories-wrapper {
    background: var(--bg-card);
    /*padding: 0.75rem 0;*/
    position: sticky;
    top: 73px;
    z-index: 90;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
}

.categories-scroll-wrapper {
    position: relative;
    padding: 0.5rem 3rem;
}

.categories-container {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 0.25rem 0.3rem;
}

    .categories-container::-webkit-scrollbar {
        display: none;
    }

.category-item {
    flex: 0 0 auto;
    padding: 0.625rem 1rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.87rem;
}

    .category-item.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }

    .category-item:hover:not(.active) {
        border-bottom-color: var(--border);
    }

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

    .scroll-btn:hover {
        transform: translateY(-50%) scale(1.1);
    }

    .scroll-btn.left {
        left: 0.5rem;
    }

    .scroll-btn.right {
        right: 0.5rem;
    }

/* =============================================
   Products
============================================= */
.products-container {
    padding: 0.7rem 0.3rem 4.3rem;
    min-height: calc(100vh - 200px);
}

.product-card {
    background: var(--bg-main);
    border-radius: var(--border-radius-sm);
    padding: 0.35rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

    .product-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }

.package-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-main {
    display: flex;
    gap: 1rem;
}

.product-image {
    width: 90px;
    height: 90px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

    .product-image.lazy {
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .product-image.loaded {
        opacity: 1;
    }

    .product-image.lazy::before {
        content: '';
        display: block;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-weight: 700;
    font-size: 0.87rem;
    margin-bottom: 0.5rem;
    padding-top:1rem;
    line-height: 1;
    color: var(--text-primary);
}

.product-description {
    font-weight:400;
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: justify;
    margin: 0;
    padding-top: 0.5rem;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.product-price span {
    font-weight: 400;
    font-size: 1rem;
}

.product-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.add-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius-sm);
    width: 90px;
    height: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .add-btn:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }

/* Product Cart Items */
.product-cart-items {
    margin-top: 0.75rem;
}

.cart-item-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-card2);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

    .cart-item-inline:hover {
        background: var(--bg-hover);
    }

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.cart-item-addons {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.cart-item-price span {
    font-weight: 400;
}

/* =============================================
   Cart
============================================= */
.floating-cart {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    min-width: 85%;
}

    .floating-cart:hover {
        transform: translateX(-50%) translateY(-4px) scale(1.05);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

.cart-count {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-lg);
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    /* استفاده از dvh برای مرورگرهای جدید */
    height: 100dvh;
    min-height: 100dvh;
}

/* Fallback برای مرورگرهای قدیمی */
@supports not (height: 100dvh) {
    .cart-sidebar {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

    .cart-sidebar.active {
        left: 0;
    }

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
}

    .cart-header h3 {
        font-weight: 700;
        font-size: 1.1rem;
    }

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
}

    .close-cart:hover {
        background: var(--bg-hover);
        color: var(--danger);
    }

.cart-items {
    padding: 0.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    animation: slideIn 0.3s ease;
}

    .cart-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.cart-item-details {
    flex: 1;
}

    .cart-item-details h5 {
        font-weight: 600;
        margin-bottom: 0.35rem;
        font-size: 0.85rem;
    }

    .cart-item-details small {
        display: block;
        color: var(--text-secondary);
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

.cart-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}

.total-price {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.checkout-btn {
    width: 100%;
    background: var(--gradient-success);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .checkout-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
    }

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    /*gap: 0.5rem;*/
    border-radius: var(--border-radius-sm);
    /*padding: 0.25rem;*/
    box-shadow: var(--shadow-sm);
}

.quantity-btn {
    width: 28px; /*32px;*/
    height: 28px; /*32px;*/
    border: none;
    background: var(--bg-hover);
    color: var(--primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .quantity-btn:hover {
        background: var(--primary);
        color: white;
        box-shadow: var(--shadow);
    }

.quantity {
    min-width: 30px; /*35px;*/
    text-align: center;
    font-size:0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* =============================================
   Modals & Pages
============================================= */
/* Backdrop */
.note-modal-backdrop,
.auth-modal-backdrop,
.address-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .note-modal-backdrop.active,
    .auth-modal-backdrop.active,
    .address-modal-backdrop.active {
        display: block;
        opacity: 1;
    }

/* Modal Base Styles */
.note-modal,
.auth-modal,
.address-modal {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

    .note-modal.active,
    .auth-modal.active,
    .address-modal.active {
        bottom: 0;
    }

.note-modal {
    max-height: 80vh;
}

.auth-modal {
    max-height: 90vh;
    overflow: hidden;
}

.address-modal {
    height: 90vh;
}

/* Modal Headers */
.note-modal-header,
.auth-header,
.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

    .note-modal-header h4,
    .auth-header h3,
    .address-header h3 {
        font-weight: 700;
        margin: 0;
    }

    .auth-header h3 {
        font-size: 1.25rem;
    }

    .address-header h3 {
        flex: 1;
        text-align: center;
        font-size: 1.1rem;
    }

/* Modal Close Buttons */
.note-modal-close,
.auth-close,
.address-close,
.address-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-modal-close,
.auth-close,
.address-close {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
}

.address-back {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
}

    .note-modal-close:hover,
    .auth-close:hover,
    .address-close:hover,
    .address-back:hover {
        background: var(--bg-hover);
        color: var(--danger);
    }

/* =============================================
   Form Elements
============================================= */
.form-group {
    margin-bottom: 1rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.9rem;
    }

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

    .form-input:focus,
    .form-textarea:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    }

.form-textarea {
    resize: vertical;
    min-height: 50px;
}

.form-select {
    cursor: pointer;
}

.form-input.error,
.form-textarea.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-error {
    display: block;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Buttons */
.auth-submit-btn,
.address-confirm-btn,
.note-save-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .auth-submit-btn:hover,
    .address-confirm-btn:hover,
    .note-save-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

.note-cancel-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .note-cancel-btn:hover {
        background: var(--bg-hover);
    }

/* =============================================
   Note System
============================================= */
.cart-note-section {
    padding: 0.5rem;
}

.add-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-main);
    border: 1px dashed var(--border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

    .add-note-btn:hover {
        background: var(--bg-hover);
        border-color: var(--primary);
        color: var(--primary);
    }

.note-display {
    position: relative;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
}

.note-content {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-edit-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .note-edit-btn:hover {
        background: var(--bg-hover);
        color: var(--primary);
    }

.note-modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.note-textarea {
    width: 100%;
    min-height: 122px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.2s ease;
    font-family: inherit;
}

.note-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

/* =============================================
   Authentication
============================================= */
.auth-step {
    display: none;
}

    .auth-step.active {
        display: block;
    }

.auth-body {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.auth-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0;
    direction: ltr;
}

.otp-input {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-main);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

    .otp-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    }

.otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

    .link-btn:hover {
        text-decoration: underline;
    }

.resend-timer {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Registration Form */
.gender-options {
    display: flex;
    gap: 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

    .radio-label input[type="radio"] {
        width: 20px;
        height: 20px;
        accent-color: var(--primary);
    }

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.5rem;
}

/* =============================================
   Address Management
============================================= */
.address-step {
    display: none;
    height: 100%;
    flex-direction: column;
}

    .address-step.active {
        display: flex;
    }

.address-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.address-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.address-item {
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.address-item.selected {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.address-item:hover {
    border-color: var(--primary-light);
}

.address-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.address-item.selected::before {
    opacity: 1;
}

.address-radio {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.address-info {
    padding-right: 2.5rem;
}

.address-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

    .address-title i {
        color: var(--primary);
        margin-left: 0.5rem;
    }

.address-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.address-receiver {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .address-receiver i {
        color: var(--text-muted);
        margin-left: 0.25rem;
    }

.address-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.address-edit-btn,
.address-delete-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
}

    .address-edit-btn:hover {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        transform: translateY(-1px);
    }

    .address-delete-btn:hover {
        background: var(--danger);
        color: white;
        border-color: var(--danger);
        transform: translateY(-1px);
    }

.add-address-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-main);
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .add-address-btn:hover {
        background: var(--bg-hover);
        border-color: var(--primary);
    }

/* =============================================
   Map
============================================= */
.map-container {
    position: relative;
    flex: 1;
    min-height: 400px;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-main);
    width: 100%;
}

#addressMap {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: var(--border-radius);
    position: relative;
    background: #f0f0f0;
}

.leaflet-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    font-family: inherit;
}

.map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 2.2rem;
    color: var(--danger);
    pointer-events: none;
    z-index: 1000;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, -100%) translateY(0);
    }

    40% {
        transform: translate(-50%, -100%) translateY(-12px);
    }

    60% {
        transform: translate(-50%, -100%) translateY(-6px);
    }
}

.my-location-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1000;
    font-size: 0.85rem;
    min-width: 140px;
    justify-content: center;
}

    .my-location-btn:hover {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        transform: translateY(-3px);
        box-shadow: var(--shadow-xl);
    }

    .my-location-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Leaflet Customizations */
.leaflet-control-zoom {
    border: none;
    box-shadow: var(--shadow);
}

    .leaflet-control-zoom a {
        background: var(--bg-card);
        color: var(--text-primary);
        border: 1px solid var(--border);
        transition: all 0.2s ease;
    }

        .leaflet-control-zoom a:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

.leaflet-control-attribution {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.8);
    color: #666;
    border-radius: 4px;
    padding: 2px 5px;
}

[data-theme="dark"] .leaflet-control-attribution {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
}

/* =============================================
   Checkout Process
============================================= */
.checkout-page {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    background: var(--bg-main);
    z-index: 1500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* استفاده از dvh برای مرورگرهای جدید */
    height: 100dvh;
    min-height: 100dvh;
}

/* Fallback برای مرورگرهای قدیمی */
@supports not (height: 100dvh) {
    .checkout-page {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

    .checkout-page.active {
        left: 0;
    }

.checkout-header {
    display: flex;
    align-items: center;
    padding: 1rem 0.5rem;
    gap: 1rem;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

    .checkout-header h3 {
        font-weight: 700;
        font-size: 0.9rem;
        margin: 0;
    }

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
}

    .back-btn:hover {
        background: var(--bg-hover);
        color: var(--primary);
    }

/* Progress Bar */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

    .progress-step.active {
        background: var(--primary);
        color: white;
        transform: scale(1.1);
    }

    .progress-step.completed {
        background: var(--success);
        color: white;
    }

.progress-line {
    width: 30px;
    height: 3px;
    background: var(--border);
    transition: all 0.3s ease;
}

    .progress-line.completed {
        background: var(--success);
    }

/* Checkout Steps */
.checkout-step {
    display: none;
    flex-direction: column;
    height: calc(100vh - 120px);
}

    .checkout-step.active {
        display: flex;
    }

.checkout-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.checkout-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

    .section-title i {
        color: var(--primary);
        font-size: 1rem;
    }

/* Delivery Time */
.delivery-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.time-option {
    position: relative;
    cursor: pointer;
}

    .time-option input[type="radio"] {
        display: none;
    }

    .time-option:first-child {
        grid-column: 1/3;
    }

.time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    min-height: 70px;
}

    .time-label i {
        font-size: 1.1rem;
        margin-left: 0.5rem;
        color: var(--primary);
    }

    .time-label small {
        font-size: 0.7rem;
        color: var(--text-secondary);
        margin-right: 0.5rem;
    }

.time-option input[type="radio"]:checked + .time-label {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.02);
}

    .time-option input[type="radio"]:checked + .time-label i,
    .time-option input[type="radio"]:checked + .time-label small {
        color: white;
    }

/* Discount Section */
.discount-input-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.discount-input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    direction: ltr;
    text-align: center;
}

    .discount-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    }

.apply-discount-btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .apply-discount-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
    }

.discount-result {
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-weight: 500;
}

    .discount-result.success {
        background: var(--success);
        color: white;
    }

    .discount-result.error {
        background: var(--danger);
        color: white;
    }

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.payment-option {
    display: block;
    cursor: pointer;
}

    .payment-option input[type="radio"] {
        display: none;
    }

.payment-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

    .payment-content i {
        font-size: 1.5rem;
        color: var(--primary);
    }

.payment-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.payment-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.payment-option input[type="radio"]:checked + .payment-content {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

    .payment-option input[type="radio"]:checked + .payment-content i,
    .payment-option input[type="radio"]:checked + .payment-content .payment-info small {
        color: white;
    }

/* Gateway Sub-Section (انتخاب درگاه زیر پرداخت آنلاین) */
.gateway-sub-section {
    margin: 0.5rem 0 0.5rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    border-right: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gateway-sub-section .payment-option .payment-content {
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

/* Bank Transfer */
.bank-transfer-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.bank-info h5 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.bank-details {
    margin-bottom: 1.5rem;
}

.bank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

    .bank-item:last-child {
        border-bottom: none;
    }

.bank-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bank-value {
    font-weight: 600;
    font-size: 0.9rem;
    direction: ltr;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

    .copy-btn:hover {
        background: var(--primary-dark);
    }

/* Receipt Upload */
.receipt-upload h5 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

    .upload-area:hover {
        border-color: var(--primary);
        background: var(--bg-hover);
    }

.upload-content i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.upload-content p {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-content small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--success);
    color: white;
    border-radius: var(--border-radius-sm);
}

.upload-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Checkout Footer */
.checkout-footer {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.checkout-next-btn,
.checkout-back-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    width: 100%;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.checkout-next-btn {
    background: var(--gradient-primary);
    color: white;
    margin-left: auto;
}

    .checkout-next-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .checkout-next-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.checkout-back-btn {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

    .checkout-back-btn:hover {
        background: var(--bg-hover);
        transform: translateY(-1px);
    }

/* Final Review */
.final-review-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

    .final-review-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .final-review-section h5 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.9rem;
    }

        .final-review-section h5 i {
            color: var(--primary);
            font-size: 0.85rem;
        }

.final-order-items,
.order-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.final-item,
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}

.final-item-info,
.order-item-info {
    flex: 1;
}

    .final-item-info h6,
    .order-item-info h6 {
        font-weight: 600;
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }

    .final-item-info small,
    .order-item-info small {
        color: var(--text-secondary);
        font-size: 0.75rem;
    }

.final-item-price,
.order-item-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.final-address-info,
.final-delivery-time,
.final-payment-method,
.final-discount-info,
.final-order-note {
    background: var(--bg-main);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

    .final-address-info .address-title {
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text-primary);
    }

    .final-address-info .address-details {
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }

    .final-address-info .address-receiver {
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

.final-delivery-time {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.final-payment-method {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .final-payment-method i {
        color: var(--primary);
        font-size: 1.1rem;
    }

.final-discount-info {
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.final-order-note {
    font-style: italic;
    color: var(--text-secondary);
}

/* Total Section */
.final-total-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.total-breakdown {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

    .total-row.final-total {
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        font-weight: 700;
        font-size: 1rem;
        color: var(--primary);
    }

.final-order-btn {
    width: 100%;
    background: var(--gradient-success);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .final-order-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
    }

    .final-order-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* =============================================
   Page Transitions & Overlays
============================================= */
.addon-page,
.search-page {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-main);
    z-index: 1500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

    .addon-page.active,
    .search-page.active {
        left: 0;
    }

.addon-header,
.search-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1rem;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

    .addon-header h3 {
        font-weight: 700;
        font-size: 1.25rem;
    }

.addon-content {
    padding: 1.5rem;
}

.addon-product-info {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.addon-product {
    display: flex;
    gap: 1rem;
    align-items: center;
}

    .addon-product img {
        width: 70px;
        height: 70px;
        border-radius: var(--border-radius-sm);
        box-shadow: var(--shadow-sm);
    }

    .addon-product h4 {
        font-weight: 700;
        margin-bottom: 0.25rem;
        font-size: 1.1rem;
    }

    .addon-product .price {
        color: var(--primary);
        font-weight: 700;
        font-size: 1rem;
    }

.addon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    cursor: pointer;
}

    .addon-item:hover {
        transform: translateX(-5px);
        box-shadow: var(--shadow);
        border-color: var(--primary-light);
    }

    .addon-item label {
        cursor: pointer;
        font-weight: 500;
        color: var(--text-primary);
    }

.addon-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

.addon-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    padding: 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.addWithAddon-btn {
    width: 100%;
    background: var(--gradient-success);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .addWithAddon-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
    }

/* Search */
.search-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    }

.search-results {
    padding: 1.5rem;
}

/* =============================================
   Empty States & Utilities
============================================= */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

    .empty-state i {
        font-size: 3rem;
        color: var(--text-muted);
        margin-bottom: 1rem;
    }

    .empty-state p {
        margin: 0;
        font-size: 0.95rem;
    }

.delivery-cost-info {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-main);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

    .delivery-cost-info.free {
        color: var(--success);
        border: 1px solid var(--success);
        background: rgba(107, 142, 35, 0.1);
    }

    .delivery-cost-info.paid {
        color: var(--warning);
        border: 1px solid var(--warning);
        background: rgba(205, 133, 63, 0.1);
    }

    .delivery-cost-info.danger {
        color: var(--danger);
        border: 1px solid var(--danger);
        background: rgba(139, 69, 19, 0.1);
    }

/* =============================================
   SweetAlert2 Customizations
============================================= */
.swal2-container {
    z-index: 100000;
}

.swal2-popup {
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    direction: rtl;
    text-align: right;
}

    .swal2-popup.swal2-toast {
        margin-bottom: 4.2rem;
        background: var(--bg-card) !important;
        padding: 0.3em !important;
    }

        .swal2-popup.swal2-toast .swal2-title {
            margin: 0;
        }

.swal2-title {
    font-family: inherit;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.8;
    padding: .8em 1em !important;
    font-size: 0.8em !important;
    margin: 0 !important;
}

.swal2-html-container {
    font-family: inherit;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: .5em !important;
    font-size: 1em !important;
}

.swal2-confirm {
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

    .swal2-confirm:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
    }

.swal2-cancel {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

    .swal2-cancel:hover {
        background: var(--bg-main);
        transform: translateY(-1px);
    }

.swal2-toast {
    border-radius: var(--border-radius);
    font-family: inherit;
    direction: rtl;
}

    .swal2-toast .swal2-title {
        font-size: 0.9rem;
        margin: 0;
        text-align: right;
    }

    .swal2-toast .swal2-icon {
        margin: 0 0.5rem 0 0;
    }

[data-theme="dark"] .swal2-popup {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .swal2-title {
    color: var(--text-primary);
}

[data-theme="dark"] .swal2-html-container {
    color: var(--text-secondary);
}

[data-theme="dark"] .swal2-input {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .swal2-toast {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* =============================================
   Payment Gateway Simulation
============================================= */
.payment-gateway {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .payment-gateway.active {
        opacity: 1;
        visibility: visible;
    }

.payment-gateway-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.payment-gateway.active .payment-gateway-content {
    transform: scale(1);
}

.payment-gateway-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

    .payment-gateway-header i {
        font-size: 2.5rem;
        color: var(--primary);
        margin-bottom: 0.5rem;
    }

    .payment-gateway-header h3 {
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
    }

.gateway-logo {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

    .gateway-logo i {
        font-size: 1.5rem;
    }

.gateway-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    direction: rtl;
}

.gateway-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.gateway-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.gateway-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

    .gateway-btn.success {
        background: var(--gradient-success);
        color: white;
    }

        .gateway-btn.success:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

    .gateway-btn.cancel {
        background: var(--bg-hover);
        color: var(--text-primary);
        border: 1px solid var(--border);
    }

/* =============================================
   Responsive Design
============================================= */
/* Desktop Layout */
@media (min-width: 1024px) {
    body {
        padding-top: 0;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .main-layout {
        display: block;
        padding-top: 73px;
    }

    .cart-sidebar {
        position: fixed;
        top: 7.8rem;
        left: 0;
        width: 400px;
        height: calc(100vh - 73px);
        transform: none;
        box-shadow: var(--shadow);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 100;
    }

        .cart-sidebar.active {
            left: 0;
        }

    .content-wrapper {
        margin-left: 400px;
        min-height: calc(100vh - 73px);
        overflow: visible;
        position: relative;
    }

    .categories-wrapper {
        position: sticky;
        top: 73px;
        z-index: 90;
        background: var(--bg-card);
        margin-left: -400px;
        padding-left: 400px;
    }

    .floating-cart {
        display: none;
    }

    .cart-header {
        flex-shrink: 0;
        margin-top: 10px;
    }

    .cart-items {
        flex: 2;
        overflow-y: auto;
        padding: 1rem;
    }

    .cart-footer {
        flex-shrink: 0;
        position: relative;
        bottom: auto;
        flex:1.7;
    }

    .close-cart {
        display: none;
    }

    .products-container {
        margin: 0 auto;
        padding: 5.5rem 1.5rem 0.5rem;
    }

    .product-card {
        margin-bottom: 0.5rem;
    }

    .cart-note-section {
        margin: 0 1rem;
        padding: 0.75rem 0;
        flex:0.4;
    }

    .add-note-btn,
    .note-display {
        margin: 0;
    }
}

/* Larger Desktop */
@media (min-width: 1440px) {
    .cart-sidebar {
        width: 450px;
    }

    .content-wrapper {
        margin-left: 450px;
    }

    .categories-wrapper {
        margin-left: -450px;
        padding-left: 450px;
    }
}

/* Mobile Specific */
@media (max-width: 1023px) {
    .cart-sidebar {
        left: -120%;
        overflow: hidden;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        display: flex;
        flex-direction: column;
    }

        .cart-sidebar.active {
            left: 0;
        }

        .cart-sidebar .cart-header {
            flex-shrink: 0;
            position: relative;
            z-index: 10;
            height: auto;
            min-height: 70px;
        }

        .cart-sidebar .cart-items {
            flex: 1;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 0.5rem;
            margin-bottom: 0;
            position: relative;
            top: auto;
            bottom: auto;
            left: auto;
            right: auto;
        }

        .cart-sidebar .cart-footer {
            flex-shrink: 0;
            position: relative;
            bottom: auto;
            left: auto;
            width: 100%;
            background: var(--bg-card);
            border-top: 1px solid var(--border-light);
            z-index: 10;
            padding: 0.75rem 1rem;
            box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
            min-height: 80px;
        }

    .cart-note-section {
        padding: 0.5rem;
        margin: 0.5rem 0;
        position: relative;
        bottom: auto;
        z-index: auto;
        width: auto;
    }

    .checkout-btn {
        width: 100%;
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        font-weight: 700;
        border: none;
        border-radius: var(--border-radius-sm);
        background: var(--gradient-success);
        color: white;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        box-shadow: var(--shadow);
        -webkit-tap-highlight-color: transparent;
    }

        .checkout-btn:hover,
        .checkout-btn:active {
            transform: translateY(-1px);
            box-shadow: var(--shadow-lg);
        }
}

/* Safe Area for iPhone X and higher */
@supports (padding: max(0px)) {
    @media (max-width: 1023px) {
        .cart-sidebar .cart-footer {
            padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        }

        .floating-cart {
            bottom: max(1rem, env(safe-area-inset-bottom));
        }

        .checkout-footer {
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }

        .checkout-page {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* iOS Safari Specific */
@supports (-webkit-touch-callout: none) {
    .cart-sidebar {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
}

/* Tablet */
@media (min-width: 768px) {
    .note-modal-backdrop.active {
        backdrop-filter: blur(4px);
    }

    .note-modal,
    .auth-modal,
    .address-modal {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90%;
        max-width: 500px;
        border-radius: var(--border-radius-lg);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

        .note-modal.active,
        .auth-modal.active,
        .address-modal.active {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: auto;
        }

    .note-modal {
        max-height: 70vh;
    }

    .auth-modal {
        max-width: 450px;
        max-height: 80vh;
    }

    .address-modal {
        max-width: 600px;
        height: 90vh;
    }

    .auth-body {
        max-height: calc(80vh - 80px);
        padding: 1rem 1.5rem;
    }

    .auth-desc {
        margin-bottom:0;
    }

    .otp-inputs {
        margin: 0.75rem 0;
    }

    .otp-actions {
        margin-bottom: 1rem;
    }

    .delivery-time-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .time-label {
        min-height: 60px;
        padding: 0.75rem;
    }

    .checkout-content {
        padding: 0.75rem;
    }

    .checkout-section {
        padding: 1rem;
    }

    .discount-input-group {
        flex-direction: column;
    }

    .apply-discount-btn {
        width: 100%;
        justify-content: center;
    }

    .checkout-progress {
        padding: 0 0.5rem;
    }

    .progress-step {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .progress-line {
        width: 30px;
    }
}

/* Small Mobile */
@media (max-width: 768px) {
    .my-location-btn {
        bottom: 0.75rem;
        right: 0.75rem;
        padding: 0.6rem 0.85rem;
        font-size: 0.8rem;
        min-width: 120px;
    }

    .map-center-marker {
        font-size: 2rem;
    }

    .address-footer {
        padding: 0.75rem 1rem;
    }

    .map-container,
    #addressMap {
        min-height: 350px;
        height: 350px;
    }

    .address-actions {
        gap: 0.25rem;
    }

    .address-edit-btn,
    .address-delete-btn {
        width: 100%;
        justify-content: center;
    }

    .otp-input {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        -webkit-appearance: none;
        -moz-appearance: textfield;
    }

        /* حذف spinner در Firefox */
        .otp-input::-moz-inner-spin-button,
        .otp-input::-moz-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
            -moz-appearance: textfield;
        }

        /* حذف spinner در Chrome/Safari */
        .otp-input::-webkit-outer-spin-button,
        .otp-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
}

@media (max-width: 480px) {
    .checkout-progress {
        gap: 0.2rem;
        padding: 0;
    }

    .progress-step {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .progress-line {
        width: 15px;
    }

    #checkoutMap {
        height: 250px;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Fallback برای مرورگرهای قدیمی */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}


/* =============================================
   Loading States
============================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .loading-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.loading-spinner {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

    .loading-spinner i {
        font-size: 3rem;
        color: var(--primary);
        margin-bottom: 1rem;
    }

    .loading-spinner p {
        color: var(--text-primary);
        margin: 0;
        font-weight: 600;
    }

.inline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

    .inline-loading i {
        font-size: 2rem;
        margin-left: 0.5rem;
    }


/* =============================================
   iOS Safe Area Support
============================================= */
@supports (padding: env(safe-area-inset-bottom)) {
    .checkout-page,
    .cart-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .checkout-footer,
    .cart-footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .floating-cart {
        bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}


/* ==========================================
   USER PANEL STYLES
   ========================================== */

/* Backdrop */
.user-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .user-panel-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

/* Main Panel */
.user-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    background: var(--bg-main);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100dvh;
    min-height: 100dvh;
}

@supports not (height: 100dvh) {
    .user-panel {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

.user-panel.active {
    right: 0;
}

/* Header */
.user-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

    .user-panel-header h3 {
        font-size: 1.1rem;
        font-weight: 700;
        margin: 0;
        color: var(--text-primary);
    }

.mobile-logout-btn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

    .mobile-logout-btn:hover {
        background: var(--danger);
        color: white;
    }

/* Mobile User Info Header */
.user-panel-mobile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-bottom: 1px solid var(--border);
}

.user-panel-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-panel-user-details {
    flex: 1;
}

.user-panel-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.user-panel-user-phone {
    font-size: 0.85rem;
    opacity: 0.9;
    direction: ltr;
    text-align: right;
}

/* Content Area */
.user-panel-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar (Desktop) */
.user-panel-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.user-panel-user-info {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.user-panel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 0.75rem;
    box-shadow: var(--shadow-lg);
}

/* Navigation */
.user-panel-nav {
    flex: 1;
    padding: 1rem 0;
}

.user-panel-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

    .user-panel-nav-item i {
        font-size: 1.1rem;
        width: 24px;
    }

    .user-panel-nav-item:hover {
        background: var(--bg-hover);
        color: var(--primary);
    }

    .user-panel-nav-item.active {
        background: rgba(160, 125, 61, 0.1);
        color: var(--primary);
        font-weight: 600;
    }

        .user-panel-nav-item.active::before {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background: var(--primary);
        }

/* Logout Button */
.user-panel-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    margin: 1rem;
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .user-panel-logout-btn:hover {
        background: var(--danger);
        color: white;
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

/* Main Content */
.user-panel-main {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 5rem;
    background: var(--bg-main);
}

.user-panel-section {
    display: none;
}

    .user-panel-section.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Title */
.user-panel-section .section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

    .user-panel-section .section-title i {
        color: var(--primary);
        font-size: 1.2rem;
    }

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--primary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow);
    }

        .stat-card:hover::before {
            transform: scaleY(1);
        }

.stat-card-primary .stat-icon {
    background: rgba(160, 125, 61, 0.1);
    color: var(--primary);
}

.stat-card-warning .stat-icon {
    background: rgba(205, 133, 63, 0.1);
    color: var(--warning);
}

.stat-card-warning::before {
    background: var(--warning);
}

.stat-card-success .stat-icon {
    background: rgba(107, 142, 35, 0.1);
    color: var(--success);
}

.stat-card-success::before {
    background: var(--success);
}

.stat-card-info .stat-icon {
    background: rgba(112, 128, 144, 0.1);
    color: var(--info);
}

.stat-card-info::before {
    background: var(--info);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick Actions */
.dashboard-quick-actions {
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .dashboard-section-title i {
        color: var(--primary);
        font-size: 1.1rem;
    }

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action-btn {
    background: var(--bg-main);
    border: 2px solid var(--border);
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

    .quick-action-btn i {
        font-size: 1.5rem;
        color: var(--primary);
        transition: transform 0.3s ease;
    }

    .quick-action-btn:hover {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

        .quick-action-btn:hover i {
            color: white;
            transform: scale(1.1);
        }

/* Recent Orders */
.dashboard-recent-orders {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.view-all-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

    .view-all-btn:hover {
        background: rgba(160, 125, 61, 0.1);
    }

    .view-all-btn i {
        font-size: 0.75rem;
    }

.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-order-item {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .recent-order-item:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow-sm);
    }

.recent-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.recent-order-id {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .recent-order-id i {
        color: var(--primary);
        font-size: 0.85rem;
    }

.recent-order-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.recent-order-date {
    color: var(--text-secondary);
}

.recent-order-price {
    font-weight: 600;
    color: var(--primary);
}

.dashboard-empty-orders {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

    .dashboard-empty-orders i {
        font-size: 3rem;
        opacity: 0.3;
        margin-bottom: 1rem;
    }

    .dashboard-empty-orders p {
        margin-bottom: 1rem;
    }

    .dashboard-empty-orders .quick-action-btn {
        display: inline-flex;
        margin: 0 auto;
    }

/* Responsive Dashboard */
@media (max-width: 767px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 0.5rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .quick-actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Profile */
.profile-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .profile-info-label i {
        color: var(--primary);
    }

.profile-info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
}

/* Addresses Section */
.section-header-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

    .section-header-panel .section-title {
        margin-bottom: 0;
        border-bottom: none;
        padding-bottom: 0;
    }

.user-panel-address-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

    .user-panel-address-card:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

    .user-panel-address-card .address-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .user-panel-address-card .address-title i {
            color: var(--primary);
        }

    .user-panel-address-card .address-details {
        font-size: 0.9rem;
        color: var(--text-secondary);
        line-height: 1.6;
        margin-bottom: 0.75rem;
    }

    .user-panel-address-card .address-receiver {
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .user-panel-address-card .address-receiver i {
            color: var(--text-muted);
        }

    .user-panel-address-card .address-actions {
        display: flex;
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light);
    }

    .user-panel-address-card .address-edit-btn,
    .user-panel-address-card .address-delete-btn {
        flex: 1;
        padding: 0.5rem;
        border: none;
        border-radius: var(--border-radius-sm);
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
    }

    .user-panel-address-card .address-edit-btn {
        background: rgba(160, 125, 61, 0.1);
        color: var(--primary);
        border: 1px solid var(--primary);
    }

        .user-panel-address-card .address-edit-btn:hover {
            background: var(--primary);
            color: white;
        }

    .user-panel-address-card .address-delete-btn {
        background: rgba(136, 0, 2, 0.1);
        color: var(--danger);
        border: 1px solid var(--danger);
    }

        .user-panel-address-card .address-delete-btn:hover {
            background: var(--danger);
            color: white;
        }

/* Orders */
.order-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

    .order-filters::-webkit-scrollbar {
        height: 4px;
    }

.filter-btn {
    padding: 0.625rem 1.25rem;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9rem;
}

    .filter-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .filter-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

    .order-card:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.order-id {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .order-id i {
        color: var(--primary);
    }

.order-status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

    .order-status-badge.pending {
        background: rgba(205, 133, 63, 0.1);
        color: var(--warning);
    }

    .order-status-badge.preparing {
        background: rgba(112, 128, 144, 0.1);
        color: var(--info);
    }

    .order-status-badge.delivered {
        background: rgba(107, 142, 35, 0.1);
        color: var(--success);
    }

    .order-status-badge.cancelled {
        background: rgba(136, 0, 2, 0.1);
        color: var(--danger);
    }

.order-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Order Details Modal */
.order-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .order-details-overlay.active {
        display: flex;
    }

.order-details-modal {
    background: var(--bg-main);
    border-radius: var(--border-radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

    .order-details-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--text-primary);
        font-weight: 700;
    }

.order-details-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.order-detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

    .order-detail-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .order-detail-section h4,
    .order-detail-section h5 {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .order-detail-section h4 i,
        .order-detail-section h5 i {
            color: var(--primary);
            font-size: 0.95rem;
        }

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.order-item-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.order-item-info .item-quantity {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-item-info .item-addons {
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.order-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.order-summary {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

    .summary-row.total {
        border-top: 2px solid var(--border);
        margin-top: 0.5rem;
        padding-top: 1rem;
        font-size: 1rem;
        font-weight: 700;
        color: var(--primary);
    }

/* Mobile Bottom Navigation */
.user-panel-mobile-nav {
    display: none; /* ✅ پیش‌فرض مخفی */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

/* ✅ فقط وقتی پنل active باشه نمایش داده بشه */
@media (max-width: 1023px) {
    .user-panel.active .user-panel-mobile-nav {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    flex: 1;
    min-width: 0;
}

    .mobile-nav-item i {
        font-size: 1.25rem;
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

    .empty-state i {
        font-size: 4rem;
        margin-bottom: 1rem;
        opacity: 0.3;
    }

    .empty-state p {
        font-size: 1rem;
        margin: 0;
    }

/* ==========================================
   RESPONSIVE - USER PANEL
   ========================================== */

/* Desktop */
@media (min-width: 1024px) {
    .user-panel {
        right: -100%;
        width: 80%;
        max-width: 1200px;
        box-shadow: var(--shadow-xl);
    }

    .user-panel-mobile-info {
        display: none;
    }

    .user-panel-sidebar {
        display: flex;
    }

    .user-panel-main {
        padding: 2rem;
        padding-bottom: 2rem;
    }

    .user-panel-mobile-nav {
        display: none;
    }

    .mobile-logout-btn {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .user-panel-header {
        padding: 1.5rem 2rem;
    }

        .user-panel-header .back-btn {
            position: absolute;
            left: 1.5rem;
        }

        .user-panel-header h3 {
            font-size: 1.3rem;
        }

        .user-panel-header .mobile-logout-btn {
            display: none;
        }

    .user-panel-user-phone {
        text-align:center;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .user-panel-sidebar {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-card-body {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .user-panel-sidebar {
        display: none;
    }

    /*.dashboard-stats {
        grid-template-columns: 1fr;
    }*/

    .order-card-body {
        grid-template-columns: 1fr;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .order-filters {
        gap: 0.25rem;
    }

    .filter-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .order-details-overlay {
        padding: 0;
    }

    .order-details-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

.user-panel-theme-toggle {
    padding-top:1rem;
    text-align:center;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

    .theme-toggle-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
    }

    .theme-toggle-btn i {
        font-size: 1rem;
    }


.Enamad {
    position: fixed;
    top: 70px;
    right: 120px;
    background: #9c9494d6;
    width: 50px;
    padding: 3px;
    border-radius: 3px;
}

    .Enamad img {
        width: 100%;
    }