/* ── MenuPlay — Menú del cliente (estilo MBC) ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Montserrat:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body.mp-body {
    background: #fff;
    color: #0b0b0b;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100dvh;
    overscroll-behavior: none;
}

body.mp-body { overflow-x: hidden; }

/* ── Splash ──────────────────────────────────────────────────────────────── */
#mp-splash {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 9999;
    transition: opacity .4s;
}
#mp-splash.hidden { opacity: 0; pointer-events: none; }
.mp-splash-logo { font-family: 'Bebas Neue', sans-serif; font-size: 52px; letter-spacing: 2px; color: #0b0b0b; }
.mp-splash-text  { color: #aaa; font-size: 13px; font-weight: 500; }

/* ── Header ──────────────────────────────────────────────────────────────── */
#mp-header {
    text-align: center;
    padding: calc(36px + var(--safe-top)) 5% 24px;
    border-bottom: 1px solid #f0f0f0;
}

.mp-header-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 58px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #0b0b0b;
    margin-bottom: 18px;
    line-height: 1;
}

.mp-logo-img {
    display: block;
    max-width: 100%;
    width: auto;
    margin: 0 auto 18px;
    object-fit: contain;
}

.mp-header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #0b0b0b;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s;
    white-space: nowrap;
}
.mp-action-btn:hover { opacity: .7; }

/* ── Category sections ───────────────────────────────────────────────────── */
#mp-menu-list { padding-bottom: calc(120px + var(--safe-bottom)); }

.mp-cat-section {
    padding: 56px 5% 0;
}

.mp-cat-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 46px;
    font-weight: 400;
    letter-spacing: 1.3px;
    color: #0b0b0b;
    margin-bottom: 28px;
}

.mp-section-grid {
    display: grid;
    grid-template-columns: 0.9fr 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Main media (left sticky) ────────────────────────────────────────────── */
.mp-main-media {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 12px;
    overflow: hidden;
    background: #e0e0e0;
    position: sticky;
    top: 20px;
}

.mp-main-media video,
.mp-main-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-no-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    background: #f5f5f5;
}

/* ── Item rows (right) ───────────────────────────────────────────────────── */
.mp-item-list { display: flex; flex-direction: column; }

.mp-item-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 18px;
    align-items: center;
    min-height: 85px;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: opacity .2s;
}
.mp-item-row:hover { opacity: .6; }
.mp-item-row:last-child { border-bottom: none; }
.mp-item-row.mp-sold-out { opacity: .35; cursor: default; pointer-events: none; }

.mp-item-row-name {
    font-size: 15px;
    font-weight: 700;
    color: #0b0b0b;
    margin-bottom: 5px;
    line-height: 1.25;
}
.mp-item-row-desc {
    font-size: 13px;
    color: #5f5f5f;
    line-height: 1.35;
}

