/* ==========================================================================
   1. CSS VARIABLES & BASE RESET
   ========================================================================== */
:root {
    --primary-color: #d32f2f;      /* FrozoFun Red */
    --primary-dark: #b71c1c;
    --secondary-color: #ffc107;    /* Accent Yellow */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --bg-color: #f4f7f6;           /* Light grey app background */
    --surface-color: #ffffff;      /* Card backgrounds */
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --border-color: #e2e8f0;
    
    --header-height: 60px;
    --bottom-nav-height: 65px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Removes blue tap highlight on mobile */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { outline: none; font-family: inherit; }

/* ==========================================================================
   2. PWA CORE LAYOUT (Header, Footer, Main Content)
   ========================================================================== */
.top-app-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-app-bar .logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background-color: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 25%;
    height: 100%;
    transition: color 0.2s;
}

.nav-item i { font-size: 1.25rem; margin-bottom: 4px; }
.nav-item.active { color: var(--primary-color); font-weight: 600; }

.nav-icon-wrapper { position: relative; }
.cart-badge {
    position: absolute;
    top: -5px; right: -10px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.app-content {
    /* Prevents content from hiding behind fixed header and footer */
    padding-top: calc(var(--header-height) + 15px);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

/* ==========================================================================
   3. GLOBAL COMPONENTS (Buttons, Forms, Badges)
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:active { background-color: var(--primary-dark); }
.btn-primary.btn-large { padding: 14px 20px; font-size: 1.05rem; }
.w-100 { width: 100%; }

.btn-secondary {
    background-color: var(--text-dark);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-text-primary { background: none; border: none; color: var(--primary-color); font-weight: 600; cursor: pointer;}
.btn-text-danger { background: none; border: none; color: var(--danger-color); font-weight: 600; cursor: pointer;}

.shadow { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Forms */
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 5px; }
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface-color);
}
.form-row { display: flex; gap: 10px; }
.form-row .half { width: 50%; }
.checkbox-group { display: flex; align-items: center; gap: 8px; }
.checkbox-group input { width: auto; transform: scale(1.2); }

