/* فونت‌های فارسی */
/*@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap'); */

:root {
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-inverse: #ffffff;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #131313;
    --bg-secondary: #3a3a3a;
    --glass-bg: rgba(45, 45, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-inverse: #1e293b;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    transition: var(--transition);
    min-block-size: 100vh;
    overflow-x: hidden;
    font-weight: 400;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 100%;
    block-size: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.container {
    max-inline-size: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glass Effect */
.glass-card, .glass-button, .glass-header, .glass-footer {
    background: var(--bg-primary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Header */
.glass-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 1000;
    padding: 15px 0;
    margin-block-end: 30px;
    animation: slideDown 0.5s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    block-size: 50px;
    max-block-size: 50px;
    inline-size: auto;
    object-fit: contain;
    border-radius: 10px;
}

.logo-icon {
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.glass-button {
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

.theme-toggle {
    font-size: 1.3rem;
    padding: 10px 15px;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: rotate 20s linear infinite;
}

.theme-icon svg {
    color: var(--text-primary);
}

/* Cart Button */
.cart-button {
    position: relative;
    font-size: 1.3rem;
    padding: 10px 15px;
}

.cart-icon {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-icon svg {
    color: var(--text-primary);
}

.profile-button {
    position: relative;
    font-size: 1.3rem;
    padding: 10px 15px;
}

.profile-icon {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-icon svg {
    color: var(--text-primary);
}

.cart-count {
    position: absolute;
    inset-block-start: -5px;
    inset-inline-start: -5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    inline-size: 24px;
    block-size: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: bounce 0.5s ease;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Cart Mini Notification */
.cart-mini-notification {
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-mini-notification span {
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset-inline-start: 0;
    inset-block-start: 0;
    inline-size: 100%;
    block-size: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    inline-size: 90%;
    max-inline-size: 400px;
    max-block-size: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    animation: slideUp 0.3s ease;
    transform: none !important; /* جلوگیری از تغییر transform با hover */
    transition: none !important; /* غیرفعال کردن انیمیشن‌های transition */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-block-end: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--primary-color);
    margin: 0;
}

.modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
}

.back-modal:hover {
    color: var(--primary-color);
    background: var(--glass-bg);
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    position: relative;
}

/* افکت گرادیانت دایره‌ای فقط برای پاپ‌آپ‌های اطلاعات */
.info-modal-body {
    overflow: hidden;
}

/* لایه اول - توپ گرادیانت دایره‌ای */
.info-modal-body::before {
    content: '';
    position: absolute;
    inset-block-start: -75%;
    inset-inline-start: -75%;
    inline-size: 200%;
    block-size: 200%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(99, 102, 241, 0.2) 0%,
        rgba(139, 92, 246, 0.15) 15%,
        rgba(236, 72, 153, 0.1) 30%,
        rgba(99, 102, 241, 0.05) 45%,
        rgba(99, 102, 241, 0.02) 60%,
        transparent 75%
    );
    animation: floatingCircle1 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

/* لایه دوم - توپ گرادیانت دایره‌ای */
.info-modal-body::after {
    content: '';
    position: absolute;
    inset-block-end: -75%;
    inset-inline-end: -75%;
    inline-size: 180%;
    block-size: 180%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(236, 72, 153, 0.18) 0%,
        rgba(139, 92, 246, 0.12) 15%,
        rgba(99, 102, 241, 0.08) 30%,
        rgba(139, 92, 246, 0.05) 45%,
        rgba(139, 92, 246, 0.02) 60%,
        transparent 75%
    );
    animation: floatingCircle2 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

.info-modal-body > * {
    position: relative;
    z-index: 1;
}

.modal-body > * {
    position: relative;
    z-index: 1;
}

@keyframes floatingCircle1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(20%, 15%) scale(1.15);
        opacity: 0.85;
    }
    50% {
        transform: translate(-10%, 25%) scale(0.9);
        opacity: 1;
    }
    75% {
        transform: translate(-20%, -10%) scale(1.1);
        opacity: 0.9;
    }
}

@keyframes floatingCircle2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.9;
    }
    33% {
        transform: translate(-15%, 20%) scale(1.12);
        opacity: 1;
    }
    66% {
        transform: translate(12%, -15%) scale(0.88);
        opacity: 0.85;
    }
}

.modal-footer {
    padding: 20px;
    border-block-start: 1px solid var(--glass-border);
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-block-size: 340px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 10px 5px;
    border-radius: 12px;
}

.cart-item img {
    inline-size: 55px;
    block-size: 55px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 3px 0;
    font-size: 0.9rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.85rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    inline-size: 30px;
    block-size: 30px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.quantity {
    min-inline-size: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.remove-btn:hover {
    transform: scale(1.2);
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-block-end: 20px;
}

.checkout-button {
    inline-size: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #10b981, #34d399, #6ee7b7);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    animation: gradientShift 3s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.checkout-button::before {
    content: '';
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    inline-size: 0;
    block-size: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.checkout-button:hover::before {
    inline-size: 300px;
    block-size: 300px;
}

.checkout-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.6);
}

.checkout-button:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Checkout Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkout-summary {
    padding: 15px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.summary-items {
    display: none; /* مخفی کردن جزئیات اقلام */
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.submit-order {
    inline-size: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #10b981, #34d399, #6ee7b7);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    animation: gradientShift 3s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.submit-order::before {
    content: '';
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    inline-size: 0;
    block-size: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.submit-order:hover::before {
    inline-size: 300px;
    block-size: 300px;
}

.submit-order:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.6);
}

.submit-order:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Main Content Layout */
.main-content-section {
    padding: 40px 0;
}

/* دسکتاپ: padding صفر */
@media (min-width: 768px) {
    .main-content-section {
        padding: 0;
    }
    
    /* Force 3 columns on desktop - override any other classes */
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .products-grid.single-column,
    .products-grid.two-columns,
    .products-grid.list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.content-layout {
    display: flex;
    flex-direction: row-reverse; /* در RTL، row-reverse یعنی ساید بار سمت چپ */
    gap: 30px;
    align-items: flex-start;
}

/* Products Area - Left Side (2 columns) */
.products-area {
    flex: 1;
    min-inline-size: 0;
}

/* View Toggle Buttons */
.view-toggle-buttons {
    display: none;
    gap: 12px;
    margin-bottom: 25px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.view-toggle-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    transition: all 0.3s ease;
}

/* Grid Layout Variations */
.products-grid.single-column {
    grid-template-columns: 1fr;
}

.products-grid.two-columns {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid.list {
    grid-template-columns: 1fr;
}

.products-grid.list .product-card {
    flex-direction: row !important;
    gap: 20px !important;
    padding: 20px !important;
    align-items: flex-start !important;
    overflow: visible !important;
}

.products-grid.list .product-image {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    height: 70px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    flex-shrink: 0;
    order: -1;
}

.products-grid.list .product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.products-grid.list .product-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
}

.products-grid.list .product-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 0 !important;
    flex: 1;
}

.products-grid.list .product-name {
    font-size: 1.1rem !important;
    margin-bottom: 5px !important;
}

.products-grid.list .product-description {
    margin-bottom: 10px !important;
    font-size: 0.9rem !important;
}

.products-grid.list .product-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 15px !important;
    margin-top: auto !important;
    border-top: none !important;
    padding-top: 0 !important;
    border-block-start: none !important;
    padding-block-start: 0 !important;
}

.products-grid.list .product-price {
    font-size: 1.2rem !important;
    min-width: 120px !important;
}

.products-grid.list .product-order-section {
    width: auto !important;
    flex-shrink: 0;
}


/* Categories Sidebar - Right Side */
.categories-sidebar {
    flex-shrink: 0;
    position: sticky;
    inset-block-start: 100px;
    max-block-size: 80%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-inline-end: 5px; /* تغییر از start به end */
    max-height: 650px;
    top: 115px;
}

/* اسکرول‌بار سفارشی */
.categories-sidebar::-webkit-scrollbar {
    inline-size: 8px;
}

.categories-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.categories-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    transition: var(--transition);
}

.categories-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.sidebar-header {
    padding: 20px;
    border-radius: var(--border-radius);
    margin-block-end: 20px;
    text-align: center;
}

.sidebar-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 20px;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    animation: fadeInRight 0.5s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
}

.category-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.category-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 24px;
    height: 24px;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Main Search Wrapper - Below "منوی ما" */
.main-search-wrapper {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.main-search-wrapper .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.main-search-wrapper .search-icon-wrapper {
    position: absolute;
    right: 15px;
    pointer-events: none;
    z-index: 2;
}

.main-search-wrapper .search-icon {
    display: block;
}

.main-search-wrapper .search-placeholder {
    position: absolute;
    right: 50px;
    left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1rem;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    max-width: calc(100% - 110px);
    z-index: 1;
}

.main-search-wrapper .search-placeholder svg {
    flex-shrink: 0;
}

.main-search-wrapper .placeholder-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #7c7c7c;
}

.main-search-wrapper .search-input:focus + .search-placeholder {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* مخفی کردن placeholder با کلاس */
.search-placeholder.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.main-search-wrapper .search-input {
    width: 100%;
    padding: 14px 50px 14px 50px;
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.main-search-wrapper .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
    transform: translateY(-2px);
}

.main-search-wrapper .search-clear {
    position: absolute;
    left: 12px;
    background: var(--danger-color);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    width: 32px;
    height: 32px;
}

.main-search-wrapper .search-clear:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Products Section */
.products-section {
    margin-block-end: 50px;
}

.section-header {
    text-align: center;
    margin-block-end: 40px;
}

/* Quick Action Buttons */
.quick-actions {
    display: grid;
    gap: 15px;
    margin-block-end: 30px;
    padding: 0 10px;
}

.quick-actions-main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-block-end: 30px;
    padding: 0 10px;
}

.quick-action-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 100%;
    block-size: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.quick-action-btn:hover::before {
    opacity: 0.1;
}

.quick-action-btn svg {
    position: relative;
    z-index: 1;
    stroke: var(--primary-color);
    transition: all 0.3s ease;
}

.quick-action-btn span {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.quick-action-btn:hover svg {
    stroke: var(--primary-color);
    transform: scale(1.1);
}

.quick-action-btn:active {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-actions-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-action-btn {
        padding: 15px 10px;
        font-size: 13px;
    }
    
    .quick-action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile responsive for products grid */
    .products-grid {
        grid-template-columns: 1fr;
    }

    .products-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .view-toggle-buttons {
        display: flex;
        justify-content: center;
        gap: 8px;
    }

    .view-toggle-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .view-toggle-btn span {
        display: none;
    }

    .view-toggle-btn svg {
        width: 18px;
        height: 18px;
    }

    .products-grid.list .product-card {
        grid-template-columns: 150px 1fr;
        gap: 15px;
    }

    .products-grid.list .product-image {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-actions-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 12px 8px;
        font-size: 12px;
        border-radius: 12px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .products-grid.list .product-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .products-grid.list .product-image {
        min-height: 70px;
    }

    .view-toggle-buttons {
        justify-content: center;
        gap: 6px;
    }

    .view-toggle-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .view-toggle-btn svg {
        width: 16px;
        height: 16px;
    }
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-block-end: 15px;
}

.section-divider {
    inline-size: 100px;
    block-size: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto;
    border-radius: 2px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    transition: all 0.3s ease;
}

/* Grid Layout Variations */
.products-grid.single-column {
    grid-template-columns: 1fr;
}

.products-grid.two-columns {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid.list {
    grid-template-columns: 1fr;
}

.product-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out;
}

/* List view specific styles */
.products-grid.list .product-card {
    flex-direction: row !important;
    gap: 20px !important;
    padding: 20px !important;
    align-items: flex-start !important;
    overflow: visible !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.product-card.special {
    border: 2px solid var(--warning-color);
}

.product-card.unavailable {
    opacity: 0.6;
}

.special-badge {
    position: absolute;
    inset-block-start: 15px;
    inset-inline-end: 15px;
    background: var(--warning-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.special-badge svg {
    width: 16px;
    height: 16px;
}

.unavailable-badge {
    position: absolute;
    inset-block-start: 15px;
    inset-inline-start: 15px;
    background: var(--danger-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
}

.product-image {
    inline-size: 100%;
    block-size: 200px;
    overflow: hidden;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-image.no-image span {
    font-size: 4rem;
    opacity: 0.3;
}

.product-content {
    padding: 20px;
}

.product-name {
    font-size: 1.3rem;
    margin-block-end: 10px;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-block-end: 15px;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-start: 15px;
    padding-block-start: 15px;
    border-block-start: 1px solid var(--glass-border);
}

.product-price {
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--success-color);
}

.product-order-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
}

.order-button:hover {
    transform: translateY(-2px) scale(1.05);
}

.button-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-icon svg {
    width: 18px;
    height: 18px;
}

/* No Search Results */
.no-search-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.no-search-results svg {
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 20px;
}

.no-search-results p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* Quantity Controls */
.quantity-controls {
    display: none;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.quantity-btn-minus,
.quantity-btn-plus {
    inline-size: 32px;
    block-size: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn-minus:hover,
.quantity-btn-plus:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.quantity-btn-minus:active,
.quantity-btn-plus:active {
    transform: scale(0.95);
}

.product-quantity {
    min-inline-size: 30px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    border-radius: var(--border-radius);
}

.empty-icon {
    font-size: 5rem;
    margin-block-end: 20px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-block-end: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* Footer */
.glass-footer {
    margin-block-start: 80px;
    padding: 30px 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.footer-subtitle {
    font-size: 0.9rem;
}

/* Modern Footer */
.modern-footer {
    position: relative;
    margin-top: 100px;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 100%);
    overflow: hidden;
    z-index: 999;
}

.footer-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.footer-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.footer-shape.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.3);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.footer-shape.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    bottom: -150px;
    left: 10%;
    animation-delay: 5s;
}

.footer-shape.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.25);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

.modern-footer .container {
    position: relative;
    z-index: 1;
    padding: 60px 20px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* بخش درباره ما */
.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-about .footer-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.footer-about .footer-logo svg {
    color: rgba(255, 255, 255, 0.9);
}

.footer-about .footer-logo h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* عناوین بخش‌ها */
.footer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.footer-title svg {
    color: rgba(255, 255, 255, 0.7);
}

/* لیست‌ها */
.footer-list {
    list-style: none;
    padding: 0;
}

.footer-list li {
    margin-bottom: 12px;
}

.footer-list a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: #ffffff;
    transform: translateX(-5px);
}

/* ساعت کاری */
.working-hours-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.working-hours-item .day {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

.working-hours-item .time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.working-hours-item.highlight {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    justify-content: center;
    gap: 8px;
}

.working-hours-item.highlight svg {
    color: #fff;
    animation: pulse 2s infinite;
}

.working-hours-item.highlight span {
    color: #ffffff;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* آیتم‌های تماس */
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
}

.contact-item svg {
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.contact-item a,
.contact-item span {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    direction: ltr;
    text-align: left;
}

.contact-item a:hover {
    color: #ffffff;
}

/* پایین فوتر */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-wrap: wrap;
    gap: 20px;
}

.copyright p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

.copyright strong {
    color: #ffffff;
    font-weight: 600;
}

.footer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-badge .heart-icon {
    color: #ef4444;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .modern-footer .container {
        padding: 40px 20px 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .footer-about {
        text-align: center;
    }
    
    .footer-about .footer-logo {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-shape.shape-1 {
        width: 250px;
        height: 250px;
    }
    
    .footer-shape.shape-2,
    .footer-shape.shape-3 {
        width: 200px;
        height: 200px;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .categories-sidebar {
        inline-size: 220px;
    }
    
    .category-item {
        padding: 12px 15px;
    }
    
    .category-icon {
        font-size: 1.5rem;
    }
    
    .category-name {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .main-search-wrapper .search-input-wrapper {
        max-width: 100%;
    }
    
    .main-search-wrapper .search-input {
        font-size: 16px;
        padding: 10px 40px 10px 40px;
    }
    
    /* جلوگیری از zoom در موبایل */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* نمایش placeholder در موبایل - با specificity بالا */
    @media (max-width: 768px) {
        .main-search-wrapper .search-input + .search-placeholder {
            font-size: 14px !important;
            right: 40px !important;
            left: auto !important;
            max-width: calc(100% - 85px) !important;
            display: flex !important;
            visibility: visible !important;
            opacity: 1 !important;
            gap: 5px !important;
            z-index: 1 !important;
        }
    }
    
    /* مخفی کردن placeholder در موبایل فقط وقتی متن وارد میشه */
    @media (max-width: 768px) {
        .main-search-wrapper .search-input:focus + .search-placeholder,
        .main-search-wrapper .search-input + .search-placeholder.hidden {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
        }
    }
    
    .main-search-wrapper .search-placeholder svg {
        width: 0;
        height: 0;
        display: none !important;
    }
    
    .main-search-wrapper .search-icon-wrapper {
        right: 12px;
    }
    
    .main-search-wrapper .search-icon-wrapper svg {
        width: 18px;
        height: 18px;
    }
    
    .main-search-wrapper .search-clear {
        left: 8px;
        width: 28px;
        height: 28px;
        padding: 5px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Minimal Mobile Header */
    .glass-header {
        padding: 10px 0;
        margin-block-end: 15px;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .glass-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .theme-toggle,
    .cart-button {
        padding: 6px;
        min-inline-size: auto;
    }
    
    .theme-icon,
    .cart-icon {
        font-size: 1.2rem;
    }
    
    .admin-link {
        font-size: 0;
        padding: 8px;
        min-inline-size: auto;
    }
    
    .admin-link::before {
        content: "🔐";
        font-size: 1.2rem;
    }
    
    /* Mobile Modal */
    .modal-content {
        inline-size: 95%;
        max-block-size: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .cart-item {
        flex-wrap: wrap;
        padding: 8px;
        gap: 8px;
    }
    
    .cart-item img {
        inline-size: 45px;
        block-size: 45px;
    }
    
    .cart-item-details h4 {
        font-size: 0.85rem;
    }
    
    .cart-item-price {
        font-size: 0.8rem;
    }
    
    /* Sidebar becomes minimal on mobile - stays on left */
    .categories-sidebar {
        inline-size: 80px;
        position: fixed;
        inset-inline-start: 10px; /* سمت چپ */
        inset-inline-end: auto;
        inset-block-start: 100px;
        z-index: 100;
        max-block-size: 85%;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px;
        border-radius: 20px;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) transparent;
    }
    
    .categories-sidebar::-webkit-scrollbar {
        inline-size: 4px;
    }
    
    .categories-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .categories-sidebar::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
    }
    
    .sidebar-header {
        padding: 25px;
        margin-block-end: 10px;
    }
    
    .sidebar-header h3 {
        font-size: 0.9rem;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
    
    .categories-list {
        gap: 8px;
    }
    
    .category-item {
        flex-direction: column;
        padding: 12px 8px;
        gap: 5px;
        text-align: center;
    }
    
    .category-icon {
        font-size: 1.8rem;
        margin: 0;
    }
    
    .category-name {
        font-size: 0.75rem;
        writing-mode: horizontal-tb;
        line-height: 1.2;
    }
    
    .content-layout {
        flex-direction: column; /* در موبایل به صورت عمودی */
    }
    
    .products-area {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Ultra minimal header for small mobile */
    .glass-header {
        padding: 8px 0;
        margin-block-end: 10px;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .glass-button {
        font-size: 0.8rem;
    }
    
    .theme-toggle, .admin-link {
        padding: 6px;
    }
    
    .theme-icon, .admin-link::before {
        font-size: 1rem;
    }
    
    .categories-sidebar {
        inline-size: 90px;
        inset-inline-end: 5px;
        inset-block-start: 70px;
        padding: 8px;
        top: 109px;
    }
    
    .sidebar-header h3 {
        font-size: 0.8rem;
    }
    
    .category-item {
        padding: 10px 5px;
    }
    
    .category-icon {
        font-size: 1.5rem;
    }
    
    .category-name {
        font-size: 0.6rem;
    }
    
    .content-layout {
        flex-direction: column;
    }
}

/* ==================== Payment Method Modal Styles ==================== */
.payment-modal .modal-body {
    padding: 30px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.payment-method-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.payment-method-btn:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.payment-method-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.payment-method-btn.disabled .payment-icon svg {
    color: var(--text-secondary);
}

.payment-method-btn.disabled:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
}

.payment-icon {
    font-size: 2rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.payment-method-btn > div:last-child {
    flex: 1;
    text-align: right;
}

.payment-method-btn h3 {
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.payment-method-btn p {
    font-size: 0.8rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-secondary);
    margin: 0;
}

/* استایل خاص برای دکمه‌های نوع سفارش - حالت عمودی */
.payment-method-btn.order-type-btn {
    flex-direction: column;
    padding: 30px 20px;
    text-align: center;
}

.payment-method-btn.order-type-btn .payment-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.payment-method-btn.order-type-btn .payment-icon svg {
    width: 48px;
    height: 48px;
}

.payment-method-btn.order-type-btn h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.payment-method-btn.order-type-btn p {
    font-size: 0.9rem;
}

.payment-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.payment-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-summary .summary-row strong {
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    .payment-method-btn {
        flex-direction: row;
        text-align: right;
    }
    
    .payment-method-btn > div:last-child {
        text-align: right;
    }
    
    /* دکمه‌های نوع سفارش در موبایل هم عمودی بمانند */
    .payment-method-btn.order-type-btn {
        flex-direction: column;
        text-align: center;
    }
    
    .payment-method-btn.order-type-btn > div:last-child {
        text-align: center;
    }
}

/* ==================== Invoice Modal Styles ==================== */
.invoice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease-out;
    padding: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.invoice {
    background: var(--bg-secondary);
    border-radius: 25px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.invoice-header {
    padding: 30px;
    text-align: center;
    color: white;
    border-radius: 20px 20px 0 0;
}

.invoice-icon {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 35px;
}

.invoice-overlay.success .invoice-icon {
    color: #10b981;
    animation: checkmark 0.5s ease-out 0.2s both;
}

.invoice-overlay.error .invoice-icon {
    color: #ef4444;
    animation: shake 0.5s ease-out;
}

.invoice-overlay.warning .invoice-icon {
    color: #f59e0b;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.invoice-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.invoice-header p {
    margin: 10px 0 0 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.invoice-body {
    padding: 25px;
}

.error-message,
.warning-message {
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
}

.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.warning-message {
    background: #fffbeb;
    border: 2px solid #fde68a;
    color: #92400e;
}

.invoice-section {
    margin-bottom: 20px;
}

.invoice-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--glass-border);
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--glass-border);
    font-size: 0.9rem;
}

.invoice-row:last-child {
    border-bottom: none;
}

.invoice-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.invoice-value {
    color: var(--text-primary);
    font-weight: 600;
}

.invoice-items {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.invoice-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.item-qty {
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.item-price {
    font-weight: 600;
}

.invoice-overlay.success .item-price {
    color: #10b981;
}

.invoice-overlay.error .item-price {
    color: #ef4444;
}

.invoice-overlay.warning .item-price {
    color: #f59e0b;
}

.invoice-total {
    padding: 18px;
    border-radius: 12px;
    margin-top: 15px;
}

.invoice-total-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.invoice-total-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.invoice-total-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 700;
}

.invoice-total-success .invoice-total-row {
    color: #059669;
}

.invoice-total-error .invoice-total-row {
    color: #dc2626;
}

.invoice-total-warning .invoice-total-row {
    color: #d97706;
}

.ref-code {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    display: inline-block;
    letter-spacing: 1px;
}

.invoice-footer {
    padding: 0 25px 25px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.invoice-footer .btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    flex: 0 1 auto;
}

.btn-retry {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-track {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-track:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-home {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .invoice {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 15px;
        margin: 10px;
    }
    
    .invoice-header {
        padding: 20px;
    }
    
    .invoice-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin-bottom: 15px;
    }
    
    .invoice-header h1 {
        font-size: 1.3rem;
    }
    
    .invoice-header p {
        font-size: 0.85rem;
    }
    
    .invoice-body {
        padding: 15px;
    }
    
    .invoice-section-title {
        font-size: 0.95rem;
    }
    
    .invoice-row,
    .invoice-item {
        font-size: 0.85rem;
        padding: 8px 0;
    }
    
    .invoice-total {
        padding: 15px;
    }
    
    .invoice-total-row {
        font-size: 1rem;
    }
    
    .invoice-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .invoice-footer .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .ref-code {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
}
