/* elpizzero — catálogo público (cacheable). Variables PHP-dependientes inline en :root via <style> mini */
:root {
    --bg: #fafbfc;
    --surface: #fff;
    --ink-0: #0f1a2b;
    --ink-1: #1f2942;
    --ink-2: #4c5e7a;
    --muted: #8290a5;
    --border: #e6ebf2;
    --primary-dark: color-mix(in srgb, var(--primary) 75%, black);
    --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
    --ok: #2ecc71;
    --err: #e74c3c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    /* Bloqueamos scroll horizontal para que ningún elemento desbordado
       fuerce al navegador a encajar la página con un zoom incómodo.
       Usamos `clip` (no `hidden`) porque `hidden` rompe el scroll horizontal
       interno de hijos sticky como .cat-nav en WebKit/Blink móvil. */
    max-width: 100%;
    overflow-x: clip;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink-0); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* HEADER */
/* HERO slim — sin duplicar topbar */
.r-hero-slim {
    position: relative;
    min-height: 200px;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    background-image: var(--hero-cover-img, none), linear-gradient(135deg, var(--primary), var(--primary-dark));
    background-size: cover, auto;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}
.r-hero-slim .r-hero-overlay {
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(15,26,43,.35) 0%, rgba(15,26,43,.75) 100%);
}
.r-hero-inner {
    max-width: 1180px; margin: 0 auto;
    padding: 2rem 1.25rem 1.75rem;
    display: flex; flex-direction: column; gap: .65rem;
}
.r-hero-inner h1 {
    font-size: clamp(1.4rem, 3.4vw, 2.1rem); line-height: 1.18;
    font-weight: 800; letter-spacing: -.01em; margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.r-hero-sub {
    font-size: .98rem; opacity: .94; line-height: 1.45; margin: 0;
    max-width: 720px;
}
.r-hero-pills { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .25rem; }
.r-pill {
    background: rgba(255,255,255,.16); backdrop-filter: blur(8px);
    padding: .25rem .7rem; border-radius: 99px;
    font-size: .8rem; font-weight: 600;
}
.r-pill-open    { background: rgba(46,204,113,.85); }
.r-pill-closed  { background: rgba(231,76,60,.92); }
.r-pill-rating  { background: rgba(245,158,11,.92); }
.r-pill-rating small { font-weight: 400; opacity: .85; margin-left: .15rem; }
.r-hero-cta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.r-cta-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    background: #fff; color: var(--ink-0, #0f1a2b);
    padding: .7rem 1.2rem; border-radius: 9px;
    font-weight: 700; font-size: .92rem; border: 0; cursor: pointer;
    text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.r-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.22); }
.r-cta-secondary { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(8px); }

/* LAYOUT */
.r-layout { max-width: 1180px; margin: 0 auto; padding: 1.25rem; display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; }
/* CRÍTICO: los grid items tienen min-width:auto por defecto, lo que impide
   que su contenido (.cat-nav con chips) active scroll horizontal interno.
   Forzando min-width:0 en los hijos directos, el cat-nav puede desbordar
   y activar su overflow-x: scroll correctamente. */
.r-layout > * { min-width: 0; }
.cat-nav-wrap { min-width: 0; max-width: 100%; }

/* CATEGORÍAS NAV
   Estructura: .cat-nav-wrap (sticky) > .cat-nav (scroll horizontal).
   Separar sticky y overflow-x en elementos distintos es CLAVE: ponerlos en
   el mismo nodo bloquea el scroll horizontal en móviles WebKit/Blink. */
