/* --- COLUMNA DE CARRITO / RESUMEN DESKTOP --- */
.menu-cart-column {
    position: sticky;
    top: 1.5rem;
}

.desktop-cart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
    position: relative;
}

.desktop-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.1rem;
}

.cart-badge-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.desktop-cart-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 2px;
}

.cart-header-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    font-size: 1.1rem;
}

/* Estado Vacío */
.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-cart-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--bg-surface-subtle);
    border: 1px dashed var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.6rem;
    margin-bottom: 0.85rem;
}

.empty-cart-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.empty-cart-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 220px;
    line-height: 1.4;
}

/* Ítems del Carrito */
.cart-items-wrapper {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 4px;
    scrollbar-width: thin;
}

.cart-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-modifiers {
    font-size: 0.74rem;
    color: var(--brand-accent);
    line-height: 1.3;
    margin-top: 1px;
}

.cart-item-price {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--price-color);
    margin-top: 2px;
}

/* Selectores de Cantidad */
.qty-selector {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 3px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--color-card);
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--color-dark) 6%, transparent);
}

.qty-btn:hover {
    background: var(--brand-dark);
    color: var(--color-card);
}

.qty-value {
    width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-heading);
}

/* Campos de Checkout */
.checkout-fields-container {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-heading);
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--brand-dark);
    background: var(--color-card);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-dark) 8%, transparent);
}

.payment-method-group { margin-top: 1rem; }
.payment-method-title { display: block; margin-bottom: .55rem; color: var(--text-heading); font-size: .8rem; font-weight: 700; }
.payment-method-options { display: grid; gap: .55rem; }
.form-group .payment-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 58px;
    padding: .7rem .85rem;
    margin: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-card);
    cursor: pointer;
}
.form-group .payment-option:has(input:checked) { border-color: var(--brand-dark); background: var(--color-bg); }
.form-group .payment-option input[type="radio"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--brand-dark);
    box-shadow: none;
}
.payment-option-copy { display: grid; gap: .2rem; min-width: 0; }
.payment-option-copy strong { color: var(--text-heading); font-size: .84rem; line-height: 1.25; }
.payment-option-copy small { color: var(--text-muted); font-size: .72rem; font-weight: 400; line-height: 1.35; }

.conditional-field {
    display: none;
}

.conditional-field.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Resumen de Totales */
.cart-summary {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    margin-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.summary-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0;
}

.summary-row.total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0;
}

.summary-total-val {
    color: var(--brand-dark);
    font-size: 1.15rem;
}

/* Botón Principal */
.sheet-action-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: var(--brand-dark);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--color-card);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-dark) 15%, transparent);
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.sheet-action-btn:hover {
    background: var(--color-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--color-dark) 22%, transparent);
}

.sheet-action-btn:active {
    transform: translateY(1px);
}

.sheet-action-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* --- FOOTER --- */
.menu-footer {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    background: var(--color-card);
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.footer-brand span {
    color: var(--color-dark);
}

.footer-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* --- MOBILE STICKY CART BAR --- */
.cart-bar {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: var(--brand-dark);
    border-radius: var(--radius-xl);
    padding: 0.85rem 1.25rem;
    color: var(--color-card);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
    box-shadow: var(--shadow-floating);
    transform: translateY(150%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-bar.active {
    transform: translateY(0);
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-count-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-dark);
    color: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}

.cart-total-info {
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-action-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--color-accent);
}

/* --- BOTTOM SHEETS & MODALS --- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--color-dark) 50%, transparent);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 580px;
    margin: 0 auto;
    background: var(--bg-surface);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
    z-index: 101;
    transform: translateY(105%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sheet);
    max-height: 88vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    margin: -0.5rem auto 1rem auto;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
}

.sheet-description {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sheet-close-btn {
    border: none;
    background: var(--bg-surface-subtle);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.sheet-close-btn:hover {
    background: var(--border-subtle);
    color: var(--text-heading);
}

/* Modificadores y Opciones del Producto */
.modifier-section {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.modifier-group-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.modifier-group-required {
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--color-closed-bg);
    color: var(--color-closed);
    border: 1px solid var(--color-line);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.modifier-option-input {
    display: none;
}

.modifier-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.modifier-option-label:hover {
    background: color-mix(in srgb, var(--color-dark) 4%, transparent);
}

.modifier-option-name-col {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-heading);
}

.modifier-option-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.indicator-radio {
    border-radius: 50%;
}

.indicator-checkbox {
    border-radius: 4px;
}

.modifier-option-input:checked + .modifier-option-label .modifier-option-indicator {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
}

.modifier-option-input:checked + .modifier-option-label .indicator-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-card);
}

.modifier-option-input:checked + .modifier-option-label .indicator-checkbox::after {
    content: '✓';
    color: var(--color-card);
    font-size: 11px;
    font-weight: 700;
}

.modifier-modifier-price {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--price-color);
}