.mp-mini-video {
    width: 110px;
    height: 78px;
    object-fit: cover;
    border-radius: 7px;
    background: #e0e0e0;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}
.mp-mini-video::-webkit-media-controls { display: none !important; }
.mp-mini-video::-webkit-media-controls-start-playback-button { display: none !important; }
.mp-mini-placeholder {
    width: 110px;
    height: 78px;
    border-radius: 7px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

/* ── Popup ───────────────────────────────────────────────────────────────── */
#mp-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.74);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
    font-family: 'Montserrat', sans-serif;
}
#mp-popup.active { display: flex; }

.mp-popup-card {
    width: min(640px, 92vw);
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    box-shadow: 0 28px 90px rgba(0,0,0,.42);
    animation: mpPopupIn .25s ease;
    max-height: 90vh;
}

@keyframes mpPopupIn {
    from { opacity: 0; transform: scale(.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.mp-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #000;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.mp-popup-media {
    width: 100%;
    height: 320px;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}
.mp-popup-media video,
.mp-popup-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}
#mp-popup-video::-webkit-media-controls { display: none !important; }
#mp-popup-video::-webkit-media-controls-panel { display: none !important; }
#mp-popup-video::-webkit-media-controls-play-button { display: none !important; }
#mp-popup-video::-webkit-media-controls-start-playback-button { display: none !important; }

.mp-popup-info {
    padding: 42px 8px 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}
.mp-popup-info h3 {
    font-size: 15px;
    font-weight: 800;
    color: #000;
    margin-bottom: 10px;
    line-height: 1.3;
}
.mp-popup-info p {
    font-size: 13px;
    color: #777;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 500;
}
.mp-popup-info strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #000;
    margin-bottom: 14px;
}

.mp-popup-qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.mp-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: border-color .2s;
}
.mp-qty-btn:hover { border-color: #000; }
.mp-qty-num {
    font-size: 18px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    color: #000;
}
.mp-popup-note-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    resize: none;
    margin-bottom: 10px;
    color: #333;
}
.mp-popup-note-input::placeholder { color: #bbb; }
.mp-popup-add-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: #0b0b0b;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
}
.mp-popup-add-btn:hover { opacity: .75; }
.mp-popup-add-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Order status ────────────────────────────────────────────────────────── */
#mp-order-status {
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    padding: 12px 5%;
    display: none;
}
#mp-order-status.visible { display: block; }
.mp-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0b0b0b;
}
.mp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0b0b0b;
    animation: mp-pulse 1.5s infinite;
    flex-shrink: 0;
}
@keyframes mp-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50% { opacity:.4; transform:scale(1.3); }
}
.mp-status-delivered .mp-status-dot,
.mp-status-closed    .mp-status-dot { background: #4caf50; animation: none; }
.mp-status-on_the_way .mp-status-dot { background: #42a5f5; }
.mp-status-cancelled  .mp-status-dot { background: #ef5350; animation: none; }
.mp-status-reason {
    font-size: 12px; color: #ef5350; margin-top: 4px;
    padding-left: 16px; font-style: italic;
}

/* ── Delivery form in cart ───────────────────────────────────────────────── */
.mp-delivery-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mp-delivery-input {
    width: 100%;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #0b0b0b;
    border-radius: 12px;
    padding: 11px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}
.mp-delivery-input::placeholder { color: #aaa; }
.mp-delivery-input:focus { outline: none; border-color: #0b0b0b; }

/* ── Pantalla de tracking del pedido ─────────────────────────────────────── */
#mp-order-screen {
    display: none;
    position: fixed; inset: 0;
    background: #fff; z-index: 500;
    overflow-y: auto;
}
#mp-order-screen.active { display: block; }

.mp-os-wrapper {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    padding: 0 0 40px;
}

.mp-os-top {
    background: #0b0b0b;
    color: #fff;
    text-align: center;
    padding: 52px 24px 36px;
}
.mp-os-check { font-size: 56px; margin-bottom: 12px; }
.mp-os-title { font-family: 'Bebas Neue', sans-serif; font-size: 36px; letter-spacing: 1px; margin-bottom: 6px; }
.mp-os-location { font-size: 14px; color: rgba(255,255,255,.6); font-weight: 500; }

.mp-os-items {
    padding: 24px 20px 0;
    border-bottom: 1px solid #f0f0f0;
}
.mp-os-item-row {
    display: flex; justify-content: space-between;
    padding: 7px 0; font-size: 14px; color: #555;
}
.mp-os-divider { border-top: 1px solid #f0f0f0; margin: 10px 0 8px; }
.mp-os-total-row {
    display: flex; justify-content: space-between;
    padding: 0 0 20px; font-size: 16px; font-weight: 800; color: #0b0b0b;
}

.mp-os-status-section {
    flex: 1;
    padding: 28px 20px 0;
    text-align: center;
}
.mp-os-status-label {
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: #999; margin-bottom: 14px;
}

@keyframes mp-os-pop { from { transform:scale(.92); opacity:0; } to { transform:scale(1); opacity:1; } }

.mp-os-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 17px; font-weight: 700;
    padding: 14px 24px; border-radius: 40px;
    animation: mp-os-pop .35s ease;
}
.mp-os-pill-pending        { background: #fff8e1; color: #e65100; }
.mp-os-pill-confirmed,
.mp-os-pill-preparing      { background: #e8f5e9; color: #2e7d32; }
.mp-os-pill-ready          { background: #e8f5e9; color: #1b5e20; font-size: 20px; }
.mp-os-pill-on_the_way     { background: #e3f2fd; color: #1565c0; }
.mp-os-pill-delivered,
.mp-os-pill-closed         { background: #e8f5e9; color: #1b5e20; }
.mp-os-pill-cancelled      { background: #fce4ec; color: #c62828; }
.mp-os-pill-bill_requested { background: #e3f2fd; color: #1565c0; }

.mp-os-reason {
    font-size: 13px; color: #c62828; margin-top: 10px; font-style: italic;
}

.mp-os-actions {
    padding: 28px 20px 0;
    display: flex; flex-direction: column; gap: 10px;
}
.mp-os-bill-btn {
    width: 100%; padding: 15px; border-radius: 14px;
    background: #0b0b0b; color: #fff;
    border: none; font-family: 'Montserrat', sans-serif;
    font-size: 15px; font-weight: 700; cursor: pointer;
}
.mp-os-back-btn {
    width: 100%; padding: 12px; border-radius: 14px;
    background: none; color: #aaa;
    border: 1.5px solid #e8e8e8;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ── Pantalla de agradecimiento ──────────────────────────────────────────── */
.mp-os-thankyou {
    align-items: center; justify-content: center;
    text-align: center; min-height: 100dvh;
    background: #0b0b0b; color: #fff;
    gap: 0; padding: 40px 24px;
}
.mp-os-ty-icon  { font-size: 72px; margin-bottom: 20px; animation: mp-os-pop .5s ease; }
.mp-os-ty-title { font-family: 'Bebas Neue', sans-serif; font-size: 48px; margin-bottom: 10px; color: #fff; }
.mp-os-ty-sub   { font-size: 16px; color: rgba(255,255,255,.5); margin-bottom: 32px; }
.mp-os-ty-counter { font-size: 14px; color: rgba(255,255,255,.35); }
.mp-os-ty-counter strong { color: rgba(255,255,255,.6); }

/* ── Cart bar ────────────────────────────────────────────────────────────── */
#mp-cart-bar {
    position: fixed;
    bottom: var(--safe-bottom);
    left: 0;
    right: 0;
    padding: 12px 5%;
    background: linear-gradient(to top, #fff 60%, transparent);
    display: none;
    z-index: 200;
}
#mp-cart-bar.visible { display: block; }
#mp-cart-btn {
    width: 100%;
    background: #0b0b0b;
    color: #fff;
    border: none;
    padding: 15px 20px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mp-cart-count {
    background: #fff;
    color: #0b0b0b;
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 700;
}

/* ── Cart drawer ─────────────────────────────────────────────────────────── */
#mp-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 600;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
#mp-cart-overlay.open { opacity: 1; pointer-events: all; }
#mp-cart-drawer {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 80dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    padding: 20px 5% calc(20px + var(--safe-bottom));
}
#mp-cart-overlay.open #mp-cart-drawer { transform: translateY(0); }
.mp-cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mp-cart-title { font-size: 18px; font-weight: 800; color: #0b0b0b; }
.mp-cart-close { background: #f0f0f0; border: none; color: #0b0b0b; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.mp-cart-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.mp-cart-item-name { flex: 1; font-size: 14px; font-weight: 500; color: #0b0b0b; }
.mp-cart-item-price { font-size: 14px; font-weight: 700; color: #0b0b0b; }
.mp-cart-item-remove { background: none; border: none; color: #ccc; font-size: 20px; cursor: pointer; padding: 4px; }
.mp-cart-total { display: flex; justify-content: space-between; padding: 16px 0 8px; font-size: 16px; font-weight: 800; color: #0b0b0b; }
.mp-table-select {
    width: 100%;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #0b0b0b;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    margin-top: 8px;
}
.mp-table-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 14px;
    background: #f0f7ff;
    border: 1px solid #bcd4f7;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #1a5eb8;
}
.mp-cart-note {
    width: 100%;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #0b0b0b;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    margin-top: 8px;
    resize: none;
}
.mp-cart-note::placeholder { color: #bbb; }
.mp-confirm-btn {
    width: 100%;
    background: #0b0b0b;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-top: 12px;
    cursor: pointer;
    transition: opacity .2s;
}
.mp-confirm-btn:hover { opacity: .8; }
.mp-confirm-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Bill button ─────────────────────────────────────────────────────────── */
#mp-bill-btn {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    right: 5%;
    background: #fff;
    border: 2px solid #0b0b0b;
    color: #0b0b0b;
    padding: 10px 18px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    transition: all .2s;
}
#mp-bill-btn.visible { display: flex; }
#mp-bill-btn.sent { background: #f0faf4; border-color: #4caf50; color: #2e7d32; pointer-events: none; }

/* ── Language modal ──────────────────────────────────────────────────────── */
#mp-lang-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
#mp-lang-modal.open { opacity: 1; pointer-events: all; }
.mp-lang-grid {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 320px;
    width: 90%;
}
.mp-lang-option {
    background: #f8f8f8;
    border: 1.5px solid #e0e0e0;
    color: #0b0b0b;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.mp-lang-option:hover,
.mp-lang-option.active { border-color: #0b0b0b; background: #0b0b0b; color: #fff; }
.mp-lang-title { grid-column: 1/-1; text-align: center; font-size: 15px; font-weight: 800; margin-bottom: 4px; color: #0b0b0b; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#mp-toast {
    position: fixed;
    bottom: calc(140px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0b0b0b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    z-index: 900;
    opacity: 0;
    transition: all .25s;
    white-space: nowrap;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
    pointer-events: none;
}
#mp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#mp-toast.success { background: #2e7d32; }
#mp-toast.error   { background: #c62828; }

/* ── Empty ───────────────────────────────────────────────────────────────── */
.mp-empty { text-align: center; padding: 80px 20px; color: #bbb; }
.mp-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Responsive: tablet (mantiene el grid pero ajusta tamaño) ────────────── */
@media (max-width: 900px) {
    .mp-section-grid { grid-template-columns: 1fr; }
    .mp-main-media { aspect-ratio: unset; height: 380px; position: static; }
}

/* ── Responsive: móvil — sin imagen principal, solo filas ────────────────── */
@media (max-width: 700px) {
    /* Ocultar el video/imagen grande por sección — en móvil no cabe bien */
    .mp-main-media { display: none; }

    #mp-header { padding: calc(24px + var(--safe-top)) 5% 18px; }
    .mp-header-name { font-size: 42px; }
    .mp-logo-img { margin-bottom: 14px; }
    .mp-header-actions { gap: 8px; }
    .mp-action-btn { font-size: 12px; padding: 8px 14px; }

    .mp-cat-section { padding: 32px 5% 0; }
    .mp-cat-title { font-size: 36px; margin-bottom: 16px; }

    /* Filas de ítems — thumbnail a la derecha, texto a la izquierda */
    .mp-item-row {
        grid-template-columns: 1fr 96px;
        gap: 12px;
        min-height: 80px;
        padding: 10px 0;
    }
    .mp-item-row-name { font-size: 14px; margin-bottom: 4px; }
    .mp-item-row-desc { font-size: 12px; }
    .mp-mini-video, .mp-mini-placeholder {
        width: 96px;
        height: 68px;
        border-radius: 8px;
    }

    /* Popup — sube desde abajo en móvil */
    #mp-popup { padding: 0; align-items: flex-end; }
    .mp-popup-card {
        width: 100%;
        border-radius: 20px 20px 0 0;
        grid-template-columns: 1fr;
        gap: 0;
        max-height: 92dvh;
        overflow-y: auto;
        animation: mpPopupSlide .28s ease;
    }
    @keyframes mpPopupSlide {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .mp-popup-media { height: 280px; border-radius: 0; }
    .mp-popup-info { padding: 16px 16px calc(16px + var(--safe-bottom)); }
    .mp-popup-info h3 { font-size: 17px; }
}