.cat-nav-wrap {
    position: sticky; top: 0; z-index: 5;
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    margin: -1.25rem -1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}
.cat-nav {
    display: flex; flex-wrap: nowrap; gap: .5rem;
    padding: .75rem 1.25rem;
    overflow-x: scroll; /* scroll explícito (no auto) para que iOS siempre acepte pan */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scroll-snap-type: x proximity;
    /* Scrollbar fina visible para que el usuario perciba que es deslizable */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.18) transparent;
}
.cat-nav::-webkit-scrollbar { height: 4px; }
.cat-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 99px; }
.cat-nav::-webkit-scrollbar-track { background: transparent; }
.cat-nav a {
    padding: .45rem 1rem; border-radius: 99px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: .88rem; font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0; flex-grow: 0; /* nunca se comprimen, siempre desbordan */
    scroll-snap-align: start;
    transition: background .15s, color .15s, border-color .15s;
}
.cat-nav a.active, .cat-nav a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* CATEGORÍAS */
.cat { margin-bottom: 2rem; scroll-margin-top: 80px; }
.cat h2 { font-size: 1.4rem; margin-bottom: .15rem; letter-spacing: -.01em; }
.cat .desc { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }

/* PRODUCT CARD */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: .75rem; }
.product {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    display: flex; gap: 1rem;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, border-color .15s;
}
.product:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -10px rgba(15,26,43,.18); border-color: var(--primary); }
.product .ph {
    width: 84px; height: 84px; border-radius: 10px;
    flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; line-height: 1;
    position: relative;
    box-shadow: 0 2px 6px rgba(15,26,43,0.06);
    transition: transform .25s, box-shadow .25s;
}
.product:hover .ph { transform: scale(1.04) rotate(-2deg); box-shadow: 0 6px 18px rgba(15,26,43,0.15); }
.product .ph::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 60%);
    pointer-events: none;
}
.product .ph img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.product .ph .e { position: relative; z-index: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18)); }
.product .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product .name { font-weight: 700; font-size: .98rem; }
.product .desc { color: var(--muted); font-size: .82rem; line-height: 1.4; margin-top: .15rem; }
.product .footer { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; }
.product .price { color: var(--primary); font-weight: 800; font-size: 1rem; }
.product .add {
    background: var(--primary); color: white;
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; line-height: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
    transition: transform .15s, box-shadow .15s;
}
.product:hover .add { transform: rotate(90deg) scale(1.05); }

