/* Pidaloo — catálogo público (mobile-first) */
:root{--brand:#0B5FFF;--accent:#18C1F0;--text:#111a2e;--muted:#5f6b80;--line:#e8ecf3;--bg:#f6f7fb;--card:#fff;--ok:#12A150;--red:#E5484D;--wa:#25D366;--r:16px;
  --font:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
*{box-sizing:border-box}
svg:not([width]){width:1.15em;height:1.15em;vertical-align:-.18em;flex:none}
html{-webkit-text-size-adjust:100%;scroll-padding-top:70px}
body{margin:0;font-family:var(--font);color:var(--text);background:var(--bg);font-size:16px;line-height:1.45;-webkit-tap-highlight-color:transparent}
img{display:block;max-width:100%}
button{font:inherit;color:inherit}
a{color:var(--brand)}
.wrap{max-width:760px;margin:0 auto}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
:focus-visible{outline:3px solid color-mix(in srgb,var(--brand) 50%,transparent);outline-offset:2px}

/* Encabezado */
.hero{position:relative;background:linear-gradient(135deg,var(--brand),var(--accent));min-height:150px}
.hero img.cover{width:100%;height:190px;object-fit:cover}
.hero::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,0) 40%,rgba(0,0,0,.25))}
.biz{background:var(--card);border-radius:22px 22px 0 0;margin-top:-22px;position:relative;z-index:2;padding:0 1rem 1rem}
.biz .logo{width:84px;height:84px;border-radius:22px;border:4px solid #fff;background:#fff;object-fit:cover;margin-top:-42px;box-shadow:0 6px 18px rgba(0,0,0,.12);display:grid;place-items:center;font-weight:800;font-size:1.6rem;color:var(--brand)}
.biz h1{font-size:1.45rem;margin:.55rem 0 .15rem;letter-spacing:-.02em;line-height:1.2}
.biz p{margin:0 0 .6rem;color:var(--muted)}
.biz-info{display:flex;flex-wrap:wrap;gap:.4rem}
.biz-info span{display:inline-flex;align-items:center;gap:.3rem;background:var(--bg);border-radius:99px;padding:.3rem .65rem;font-size:.82rem;font-weight:600;color:#3a4660}
.biz-info svg{width:15px;height:15px}
.preview-bar{background:#FFF4DC;color:#7A4E00;text-align:center;font-weight:600;font-size:.85rem;padding:.55rem 1rem}

/* Pestañas de categorías */
.tabs{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.tabs-in{display:flex;gap:.45rem;overflow-x:auto;padding:.6rem 1rem;scrollbar-width:none}
.tabs-in::-webkit-scrollbar{display:none}
.tab{flex:none;border:1.5px solid var(--line);background:#fff;border-radius:99px;padding:.5rem .95rem;font-weight:700;font-size:.9rem;cursor:pointer;white-space:nowrap;color:#3a4660}
.tab.on{background:var(--brand);border-color:var(--brand);color:#fff}
.search{display:flex;align-items:center;gap:.5rem;margin:.8rem 1rem 0;background:#fff;border:1.5px solid var(--line);border-radius:14px;padding:0 .8rem}
.search input{border:0;outline:0;font:inherit;flex:1;min-height:46px;background:transparent}
.search svg{width:20px;height:20px;color:var(--muted)}

/* Productos */
.section{padding:1rem 1rem .25rem}
.section h2{font-size:1.15rem;margin:0 0 .6rem}
.p{display:flex;gap:.85rem;background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:.8rem;margin-bottom:.65rem;cursor:pointer;text-align:left;width:100%;align-items:stretch}
.p:active{transform:scale(.995)}
.p .txt{flex:1;min-width:0;display:flex;flex-direction:column}
.p h3{font-size:1rem;margin:0 0 .2rem;line-height:1.25}
.p .d{font-size:.86rem;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0 0 .4rem}
.p .price{margin-top:auto;font-weight:800;font-size:1.02rem}
.p .price s{color:var(--muted);font-weight:500;font-size:.85rem;margin-left:.35rem}
.p .pic{position:relative;flex:none;width:104px;height:104px}
.p .pic img,.p .pic .ph{width:104px;height:104px;border-radius:14px;object-fit:cover;background:linear-gradient(135deg,color-mix(in srgb,var(--brand) 14%,#fff),color-mix(in srgb,var(--accent) 18%,#fff));display:grid;place-items:center;font-size:2rem;font-weight:800;color:var(--brand)}
.p .add{position:absolute;right:-6px;bottom:-6px;width:38px;height:38px;border-radius:50%;background:var(--brand);color:#fff;border:3px solid #fff;display:grid;place-items:center;box-shadow:0 4px 10px rgba(0,0,0,.18)}
.p .add svg{width:20px;height:20px}
.p .qty-badge{position:absolute;left:-6px;top:-6px;background:var(--text);color:#fff;border-radius:99px;min-width:26px;height:26px;display:grid;place-items:center;font-size:.8rem;font-weight:800;border:2px solid #fff}
.p.out{opacity:.6;cursor:default}
.p.out .add{display:none}
.tag-out{display:inline-block;align-self:flex-start;background:#FFECEC;color:#B4232A;font-size:.75rem;font-weight:800;border-radius:99px;padding:.1rem .5rem;margin-top:.2rem}
.tag-promo{display:inline-block;background:#F1EAFF;color:#5B2BC4;font-size:.72rem;font-weight:800;border-radius:99px;padding:.1rem .5rem;margin-bottom:.2rem;align-self:flex-start}
.empty{text-align:center;padding:3rem 1rem;color:var(--muted)}
.foot{text-align:center;color:var(--muted);font-size:.8rem;padding:2rem 1rem 8rem}
.foot a{color:var(--muted);font-weight:700}

/* Barra del carrito */
.cartbar{position:fixed;left:0;right:0;bottom:0;z-index:30;padding:.7rem 1rem calc(.7rem + env(safe-area-inset-bottom));background:linear-gradient(180deg,rgba(246,247,251,0),var(--bg) 35%)}
.cartbar button{width:100%;max-width:728px;margin:0 auto;display:flex;align-items:center;gap:.75rem;background:var(--brand);color:#fff;border:0;border-radius:16px;min-height:58px;padding:0 1.1rem;font-weight:800;font-size:1.02rem;cursor:pointer;box-shadow:0 10px 24px color-mix(in srgb,var(--brand) 40%,transparent)}
.cartbar .count{background:rgba(255,255,255,.22);border-radius:10px;min-width:32px;height:32px;display:grid;place-items:center}
.cartbar .sp{flex:1;text-align:left}
.cartbar[hidden]{display:none}

/* Hojas (modales inferiores) */
.sheet-bg{position:fixed;inset:0;background:rgba(10,15,30,.5);z-index:40;opacity:0;pointer-events:none;transition:opacity .2s}
.sheet-bg.on{opacity:1;pointer-events:auto}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:50;background:#fff;border-radius:24px 24px 0 0;max-height:92vh;display:flex;flex-direction:column;transform:translateY(105%);transition:transform .25s ease;max-width:760px;margin:0 auto}
.sheet.on{transform:none}
.sheet-h{display:flex;align-items:center;gap:.5rem;padding:1rem 1rem .6rem;border-bottom:1px solid var(--line)}
.sheet-h h2{font-size:1.15rem;margin:0;flex:1}
.sheet-b{overflow-y:auto;padding:1rem;flex:1;-webkit-overflow-scrolling:touch}
.sheet-f{padding:.8rem 1rem calc(.8rem + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}
.x{background:var(--bg);border:0;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;cursor:pointer}
.x svg{width:20px;height:20px}
.pd-img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:18px;background:var(--bg);margin-bottom:1rem}
.pd-name{font-size:1.3rem;margin:0 0 .3rem}
.pd-desc{color:var(--muted);margin:0 0 .8rem;white-space:pre-line}

/* Controles */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:52px;padding:.7rem 1.2rem;border-radius:14px;border:0;background:var(--brand);color:#fff;font-weight:800;font-size:1rem;cursor:pointer;text-decoration:none;width:100%}
.btn svg{width:20px;height:20px}
.btn[disabled]{opacity:.5;pointer-events:none}
.btn-wa{background:var(--wa);color:#05341A}
.btn-ghost{background:var(--bg);color:var(--text)}
.btn-row{display:flex;gap:.6rem;align-items:center}
.stepper{display:inline-flex;align-items:center;border:1.5px solid var(--line);border-radius:14px;overflow:hidden;flex:none}
.stepper button{width:44px;height:44px;border:0;background:#fff;font-size:1.3rem;font-weight:700;cursor:pointer;color:var(--brand)}
.stepper button:disabled{color:#c3c9d6}
.stepper span{min-width:36px;text-align:center;font-weight:800}
.line{display:flex;gap:.75rem;align-items:center;padding:.75rem 0;border-bottom:1px solid var(--line)}
.line img,.line .ph{width:54px;height:54px;border-radius:12px;object-fit:cover;background:var(--bg);flex:none}
.line .n{flex:1;min-width:0}
.line .n b{display:block;font-size:.95rem;line-height:1.25}
.line .n small{color:var(--muted)}
.line .rm{background:none;border:0;color:var(--muted);font-size:.8rem;text-decoration:underline;cursor:pointer;padding:0}
.totals{margin:1rem 0 .25rem}
.totals div{display:flex;justify-content:space-between;padding:.25rem 0;color:#3a4660}
.totals .t{font-weight:800;font-size:1.2rem;color:var(--text);border-top:1px dashed var(--line);margin-top:.35rem;padding-top:.6rem}
.note{background:#FFF7E6;color:#7A4E00;border-radius:12px;padding:.7rem .85rem;font-size:.88rem;font-weight:600;margin:.6rem 0}
.note.info{background:#EAF2FF;color:#0B3FA8}
.note.err{background:#FFEDED;color:#9B1C22}
.note.ok{background:#E7F8EE;color:#0B6B37}
.f{margin-bottom:.9rem}
.f label{display:block;font-weight:700;font-size:.9rem;margin-bottom:.3rem}
.f input,.f textarea{width:100%;min-height:50px;border:1.5px solid var(--line);border-radius:14px;padding:.7rem .9rem;font:inherit;background:#fff}
.f textarea{min-height:76px;resize:vertical}
.f input:focus,.f textarea:focus{border-color:var(--brand);outline:0;box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 14%,transparent)}
.f .err{color:var(--red);font-size:.83rem;font-weight:600;margin-top:.25rem}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin-bottom:.9rem}
.opt{display:flex;gap:.6rem;align-items:flex-start;border:1.5px solid var(--line);border-radius:14px;padding:.8rem;cursor:pointer;background:#fff}
.opt input{margin-top:.2rem;accent-color:var(--brand);width:18px;height:18px;flex:none}
.opt:has(input:checked){border-color:var(--brand);background:color-mix(in srgb,var(--brand) 6%,#fff)}
.opt b{display:block}
.opt small{color:var(--muted)}
.pm-list{display:grid;gap:.5rem;margin-bottom:.9rem}
.check{display:flex;gap:.55rem;align-items:flex-start;font-size:.86rem;color:#3a4660;margin-bottom:.6rem}
.check input{width:18px;height:18px;accent-color:var(--brand);margin-top:.1rem;flex:none}
h3.sub{font-size:1rem;margin:1.2rem 0 .6rem}

/* Página del pedido */
.order-card{background:#fff;border-radius:20px;border:1px solid var(--line);padding:1.1rem;margin:1rem}
.order-ok{text-align:center;padding:1.4rem 1rem .5rem}
.order-ok .big{width:68px;height:68px;border-radius:50%;background:#E7F8EE;color:var(--ok);display:grid;place-items:center;margin:0 auto .6rem}
.order-ok .big svg{width:36px;height:36px}
.ref{font-size:1.6rem;font-weight:800;letter-spacing:.02em}
.qr{width:220px;margin:.5rem auto;border-radius:12px;border:1px solid var(--line)}
.mini-head{display:flex;align-items:center;gap:.7rem;padding:1rem;background:#fff;border-bottom:1px solid var(--line)}
.mini-head img,.mini-head .lg{width:44px;height:44px;border-radius:12px;object-fit:cover;background:var(--bg);display:grid;place-items:center;font-weight:800;color:var(--brand)}
.badge{display:inline-block;padding:.2rem .6rem;border-radius:99px;font-size:.78rem;font-weight:800;background:#EEF1F6;color:#41506B}
.toast{position:fixed;left:50%;bottom:92px;transform:translateX(-50%) translateY(20px);background:#111a2e;color:#fff;padding:.65rem 1rem;border-radius:12px;font-weight:700;font-size:.9rem;opacity:0;transition:all .2s;z-index:60;pointer-events:none;max-width:90vw}
.toast.on{opacity:1;transform:translateX(-50%) translateY(0)}

@media (min-width:760px){
  .hero img.cover{height:260px}
  .biz{border-radius:24px 24px 0 0}
  .products-grid{display:grid;grid-template-columns:1fr 1fr;gap:.65rem}
  .products-grid .p{margin:0}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
.x[hidden]{display:none}
.line .ph{display:grid;place-items:center;font-weight:800;color:var(--brand);background:color-mix(in srgb,var(--brand) 12%,#fff)}
.toast{bottom:auto;top:16px}