.sheet-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Pantalla de Éxito */
.success-screen {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.success-action-row { display: flex; gap: 0.6rem; margin-top: 0.75rem; }
.order-tracking { width:100%; margin:1rem 0; padding:1rem; border:1px solid var(--color-line); border-radius:16px; background:var(--color-bg); text-align:left; }
.track-current-order { position:fixed; left:1rem; bottom:1rem; z-index:90; padding:.7rem 1rem; border:0; border-radius:100px; background:var(--color-ok); color:var(--color-card); font-weight:700; box-shadow:none; cursor:pointer; }
.order-tracking-heading { display:flex; justify-content:space-between; gap:1rem; align-items:center; font-size:.9rem; }
.order-tracking-heading strong { color:var(--color-ok); }
.order-tracking-detail { color:var(--color-text-muted); font-size:.78rem; margin:.5rem 0 0; }
.order-chat { margin-top:1rem; padding-top:.8rem; border-top:1px solid var(--color-line); font-size:.84rem; }
.order-chat-messages { max-height:210px; min-height:36px; overflow-y:auto; display:flex; flex-direction:column; gap:.5rem; margin:.65rem 0; }
.order-chat-bubble { max-width:86%; padding:.55rem .75rem; border-radius:12px; background:var(--color-line); color:var(--color-dark); overflow-wrap:anywhere; }
.order-chat-bubble.mine { align-self:flex-end; background:var(--color-ok-bg); }
.order-chat-bubble small { display:block; opacity:.65; font-size:.65rem; margin-top:.2rem; }
.order-attachment { display:block; margin-top:.4rem; padding:.45rem .6rem; border:1px solid currentColor; border-radius:8px; background:transparent; color:inherit; font:inherit; font-size:.75rem; text-align:left; cursor:pointer; }
.order-receipt-label { display:inline-flex; align-items:center; gap:.35rem; margin-top:.65rem; padding:.55rem .7rem; border:1px solid var(--color-ok); border-radius:9px; color:var(--color-ok); font-weight:700; cursor:pointer; }
.order-receipt-label input { display:none; }
.order-receipt-hint { display:block; margin-top:.3rem; color:var(--color-text-muted); }
#orderChatForm { display:flex; gap:.4rem; }
#orderChatInput { flex:1; min-width:0; padding:.65rem; border:1px solid var(--color-line); border-radius:9px; }
#orderChatForm button { border:0; border-radius:9px; padding:0 .85rem; background:var(--color-ok); color:var(--color-card); }
.success-action-row .sheet-action-btn { flex: 1; min-width: 0; margin: 0; }
.success-action-row .secondary-action {
    background: var(--color-bg); color: var(--text-heading);
    border: 1px solid var(--border-subtle); box-shadow: none;
}
.success-action-row .cancel-action {
    background: var(--color-closed-bg); color: var(--color-closed);
    border: 1px solid var(--color-line); box-shadow: none;
}
@media (max-width: 480px) { .success-action-row { flex-direction: column; } }

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-bg);
    border: 2px solid var(--success);
    color: var(--success);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
}

.success-code {
    display: inline-block;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-medium);
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.15rem;
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-md);
    margin: 0.85rem 0;
    letter-spacing: 1px;
}

.wsp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: var(--color-ok);
    color: var(--color-card);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    margin-top: 1rem;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-ok) 25%, transparent);
    transition: transform 0.2s;
}

.wsp-btn:hover {
    transform: translateY(-1px);
    background: var(--color-ok);
}

/* Toast Notifications */
.toast-notify {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--color-dark);
    border: 1px solid var(--color-dark);
    color: var(--color-card);
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: var(--shadow-floating);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast-notify.active {
    opacity: 1;
    transform: translateY(0);
}

.toast-notify.error {
    border-color: var(--color-closed);
}

.toast-notify i {
    color: var(--color-accent);
    font-size: 1.1rem;
}

.toast-notify.error i {
    color: var(--color-closed);
}

/* --- MEDIA QUERIES RESPONSIVE --- */
@media (max-width: 1099px) {
    .menu-app-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .menu-cart-column {
        display: none;
    }

    .store-header-container {
        padding: 2.25rem 1rem 3.5rem 1rem;
    }

    .store-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .store-name {
        font-size: 1.65rem;
    }

    .delivery-status-card {
        padding: 0 1rem;
    }

    .delivery-toggle-option {
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }

}

@media (max-width: 576px) {
    .menu-app-wrapper {
        padding-inline: 1rem;
    }

    .category-section-container {
        padding: 1rem 0;
    }

    .category-section-header {
        margin-inline: 1rem;
    }

    .category-count-badge {
        display: none;
    }

    .category-swipe-hint {
        display: inline;
    }

    .category-grid {
        display: flex;
        gap: 0.75rem;
        padding: 0.15rem 1rem 0.75rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .category-tab {
        flex: 0 0 auto;
        width: auto;
        max-width: min(74vw, 240px);
        min-height: 48px;
        scroll-snap-align: start;
    }

    .delivery-details-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-indicator-group,
    .estimated-time-box {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .hours-text {
        overflow-wrap: anywhere;
    }

    .delivery-time-select {
        max-width: 100%;
    }

    .store-contacts {
        width: 100%;
    }

    .contact-item {
        flex: 1;
        justify-content: center;
    }

    .product-img-wrapper {
        width: 80px;
        height: 80px;
    }
}
.payment-qr-box { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin: 1rem auto; max-width: 300px; text-align: center; }
.payment-qr-box img { width: min(240px, 70vw); height: auto; aspect-ratio: 1; background: var(--color-card); padding: 10px; border: 1px solid var(--color-line); border-radius: 16px; }
.payment-qr-box p { margin: 0; color: var(--color-text-muted); font-size: .85rem; line-height: 1.45; }
.payment-qr-box a { text-decoration: none; text-align: center; width: 100%; }
.payment-qr-amount { display: block; margin: .8rem auto .2rem; font-size: 1.2rem; color: var(--color-dark); }