/* CARRITO LATERAL */
.cart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    position: sticky; top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    display: flex; flex-direction: column;
}
.cart h3 { font-size: 1.1rem; margin-bottom: .85rem; display: flex; justify-content: space-between; align-items: center; }
.cart .count-badge { background: var(--accent); color: white; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-empty { color: var(--muted); text-align: center; padding: 2rem 1rem; font-size: .9rem; }
.cart-item { display: flex; gap: .65rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.cart-item .qbox { display: flex; flex-direction: column; gap: .15rem; align-items: center; flex-shrink: 0; }
.cart-item .qbox button { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; line-height: 1; font-size: 1rem; color: var(--ink-1); }
.cart-item .qbox button:hover { border-color: var(--primary); color: var(--primary); }
.cart-item .qbox span { font-weight: 700; font-size: .85rem; min-width: 18px; text-align: center; }
.cart-item .body { flex: 1; min-width: 0; }
.cart-item .body .n { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.cart-item .body .opts { color: var(--muted); font-size: .76rem; margin-top: .15rem; }
.cart-item .body .combo-half { margin-top: .35rem; padding: .25rem .4rem; border-left: 3px solid var(--primary); background: rgba(0,0,0,.025); border-radius: 4px; }
.cart-item .body .combo-half strong { font-size: .82rem; color: var(--ink-0); display: block; }
.cart-item .body .combo-extras { list-style: none; margin: .2rem 0 0; padding: 0; }
.cart-item .body .combo-extras li { font-size: .76rem; color: var(--muted); padding-left: .9rem; position: relative; line-height: 1.35; }
.cart-item .body .combo-extras li::before { content: "+"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.cart-item .body .p { color: var(--primary); font-weight: 700; font-size: .85rem; margin-top: .25rem; }
.cart-item .rm { color: var(--muted); cursor: pointer; padding: .15rem; font-size: .9rem; }
.cart-item .rm:hover { color: var(--err); }
.cart-totals { border-top: 2px solid var(--border); padding-top: .85rem; margin-top: .5rem; }
.cart-totals .line { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: .15rem; }
.cart-totals .total { font-size: 1.2rem; font-weight: 800; color: var(--ink-0); margin-top: .35rem; }
.cart .checkout-btn {
    margin-top: 1rem; width: 100%; padding: .85rem;
    background: var(--primary); color: white; border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.cart .checkout-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(74,144,226,.4); }
.cart .checkout-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; transform: none; box-shadow: none; }

/* MODAL PRODUCTO (selección sizes/extras) */
.pmodal-overlay {
    position: fixed; inset: 0; background: rgba(15,26,43,.6); z-index: 90;
    display: none; align-items: flex-end; justify-content: center;
    padding: 0;
}
.pmodal-overlay.open { display: flex; animation: fadein .2s; }
@keyframes fadein { from{opacity:0;} to{opacity:1;} }
.pmodal {
    background: var(--surface); border-radius: 18px 18px 0 0;
    width: 100%; max-width: 540px; max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: slideup .25s cubic-bezier(.2,.8,.3,1);
}
.pmodal form#pm-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; }
.pmodal .body-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.pmodal .action-bar {
    flex-shrink: 0; background: #fff; border-top: 1px solid var(--border);
    padding: .85rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(15,26,43,.08);
}
@keyframes slideup { from{transform:translateY(100%);} to{transform:translateY(0);} }
.pmodal .ph {
    flex-shrink: 0;
    height: 220px; display: flex; align-items: center; justify-content: center;
    font-size: 5.5rem; line-height: 1; position: relative; overflow: hidden;
}
.pmodal .ph::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.45), transparent 55%),
                radial-gradient(circle at 70% 70%, rgba(0,0,0,0.18), transparent 60%);
    pointer-events: none;
}
.pmodal .ph img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.pmodal .ph .e {
    position: relative; z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
    animation: dishFloat 3.5s ease-in-out infinite;
}
@keyframes dishFloat { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.pmodal .ph .close-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; background: rgba(255,255,255,.96); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18); -webkit-tap-highlight-color: rgba(0,0,0,.05); z-index: 2; }
.pmodal .ph .close-x:active { transform: scale(.92); }
.pmodal .body-scroll h2 { font-size: 1.4rem; }
.pmodal .body-scroll .desc { color: var(--ink-2); margin: .35rem 0 1rem; }

/* Half/Whole toggle */
.half-toggle {
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
    margin: 0 0 1.25rem; padding: .25rem;
    background: var(--bg); border-radius: 12px;
}
.half-toggle button {
    padding: .65rem; background: transparent; border: 2px solid transparent;
    border-radius: 10px; font-size: .9rem; font-weight: 700; cursor: pointer;
    color: var(--ink-2); transition: all .15s; line-height: 1.2;
}
.half-toggle button.active {
    background: #fff; color: var(--accent);
    border-color: var(--accent); box-shadow: 0 2px 6px rgba(255,107,61,.18);
}
.half-toggle button .sub { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); margin-top: .15rem; }
.half-toggle button.active .sub { color: var(--accent); }
.opt-group { margin-bottom: 1.25rem; }
.opt-group h4 { font-size: .98rem; display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.opt-group .req { background: var(--accent); color: white; font-size: .68rem; padding: .1rem .5rem; border-radius: 99px; font-weight: 600; }
.opt-row { display: flex; align-items: center; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 9px; margin-bottom: .35rem; cursor: pointer; transition: border-color .12s, background .12s; }
.opt-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.opt-row input { margin-right: .65rem; transform: scale(1.1); accent-color: var(--primary); }
.opt-row .n { flex: 1; font-size: .92rem; }
.opt-row .p { color: var(--primary); font-weight: 700; font-size: .9rem; }
.pmodal .qty-row { display: flex; align-items: center; gap: 1rem; margin: 0 0 .65rem; justify-content: center; }
.pmodal .qty-row .qbtn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 1.2rem; }
.pmodal .qty-row .qty { font-weight: 700; font-size: 1.1rem; min-width: 30px; text-align: center; }
.pmodal .add-btn {
    width: 100%; padding: 1rem; background: var(--primary); color: white; border: none; border-radius: 12px;
    font-size: 1.05rem; font-weight: 700; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: transform .12s, box-shadow .12s;
}
.pmodal .add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74,144,226,.4); }
.pmodal-instr { width: 100%; padding: .65rem; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; resize: vertical; min-height: 60px; }

