:root {
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    --secondary-color: #1E293B;
    --background-color: #F8FAFC;
    --card-background: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.menu-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--background-color);
    min-height: 100vh;
    position: relative;
    padding-bottom: 100px;
}

/* Header Styles */
.menu-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-md);
}

.menu-header-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.menu-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.6));
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.restaurant-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.restaurant-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-logo.placeholder {
    background: rgba(255, 255, 255, 0.2);
}

.restaurant-logo.placeholder i {
    font-size: 28px;
    color: white;
}

.restaurant-info {
    flex: 1;
    min-width: 0;
}

.restaurant-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--border-radius-xl);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.action-btn:hover, .action-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.action-btn i {
    font-size: 12px;
}

.search-btn {
    padding: 8px 10px;
}

/* Schedule Dropdown */
.schedule-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    padding: 20px;
    display: none;
    animation: slideDown var(--transition-normal);
    z-index: 99;
}

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

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

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.schedule-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-header h3 i {
    color: var(--primary-color);
}

.close-dropdown {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.schedule-item .day-name {
    font-weight: 500;
    color: var(--text-primary);
}

.schedule-item .day-hours {
    color: var(--success-color);
    font-weight: 500;
}

.schedule-item.closed .day-hours {
    color: var(--danger-color);
}

/* Search Bar */
.search-bar {
    margin-top: 15px;
    display: none;
    animation: slideDown var(--transition-normal);
}

.search-bar.active {
    display: block;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 10px 15px;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper i {
    color: var(--text-secondary);
    font-size: 16px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: var(--text-primary);
}

.search-input-wrapper input::placeholder {
    color: var(--text-light);
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.clear-search.visible {
    display: block;
}

/* Categories Navigation */
.categories-nav {
    background: white;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.categories-scroll {
    display: flex;
    gap: 8px;
    padding: 0 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--background-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius-xl);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-color);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-btn i {
    font-size: 14px;
}

/* Menu Content */
.menu-content {
    padding: 15px;
}

.category-section {
    margin-bottom: 25px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-left: 5px;
    position: relative;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
    margin-left: -10px;
}

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

/* Dish Card */
.dish-card {
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.dish-card:active {
    transform: scale(0.98);
}

.dish-card.in-cart {
    box-shadow: 0 0 0 2px var(--primary-color), var(--shadow-md);
}

.dish-image {
    position: relative;
    height: 120px;
    background: var(--background-color);
    overflow: hidden;
}

.dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.no-image i {
    font-size: 32px;
    color: var(--text-light);
}

.dish-tags {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dish-tag {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--border-radius-xl);
    font-weight: 500;
}

.dish-details {
    padding: 12px;
}

.dish-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-description {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dish-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Promotional Dish Styles */
.promo-category-title {
    color: #E53E3E;
}

.promo-category-title::before {
    background: #E53E3E;
}

.dish-card.promo-card {
    border: 2px solid #FC8181;
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.18);
}

.dish-card.promo-card:active {
    transform: scale(0.98);
}

.promo-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #E53E3E 0%, #FC8181 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--border-radius-xl);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.4);
    z-index: 2;
}

.promo-price-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

.dish-price-original {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: line-through;
}

.dish-price-promo {
    font-size: 18px;
    font-weight: 800;
    color: #E53E3E;
    letter-spacing: -0.3px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--background-color);
    border-radius: var(--border-radius-xl);
    padding: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.qty-btn.minus {
    background: white;
    color: var(--text-secondary);
}

.qty-btn.plus {
    background: var(--primary-color);
    color: white;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-btn.minus:hover {
    background: var(--border-color);
}

.qty-btn.plus:hover {
    background: var(--primary-dark);
}

.quantity {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Search Results */
.search-results-container {
    margin-bottom: 20px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-results-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-results-header h2 i {
    color: var(--primary-color);
}

.clear-results {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* Cart Button */
.cart-button-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 15px;
    background: linear-gradient(to top, white 70%, transparent);
    z-index: 100;
}

.cart-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-lg);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.cart-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.cart-button:active {
    transform: translateY(0);
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-count {
    background: white;
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.cart-total {
    font-size: 16px;
    font-weight: 700;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn var(--transition-normal);
}

.cart-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cart-modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-normal);
}

/* Single scrollable area — header stays fixed, body scrolls as one unit */
.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

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

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cart-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-modal-header h2 i {
    color: var(--primary-color);
}

.close-cart {
    background: var(--background-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: var(--transition-fast);
}

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

.cart-items {
    padding: 15px 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 13px;
    color: var(--text-secondary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 70px;
    text-align: right;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-cart i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.empty-cart p {
    font-size: 14px;
}

/* Cart Summary */
.cart-summary {
    padding: 15px 20px;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

/* Customer Form */
.customer-form {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.customer-form h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: none;
    min-height: 80px;
}

/* Submit Button */
.submit-order-btn {
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 16px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-order-btn:hover {
    background: var(--primary-dark);
}

.submit-order-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.success-modal.active {
    display: flex;
}

.success-content {
    background: white;
    padding: 40px 30px;
    border-radius: var(--border-radius-xl);
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: scaleIn var(--transition-normal);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color) 0%, #00D9A5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon i {
    font-size: 40px;
    color: white;
}

.success-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.success-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.order-number {
    font-weight: 600;
    color: var(--primary-color);
}

.success-btn {
    margin-top: 20px;
    padding: 14px 30px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.success-btn:hover {
    background: var(--primary-dark);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading-spinner p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .dishes-grid {
        grid-template-columns: 1fr;
    }
    
    .dish-card {
        display: flex;
        flex-direction: row;
    }
    
    .dish-image {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    
    .dish-details {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .dish-footer {
        margin-top: auto;
    }
    
    .restaurant-name {
        font-size: 16px;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 8px 10px;
    }
}

@media (min-width: 481px) {
    .menu-container {
        box-shadow: var(--shadow-lg);
    }
}

/* Hide elements when category is filtered */
.category-section.hidden {
    display: none;
}

/* Dish Preview Button */
.dish-preview-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    z-index: 5;
}

.dish-preview-btn i {
    font-size: 14px;
    color: var(--primary-color);
}

.dish-preview-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.dish-preview-btn:hover i {
    color: white;
}

/* Dish Preview Modal */
.dish-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.dish-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.dish-preview-content {
    background: var(--card-background);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dish-preview-modal.active .dish-preview-content {
    transform: translateY(0);
}

.close-preview {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
}

.close-preview i {
    font-size: 16px;
    color: white;
}

.close-preview:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.preview-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    background: var(--background-color);
    flex-shrink: 0;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--background-color) 0%, #E2E8F0 100%);
}

.preview-no-image i {
    font-size: 64px;
    color: var(--text-light);
}

.preview-details {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.preview-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.preview-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.preview-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.preview-notes-group {
    margin-bottom: 20px;
}

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

.preview-notes-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.preview-notes-group textarea {
    width: 100%;
    min-height: 70px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition-fast);
}

.preview-notes-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.preview-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-lg);
}

.preview-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.preview-qty-btn i {
    font-size: 14px;
    color: var(--primary-color);
}

.preview-qty-btn:hover {
    background: var(--primary-color);
}

.preview-qty-btn:hover i {
    color: white;
}

.preview-quantity {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.preview-confirm-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.preview-confirm-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.preview-confirm-btn i {
    font-size: 16px;
}

/* Share Button */
.share-btn {
    background: rgba(255, 255, 255, 0.25);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Config Groups Styles */
.preview-config-groups {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.config-group {
    background: var(--background-color);
    border-radius: var(--border-radius-md);
    padding: 15px;
    margin-bottom: 15px;
}

.config-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.config-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
}

.config-required-badge {
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.config-group-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.config-option {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex: 0 0 auto;
}

.config-option:hover {
    border-color: var(--primary-light);
}

.config-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.config-option input[type="checkbox"] {
    display: none;
}

.config-option-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.config-option-checkbox::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: var(--transition-fast);
}

.config-option input[type="checkbox"]:checked + .config-option-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.config-option input[type="checkbox"]:checked + .config-option-checkbox::before {
    opacity: 1;
}

.config-option input[type="checkbox"]:checked ~ .config-option-name {
    color: var(--primary-color);
    font-weight: 500;
}

.config-option-name {
    font-size: 14px;
    color: var(--text-primary);
}

.config-option-extra-price {
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
    margin-left: 6px;
}

/* Cart item config and notes */
.cart-item-config,
.cart-item-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cart-item-config i,
.cart-item-note i {
    color: var(--primary-color);
    font-size: 11px;
    margin-top: 2px;
}

.cart-item-config {
    color: var(--primary-color);
    font-weight: 500;
}

.cart-item-note {
    font-style: italic;
}

/* =============================================
   PAGE PRELOADER
   ============================================= */
#page-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: preloader-pop-in 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.preloader-logo-wrap img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    animation: preloader-float 2.4s ease-in-out 0.65s infinite;
    filter: drop-shadow(0 8px 18px rgba(37, 99, 235, 0.25));
}

.preloader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-light);
    animation: preloader-spin 1.2s linear infinite;
}

.preloader-brand {
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--primary-dark);
    text-transform: uppercase;
    animation: preloader-brand-in 0.5s ease 0.8s both;
}

.preloader-dots {
    margin-top: 22px;
    display: flex;
    gap: 7px;
}

.preloader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: preloader-dot-bounce 1.1s ease-in-out infinite;
}

.preloader-dots span:nth-child(2) { animation-delay: 0.18s; background: var(--primary-light); }
.preloader-dots span:nth-child(3) { animation-delay: 0.36s; background: #93C5FD; }

@keyframes preloader-pop-in {
    0%   { opacity: 0; transform: scale(0.3) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes preloader-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%       { transform: translateY(-10px) rotate(2deg); }
}

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

@keyframes preloader-brand-in {
    0%   { opacity: 0; letter-spacing: 14px; }
    100% { opacity: 1; letter-spacing: 6px; }
}

@keyframes preloader-dot-bounce {
    0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
    40%            { transform: translateY(-9px); opacity: 1; }
}

/* ── Cross-sell carousel ─────────────────────────────────────────────── */
.cs-section {
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-color);
}

.cs-title {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 16px 8px;
}

.cs-title i {
    color: var(--warning-color);
    margin-right: 4px;
}

.cs-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cs-track::-webkit-scrollbar {
    display: none;
}

.cs-card {
    flex: 0 0 130px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.cs-card:hover {
    box-shadow: var(--shadow-md);
}

.cs-card-image {
    height: 80px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.4em;
}

.cs-card-body {
    padding: 8px 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-card-name {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cs-card-price {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--primary-color);
}

.cs-add-btn {
    width: 100%;
    padding: 5px 4px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.74em;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-top: 2px;
}

.cs-add-btn:hover {
    background: var(--primary-dark);
}

.cs-add-btn:active {
    transform: scale(0.97);
}
/* ── End Cross-sell carousel ─────────────────────────────────────────── */