/* Badges */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.badge-processing { background-color: #e3f2fd; color: #1976d2; }
.badge-partial { background-color: #fff3cd; color: #856404; }
.badge-success { background-color: #d4edda; color: #155724; }
.badge-danger { background-color: #f8d7da; color: #721c24; }

/* State Helpers */
.loading-state, .empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.loading-state i { margin-bottom: 10px; color: var(--primary-color); }

/* ==========================================================================
   4. INDEX PAGE SPECIFICS
   ========================================================================== */
.promo-banner-container {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    padding: 30px 20px;
    margin: 0 15px 15px 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

.quick-nav-section { display: flex; gap: 10px; padding: 0 15px 20px 15px; }
.btn-quick-nav {
    flex: 1;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 10px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-quick-nav i { font-size: 1.5rem; color: var(--primary-color); }

.section-header { padding: 0 15px 10px 15px; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.section-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ==========================================================================
   5. MENU PAGE SPECIFICS
   ========================================================================== */
.category-nav-wrapper {
    position: sticky;
    top: var(--header-height);
    background: var(--bg-color);
    padding: 10px 15px;
    z-index: 999;
    border-bottom: 1px solid var(--border-color);
}
.category-pills {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px; /* for scrollbar */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.category-pills::-webkit-scrollbar { display: none; /* Hide scrollbar Chrome */ }
.cat-pill {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.cat-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 0 15px;
}
.menu-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.menu-card-img img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.menu-card-details { padding: 10px; display: flex; flex-direction: column; flex-grow: 1; }
.menu-card-details h4 { font-size: 0.9rem; margin: 0 0 4px 0; font-weight: 600; }
.menu-card-details .price { font-weight: 700; color: var(--secondary-color); font-size: 1rem; margin-bottom: 10px; }
.btn-add-cart {
    margin-top: auto;
    background: #fdf2f2;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 6px;
    font-weight: 600;
    width: 100%;
}
.btn-add-cart:active { background: var(--primary-color); color: white; }

/* ==========================================================================
   6. CART PAGE SPECIFICS
   ========================================================================== */
.cart-items-section { padding: 0 15px; }
.cart-item {
    display: flex;
    background: var(--surface-color);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    align-items: flex-start;
}
.cart-item-img {
    flex: 0 0 70px;
}
.cart-item-img img { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; display: block; }
.cart-item-details { flex-grow: 1; min-width: 0; padding: 0 12px; }
.cart-item-details h4 { font-size: 0.95rem; margin: 0; }
.cart-item-details .item-price { font-weight: 600; color: var(--primary-color); margin: 4px 0; font-size: 0.9rem; }

.quantity-toggle { display: flex; align-items: center; gap: 10px; background: var(--bg-color); border-radius: 6px; padding: 4px; width: fit-content; }
.btn-qty { background: white; border: 1px solid var(--border-color); border-radius: 4px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-dark); cursor: pointer; }
.qty-value { font-weight: 600; font-size: 0.9rem; min-width: 16px; text-align: center; }

.btn-remove-item { background: transparent; border: none; color: var(--danger-color); padding: 10px; cursor: pointer; flex: 0 0 auto; }

.cart-summary-section {
    position: sticky;
    bottom: calc(var(--bottom-nav-height) + 10px);
    padding: 0 15px;
    z-index: 998;
}
.summary-card { background: var(--surface-color); padding: 15px; border-radius: 12px; box-shadow: 0 -4px 15px rgba(0,0,0,0.1); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95rem; }
.summary-row.total-row { font-weight: 700; font-size: 1.15rem; margin-top: 10px; }

/* ==========================================================================
   7. CHECKOUT PAGE SPECIFICS
   ========================================================================== */
.page-header { display: flex; align-items: center; padding: 10px 15px; gap: 15px; }
.btn-back { background: transparent; border: none; font-size: 1.25rem; color: var(--text-dark); cursor: pointer; }

.checkout-section { background: var(--surface-color); padding: 15px; margin-bottom: 15px; }
.address-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}
.address-card input[type="radio"] { margin-top: 4px; transform: scale(1.2); accent-color: var(--primary-color); }
.address-details p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.address-badge { display: inline-block; background: #e2e8f0; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; margin-bottom: 4px; color: var(--text-dark); }
.map-link { font-size: 0.8rem; color: #1976d2; font-weight: 600; display: inline-block; margin-top: 4px; }

.fixed-bottom-action {
    position: fixed;
    bottom: var(--bottom-nav-height); left: 0; right: 0;
    padding: 10px 15px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    z-index: 999;
}

/* ==========================================================================
   8. PROFILE & MODALS (Bottom Sheets)
   ========================================================================== */
.profile-header { background: var(--surface-color); padding: 20px 15px; margin-bottom: 0; }
.profile-tabs { display: flex; background: var(--surface-color); border-bottom: 1px solid var(--border-color); }
.tab-btn { flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; padding: 12px 0; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.order-card { background: var(--surface-color); border-radius: 8px; margin: 15px; padding: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.order-card-header { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 10px; font-weight: 600; }
.status-row { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 6px; }
.status-row.total { font-weight: bold; font-size: 1rem; margin-top: 10px; }

/* Slide-up Bottom Sheet Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex; align-items: flex-end;
}
.bottom-sheet {
    background: var(--surface-color);
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 15px;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out forwards;
}
.sheet-header { border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; }
.btn-close { background: transparent; border: none; font-size: 1.25rem; color: var(--text-muted); cursor: pointer; }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   9. AUTHENTICATION (Login / Register)
   ========================================================================== */
.auth-section { padding: 0 20px; }
.auth-toggle { display: flex; background: #e2e8f0; border-radius: 8px; padding: 4px; margin-bottom: 20px; }
.toggle-btn { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 6px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.toggle-btn.active { background: var(--surface-color); color: var(--text-dark); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.alert { padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Shared Google authentication option */
.google-auth-option {
    width: 100%;
}

.google-auth-form {
    width: 100%;
    margin: 0;
}

.google-auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    background: var(--surface-color);
    border-color: #cbd5e1;
    color: var(--text-dark);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.google-auth-button i {
    color: #4285f4;
    font-size: 1.05rem;
}

.google-auth-button:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.08);
}

.google-auth-button:active {
    transform: translateY(1px);
}

.google-auth-button:focus-visible {
    outline: 3px solid rgba(66, 133, 244, 0.22);
    outline-offset: 2px;
}

.google-auth-button[aria-busy="true"] {
    cursor: wait;
}

.google-auth-helper {
    margin: 8px 0 0;
    font-size: 0.84rem;
    line-height: 1.4;
}

.google-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 17px 0;
}

.google-auth-divider hr {
    flex: 1;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.google-auth-divider span {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1;
}

.guest-checkout-step .google-auth-option {
    margin-top: 16px;
}

.guest-account-box .google-auth-divider {
    margin: 14px 0;
}

.guest-account-box .google-auth-button {
    background: #fff;
}


/* ==========================================================================
   10. SERVICE SELECTION GATEWAY (PHASE 1)
   ========================================================================== */

.service-gateway-section {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.service-gateway-card {
    width: 100%;
    max-width: 700px;
}

.service-gateway-logo {
    text-align: center;
    margin-bottom: 25px;
}

.service-gateway-logo h2 {
    margin-bottom: 8px;
    font-size: 2rem;
    color: var(--primary-color);
}

.service-gateway-logo p {
    color: var(--text-muted);
}

.service-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.service-choice-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    text-align: left;
    cursor: pointer;
    transition: all .25s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-choice-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.service-choice-card strong {
    font-size: 1.2rem;
    color: var(--text-dark);
}

.service-choice-card small {
    color: var(--text-muted);
    line-height: 1.5;
}

.service-icon {
    font-size: 2.2rem;
}

.active-service-section {
    padding: 0 15px 15px;
}

.active-service-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,.05);
}

.active-service-card small {
    display: block;
    color: var(--text-muted);
    font-size: .75rem;
}

.active-service-card strong {
    color: var(--primary-color);
}

.btn-small {
    padding: 8px 12px;
    font-size: .85rem;
}

@media (min-width: 768px) {

    .service-choice-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-choice-card {
        min-height: 220px;
        justify-content: center;
    }
}
/* ==========================================================================
   11. CHECKOUT FORMS & UNIFIED GUEST CHECKOUT MODAL
   ========================================================================== */

.add-address-form-wrapper input,
.add-address-form-wrapper select,
.guest-checkout-sheet input,
.guest-checkout-sheet select,
.voucher-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface-color);
}

.add-address-form-wrapper input:focus,
.add-address-form-wrapper select:focus,
.guest-checkout-sheet input:focus,
.guest-checkout-sheet select:focus,
.voucher-box input:focus {
    border-color: var(--primary-color);
    outline: 3px solid rgba(197, 48, 48, 0.12);
    outline-offset: 1px;
}

#saved-address-section .section-header {
    padding: 0 0 10px 0;
}

.address-card:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: #fff7f7;
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.08);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.form-actions button {
    flex: 1;
}

.checkout-items-wrapper {
    padding: 15px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.voucher-box {
    display: flex;
    gap: 8px;
}

.voucher-box input {
    flex: 1;
}

.payment-method-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f1fff4;
    border: 1px solid #d6f5dc;
    color: var(--text-dark);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.checkout-item strong {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.92rem;
}

.guest-checkout-modal {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.guest-checkout-sheet {
    max-height: min(88vh, 760px);
    padding: 18px 15px calc(20px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}

.guest-checkout-sheet .sheet-header {
    position: sticky;
    top: -18px;
    z-index: 3;
    margin: -18px -15px 15px;
    padding: 18px 15px 12px;
    background: var(--surface-color);
}

.guest-checkout-sheet .sheet-header > div {
    min-width: 0;
    padding-right: 12px;
}

.guest-checkout-sheet .sheet-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.guest-checkout-sheet .sheet-header p {
    margin: 4px 0 0;
    font-size: 0.84rem;
    line-height: 1.4;
}

.guest-checkout-sheet .btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
}

.guest-checkout-sheet .btn-close:hover {
    background: var(--bg-color);
}

.guest-checkout-sheet .btn-close:focus-visible,
.guest-checkout-sheet button:focus-visible,
.guest-checkout-sheet a:focus-visible {
    outline: 3px solid rgba(197, 48, 48, 0.25);
    outline-offset: 2px;
}

#guest-checkout-message {
    margin-bottom: 14px;
}

.guest-checkout-step[hidden] {
    display: none !important;
}

.guest-checkout-step {
    min-height: 130px;
}

.guest-step-intro {
    margin: 0 0 14px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.guest-address-list {
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
}

.guest-address-list .address-card {
    background: var(--surface-color);
}

.guest-address-list .address-card:last-child {
    margin-bottom: 0;
}

.guest-modal-actions {
    position: sticky;
    bottom: calc(-20px - env(safe-area-inset-bottom));
    z-index: 2;
    margin: 16px -15px calc(-20px - env(safe-area-inset-bottom));
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -5px 16px rgba(15, 23, 42, 0.06);
}

.guest-checkout-sheet input[readonly] {
    background: #f4f5f7;
    color: var(--text-muted);
    cursor: default;
}

.guest-checkout-sheet .loading-state {
    padding: 18px 0;
}

.guest-checkout-sheet button[disabled] {
    pointer-events: none;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-outline:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 420px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .half {
        width: 100%;
    }

    .voucher-box {
        flex-direction: column;
    }

    .guest-checkout-sheet {
        max-height: 92vh;
    }

    .guest-modal-actions {
        flex-direction: column-reverse;
    }

    .guest-modal-actions button {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .guest-checkout-modal {
        align-items: center;
        padding: 24px;
    }

    .guest-checkout-sheet {
        width: min(620px, 100%);
        border-radius: 20px;
        animation: guestModalIn 0.22s ease-out forwards;
    }

    .guest-checkout-sheet .sheet-header {
        top: -18px;
        border-radius: 20px 20px 0 0;
    }
}

@keyframes guestModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* ==========================================================================
   12. CART & CHECKOUT EXPANDABLE PRODUCT DETAILS
   ========================================================================== */

.btn-toggle-cart-details,
.btn-toggle-checkout-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 7px;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.btn-toggle-cart-details:hover,
.btn-toggle-checkout-details:hover {
    text-decoration: underline;
}

.btn-toggle-cart-details:focus-visible,
.btn-toggle-checkout-details:focus-visible,
.btn-retry-cart-details:focus-visible,
.btn-retry-checkout-details:focus-visible {
    outline: 3px solid rgba(197, 48, 48, 0.25);
    outline-offset: 3px;
    border-radius: 4px;
}

.btn-toggle-cart-details i,
.btn-toggle-checkout-details i {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.cart-product-details-panel {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    background: #fff9f6;
    border: 1px solid #f1ddd4;
    border-radius: 10px;
    color: var(--text-dark);
}

.cart-product-details-panel[hidden] {
    display: none !important;
}

.cart-product-details-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cart-product-details-image {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-color);
}

.cart-product-details-copy {
    flex: 1;
    min-width: 0;
}

.cart-product-description {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.cart-product-description:last-child {
    margin-bottom: 0;
}

.cart-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cart-product-meta span {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ecd8cf;
    color: #6d4b3d;
    font-size: 0.74rem;
    line-height: 1.25;
}

.cart-meal-components {
    margin-top: 11px;
}

.cart-meal-components h5 {
    margin: 0 0 6px;
    color: #8a5a44;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cart-meal-components-list {
    overflow: hidden;
    border: 1px solid #ead8ce;
    border-radius: 8px;
    background: #fff;
}

.cart-meal-component {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    border-bottom: 1px dashed #ead8ce;
    font-size: 0.8rem;
    line-height: 1.35;
}

.cart-meal-component:last-child {
    border-bottom: 0;
}

.cart-meal-component span:first-child {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.cart-meal-component span:last-child {
    flex: 0 0 auto;
    color: #6d4b3d;
    font-weight: 700;
    white-space: nowrap;
}

.cart-product-details-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.cart-product-details-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--danger-color);
    font-size: 0.82rem;
}

.btn-retry-cart-details,
.btn-retry-checkout-details {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background: #fff;
    color: var(--primary-color);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.checkout-item {
    position: relative;
    padding: 0 0 11px;
    margin-bottom: 11px;
    border-bottom: 1px solid #f0f0f0;
}

.checkout-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.checkout-item-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.checkout-item-copy {
    flex: 1;
    min-width: 0;
}

.checkout-item-copy strong {
    overflow-wrap: anywhere;
}

.checkout-item-total {
    flex: 0 0 auto;
    font-weight: 700;
    white-space: nowrap;
}

.checkout-product-details-panel {
    margin-top: 7px;
}

@media (max-width: 480px) {
    .cart-item {
        padding: 9px;
    }

    .cart-item-img {
        flex-basis: 60px;
    }

    .cart-item-img img {
        width: 60px;
        height: 60px;
    }

    .cart-item-details {
        padding: 0 8px;
    }

    .btn-remove-item {
        padding: 7px 5px;
    }

    .cart-product-details-content {
        display: block;
    }

    .cart-product-details-image {
        width: 100%;
        height: 150px;
        margin-bottom: 10px;
    }

    .cart-meal-component {
        gap: 8px;
        font-size: 0.76rem;
    }

    .cart-product-details-error {
        align-items: flex-start;
        flex-direction: column;
    }

    .checkout-item-summary {
        gap: 8px;
    }
}
/* ==========================================================================
   PRODUCT DETAILS MODAL
   ========================================================================== */

.product-details-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.frozo-product-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-details-modal.show {
    display: flex;
}

.product-details-backdrop,
.frozo-product-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
}

.product-details-dialog,
.frozo-product-modal-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 80px rgba(0,0,0,.25);
    z-index: 2;
}

.product-details-close,
.frozo-product-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    cursor: pointer;
    z-index: 10;
}

.product-modal-hero img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.product-modal-body {
    padding: 20px;
}

.product-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-modal-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-modal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.product-modal-chip {
    background: #fff3f3;
    color: var(--primary-color);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .8rem;
    font-weight: 600;
}

.product-modal-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.product-modal-section h5 {
    margin-bottom: 10px;
}

.product-seo-box {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.product-seo-label {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.product-seo-value {
    font-size: .9rem;
    color: var(--text-dark);
    white-space: pre-wrap;
}

.meal-components-table {
    width: 100%;
    border-collapse: collapse;
}

.meal-components-table th,
.meal-components-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.meal-components-table th {
    background: #fafafa;
}

.menu-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.menu-card-actions .btn-view-product {
    flex: 0 0 auto;
}

.menu-card-actions .btn-add-cart {
    flex: 1;
}

.btn-view-product {
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {

    .product-details-modal,
    .frozo-product-modal {
        padding: 0;
        align-items: flex-end;
    }

    .product-details-dialog,
    .frozo-product-modal-dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
    }

    .product-modal-hero img {
        height: 220px;
    }
}