/* Toast notificación */
.toast {
    position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
    background: #1a2942; color: #fff; padding: .85rem 1.25rem; border-radius: 99px;
    font-size: .92rem; font-weight: 600; z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    animation: toastIn .3s cubic-bezier(.2,.8,.3,1), toastOut .3s ease 2.4s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -10px); } }

/* CART MOBILE FAB */
.cart-fab {
    display: none;
    position: fixed; bottom: 1rem; left: 1rem; right: 1rem;
    background: var(--primary); color: white;
    padding: .9rem 1.25rem; border-radius: 12px;
    font-weight: 700; font-size: .95rem;
    z-index: 30; box-shadow: 0 6px 20px rgba(74,144,226,.45);
    cursor: pointer;
}

@media (max-width: 920px) {
    .r-layout { grid-template-columns: 1fr; }
    .cart { display: none; }
    .cart.show-mobile { display: flex; position: fixed; inset: 0; max-height: 100vh; border-radius: 0; z-index: 40; }
    .cart.show-mobile .close-mobile { display: block; }
    .cart-fab.show { display: block; }
}
.close-mobile { display: none; position: absolute; top: 12px; right: 12px; background: var(--bg); border-radius: 50%; width: 32px; height: 32px; align-items: center; justify-content: center; font-size: 1.3rem; cursor: pointer; }

/* CHECKOUT MODAL */
.co-overlay { position: fixed; inset: 0; background: rgba(15,26,43,.7); z-index: 90; display: none; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.co-overlay.open { display: flex; animation: fadein .2s; }
.co {
    background: var(--surface); border-radius: 18px;
    max-width: 540px; width: 100%; padding: 1.5rem;
    margin-top: 2rem;
}
.co h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.co .field { margin-bottom: .75rem; }
.co label { display: block; font-size: .82rem; color: var(--ink-2); font-weight: 600; margin-bottom: .25rem; }
.co input, .co select, .co textarea { width: 100%; padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 9px; font-size: .95rem; font-family: inherit; outline: none; transition: border-color .12s; }
.co input:focus, .co select:focus, .co textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.co .row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.co .seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.co .seg label { padding: .85rem; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; text-align: center; font-weight: 600; font-size: .9rem; transition: all .15s; }
.co .seg input { display: none; }
.co .seg input:checked + span { color: var(--primary); }
.co .seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.co .submit { width: 100%; padding: 1rem; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 1.05rem; font-weight: 700; cursor: pointer; margin-top: .5rem; }
.co .err-msg { background: #fdecea; color: var(--err); padding: .65rem; border-radius: 9px; font-size: .9rem; margin-bottom: .75rem; display: none; }

/* ===== Cuando un modal está abierto, esconder la barra fija inferior y el FAB para que no tapen los botones del modal ===== */
body:has(.pmodal-overlay.open) .r-mobile-bar,
body:has(.co-overlay.open) .r-mobile-bar,
body:has(.rv-overlay.show) .r-mobile-bar,
body:has(.hc-overlay.show) .r-mobile-bar,
body:has(.cart.show-mobile) .r-mobile-bar {
    display: none !important;
}
body:has(.pmodal-overlay.open) .cart-fab,
body:has(.co-overlay.open) .cart-fab,
body:has(.rv-overlay.show) .cart-fab,
body:has(.hc-overlay.show) .cart-fab,
body:has(.cart.show-mobile) .cart-fab {
    display: none !important;
}
body:has(.pmodal-overlay.open),
body:has(.co-overlay.open),
body:has(.rv-overlay.show),
body:has(.hc-overlay.show),
body:has(.cart.show-mobile) {
    overflow: hidden;
}

/* ===== Móvil: pulido general en pantallas pequeñas ===== */
@media (max-width: 560px) {
    /* Layout: menos padding lateral para aprovechar ancho */
    .r-layout { padding: 1rem .85rem; gap: 1rem; }
    .cat-nav-wrap { margin: -1rem -.85rem 1rem; }
    .cat-nav { padding: .65rem .85rem; }
    .cat { margin-bottom: 1.5rem; scroll-margin-top: 70px; }
    .cat h2 { font-size: 1.2rem; }
    .cat .desc { font-size: .88rem; margin-bottom: .75rem; }

    /* Tarjetas de producto: 1 col, padding compacto */
    .products { grid-template-columns: 1fr; gap: .55rem; }
    .product { padding: .75rem; gap: .75rem; border-radius: 12px; }
    .product .ph { width: 76px; height: 76px; font-size: 1.9rem; }
    .product .name { font-size: .95rem; line-height: 1.3; }
    .product .desc { font-size: .8rem; margin-top: .1rem; }
    .product .price { font-size: .98rem; }
    .product .add { width: 34px; height: 34px; font-size: 1.4rem; box-shadow: 0 3px 8px rgba(0,0,0,.18); }

    /* === MODAL PRODUCTO FULLSCREEN EN MÓVIL ===
       Quitamos el bottom-sheet (que dejaba 8% del fondo visible y daba sensación
       de "modal grande / zoom"). Ahora ocupa el 100% del viewport y se ve nítido. */
    .pmodal-overlay {
        align-items: stretch;
        background: var(--surface); /* sin overlay oscuro: ya cubre todo */
    }
    .pmodal {
        max-width: none;
        width: 100%;
        max-height: 100vh; max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
        animation: fadein .18s; /* sin slideup: evita la sensación de zoom */
    }
    .pmodal .ph {
        height: 130px; font-size: 3.5rem;
    }
    .pmodal .ph .close-x {
        top: 12px; right: 12px;
        width: 42px; height: 42px; font-size: 1.55rem;
    }
    .pmodal .body-scroll { padding: 1rem 1rem 1.25rem; }
    .pmodal .body-scroll h2 { font-size: 1.25rem; line-height: 1.25; }
    .pmodal .body-scroll .desc { font-size: .92rem; margin: .35rem 0 1rem; }
    .pmodal .action-bar {
        padding: .75rem 1rem calc(.85rem + env(safe-area-inset-bottom));
    }
    .pmodal .add-btn { padding: .95rem; font-size: 1rem; }
    .pmodal .qty-row { gap: .75rem; margin-bottom: .55rem; }
    .pmodal .qty-row .qbtn { width: 40px; height: 40px; font-size: 1.25rem; }
    .pmodal-instr { font-size: 16px; min-height: 54px; }
    .opt-row { padding: .7rem .8rem; margin-bottom: .4rem; }
    .opt-row .n { font-size: .95rem; }
    .opt-row .p { font-size: .92rem; }
    .opt-group { margin-bottom: 1.1rem; }
    .opt-group h4 { font-size: .95rem; }
    .half-toggle { margin-bottom: 1rem; }
    .half-toggle button { padding: .7rem .55rem; font-size: .88rem; }

    /* Checkout */
    .co-overlay { padding: 0; align-items: stretch; }
    .co {
        padding: 1rem; margin-top: 0; border-radius: 0;
        max-width: none; width: 100%; min-height: 100dvh;
    }
    .co h2 { font-size: 1.15rem; margin-bottom: .85rem; }
    .co input, .co select, .co textarea { font-size: 16px; padding: .7rem .85rem; }
    .co .row { gap: .5rem; }
    .co .seg label { padding: .7rem .5rem; font-size: .88rem; }

    /* Barra inferior fija: tap targets cómodos + sin pisarse con la safe-area */
    .r-mobile-bar { padding: .5rem .65rem calc(.5rem + env(safe-area-inset-bottom)); gap: .45rem; }
    .r-mobile-bar .rm-btn { min-height: 50px; font-size: .9rem; border-radius: 11px; }
    .r-mobile-bar .rm-btn:active { transform: scale(.97); }

    /* Hero más ajustado */
    .r-hero-inner { padding: 1.5rem 1rem 1.25rem; gap: .55rem; }
    .r-hero-inner h1 { font-size: 1.35rem; }
    .r-hero-sub { font-size: .9rem; }
    .r-cta-btn { padding: .6rem 1rem; font-size: .88rem; }
}

@media (max-width: 380px) {
    .r-layout { padding: .85rem .65rem; }
    .cat-nav-wrap { margin: -.85rem -.65rem .85rem; }
    .cat-nav { padding: .55rem .65rem; }

    .product { padding: .65rem; gap: .65rem; }
    .product .ph { width: 68px; height: 68px; font-size: 1.7rem; }
    .product .name { font-size: .9rem; }
    .product .desc { font-size: .76rem; }
    .product .price { font-size: .92rem; }

    .pmodal .ph { height: 140px; font-size: 3.6rem; }
    .pmodal .body-scroll { padding: .85rem; }
    .pmodal .body-scroll h2 { font-size: 1.08rem; }
    .pmodal .body-scroll .desc { font-size: .85rem; }
    .pmodal .action-bar { padding: .6rem .8rem calc(.7rem + env(safe-area-inset-bottom)); }
    .pmodal .add-btn { padding: .8rem; font-size: .92rem; border-radius: 10px; }
    .pmodal .qty-row .qbtn { width: 34px; height: 34px; font-size: 1.05rem; }
    .opt-row { padding: .5rem .6rem; }
    .opt-row .n { font-size: .86rem; }
    .opt-row .p { font-size: .85rem; }
    .half-toggle button { padding: .55rem; font-size: .82rem; }
    .half-toggle button .sub { font-size: .68rem; }

    .co { padding: .85rem; }
    .co h2 { font-size: 1.05rem; }
    .co .seg label { padding: .6rem .4rem; font-size: .82rem; }

    .r-mobile-bar .rm-btn { min-height: 46px; font-size: .85rem; }
    .r-mobile-bar .rm-cart-count { font-size: .72rem; padding: .05rem .42rem; min-width: 20px; }
}

/* Móvil apaisado o pantallas bajas: el modal no debe tapar el dedo */
@media (max-height: 640px) {
    .pmodal { max-height: 96vh; max-height: 96dvh; }
    .pmodal .ph { height: 130px; font-size: 3.2rem; }
    .pmodal .ph .close-x { width: 36px; height: 36px; font-size: 1.3rem; }
}

/* ==========================================================================
   iOS: bloquear el auto-zoom al hacer focus en un campo.
   Causa: iOS Safari hace zoom in si el font-size del control es < 16px.
   Solución: 16px MÍNIMO en todos los form controls dentro de modales.
   ========================================================================== */
.pmodal input,
.pmodal select,
.pmodal textarea,
.pmodal-instr,
.co input,
.co select,
.co textarea,
.rv-modal input,
.rv-modal select,
.rv-modal textarea,
.hc-modal input,
.hc-modal select,
.hc-modal textarea {
    font-size: 16px !important;
    line-height: 1.4;
}

/* Evita que el navegador móvil haga zoom progresivo si el usuario hace doble tap.
   Excluimos .cat-nav a para que el scroll horizontal por touch funcione perfecto. */
button, label.opt-row, .pmodal, .co,
a:not(.cat-nav a) {
    touch-action: manipulation;
}
.cat-nav a { touch-action: pan-x; }
