/* Catálogo: encabezado por grupo + grilla de fotos. Una columna en celular, hasta 4 en compu. */
:root {
  --bg: #FCF8F4;
  --surface: #FFFFFF;
  --sunk: #F4EAE0;
  --ink: #3A2617;
  --muted: #8A6F5B;
  --line: #EBDDD0;
  --brand: #945E2C;
  --brand-ink: #FFFFFF;
  --tan: #CE9160;
  --blush: #F7E7DC;
  --err: #B03A2E;
  --wa: #1F8F55;
  --wa-ink: #FFFFFF;
  --cover-ink: #7A4A22;
  --logo-osc: block;
  --logo-clr: none;
  --shadow: 0 1px 2px rgba(58,38,23,.06), 0 8px 24px rgba(58,38,23,.08);
  --f-display: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --f-script: "Mrs Saint Delafield", "Brush Script MT", cursive;
  --r: 18px;
  --r-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1410; --surface: #261C16; --sunk: #2F241C; --ink: #F4E9DF; --muted: #BCA390;
    --line: #3E3026; --brand: #D99A62; --brand-ink: #1C1410; --tan: #E2AE80; --blush: #3A2A20;
    --err: #F08A7E; --wa: #3DBE7A; --wa-ink: #10261A; --logo-osc: none; --logo-clr: block;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1410; --surface: #261C16; --sunk: #2F241C; --ink: #F4E9DF; --muted: #BCA390;
  --line: #3E3026; --brand: #D99A62; --brand-ink: #1C1410; --tan: #E2AE80; --blush: #3A2A20;
  --err: #F08A7E; --wa: #3DBE7A; --wa-ink: #10261A; --logo-osc: none; --logo-clr: block;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--bg); }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 640px; margin: 0 auto; }
.script { font-family: var(--f-script); font-weight: 400; color: var(--tan); font-size: 1.45em; line-height: .8; letter-spacing: 0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.logo-link { background: none; border: 0; padding: 0; display: inline-flex; flex: none; }
.logo-link img { height: 38px; width: auto; }
.logo-osc { display: var(--logo-osc); }
.logo-clr { display: var(--logo-clr); }
.steps { display: flex; gap: 6px; flex: 1; min-width: 0; justify-content: center; }
.step { border: 0; background: none; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; max-width: 130px; color: var(--muted); font-size: 11.5px; font-weight: 600; min-width: 0; }
.step .bar { height: 4px; width: 100%; border-radius: 4px; background: var(--line); transition: background .3s; }
.step.done .bar, .step.on .bar { background: var(--brand); }
.step.on { color: var(--ink); }
.step:disabled { cursor: default; }
.step .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none; }
.icon-btn .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 12px; margin-left: 4px; padding: 0 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 22px; font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .15s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 600; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* ---------- Views ---------- */
.view { padding-block: 22px 150px; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-head { display: grid; gap: 6px; margin-bottom: 20px; }
.view-head h2 { font-size: clamp(28px, 6vw, 38px); font-weight: 700; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 24px; align-items: center; padding-top: 6px; }
.hero-copy { display: grid; gap: 14px; justify-items: start; }
.hero-copy .logo-big { width: min(230px, 62%); height: auto; }
.hero-copy h1 { font-size: clamp(36px, 9vw, 58px); font-weight: 700; line-height: 1.02; }
.hero-copy h1 .script { display: inline-block; font-size: 1.3em; transform: translateY(.1em); margin-left: .04em; }
.hero-copy .lead { font-size: 17px; color: var(--muted); max-width: 36ch; }
.how { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; counter-reset: how; }
.how li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; counter-increment: how; font-size: 15px; }
.how li::before { content: counter(how); width: 30px; height: 30px; border-radius: 50%; background: var(--blush); color: var(--brand); font-family: var(--f-display); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.how b { display: block; font-family: var(--f-display); font-weight: 600; }
.how span { color: var(--muted); font-size: 14px; }
.hero-photos { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; aspect-ratio: 5 / 4.4; max-width: 100%; }
.hero-photos figure { margin: 0; border-radius: var(--r); overflow: hidden; background: var(--sunk); }
.hero-photos figure:first-child { grid-row: span 2; }
.hero-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Herramientas del catálogo ---------- */
.cat-tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 59px); z-index: 20; background: var(--bg); padding-block: 10px 10px; margin-top: 30px; display: grid; gap: 10px; border-bottom: 1px solid transparent; }
.cat-tools.stuck { border-bottom-color: var(--line); }
.search { position: relative; display: block; }
.search input { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); padding: 11px 16px 11px 42px; font-size: 16px; }
.search input:focus { outline: none; border-color: var(--tan); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Grupos ---------- */
.grupo { margin-top: 36px; scroll-margin-top: 150px; }
.grupo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.grupo-head h2 { font-family: var(--f-serif); font-weight: 500; font-size: clamp(32px, 8vw, 46px); line-height: 1; color: var(--brand); letter-spacing: -.01em; }
.grupo-head span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.grupo-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color .2s, box-shadow .2s; }
.card.in { border-color: var(--tan); box-shadow: 0 0 0 1.5px var(--tan); }
.card .ph { position: relative; aspect-ratio: 3 / 4; background: var(--sunk); border: 0; padding: 0; display: block; width: 100%; max-width: 100%; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .code { position: absolute; left: 8px; bottom: 8px; background: rgba(28,20,16,.6); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; backdrop-filter: blur(4px); font-variant-numeric: tabular-nums; }
.card .tick { position: absolute; right: 8px; top: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 12px; height: 26px; border-radius: 999px; display: grid; place-items: center; padding: 0 10px; }
.card .actions { padding: 10px; }
.add-btn { white-space: nowrap; width: 100%; border: 1.5px solid var(--brand); color: var(--brand); background: transparent; border-radius: 999px; padding: 9px 10px; font-weight: 700; font-size: 14px; }
.add-btn.added { background: var(--brand); color: var(--brand-ink); }
.empty-search { text-align: center; padding: 40px 16px; color: var(--muted); }
.foot { margin-top: 48px; padding: 22px 0 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }

/* ---------- Dock ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(to top, var(--bg) 70%, transparent); pointer-events: none; }
.dock-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; pointer-events: auto; }
.dock .btn { box-shadow: var(--shadow); flex: 1; justify-content: space-between; padding: 13px 20px; }
.dock .count { background: var(--brand-ink); color: var(--brand); border-radius: 999px; font-size: 13px; padding: 1px 9px; margin-right: 8px; }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,12,8,.5); z-index: 60; opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 92vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.sheet.show { transform: none; }
.sheet-grip { width: 40px; height: 5px; background: var(--line); border-radius: 4px; margin: 10px auto 8px; flex: none; }
.sheet-scroll { overflow-y: auto; padding: 0 20px 16px; display: grid; gap: 16px; }
.sheet-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sheet .close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 22px; line-height: 1; }
.sheet-photo { border-radius: var(--r); overflow: hidden; background: var(--sunk); max-width: 100%; display: grid; place-items: center; height: min(52vh, 460px); }
.sheet-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sheet-title h3 { font-size: 24px; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14.5px; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--bg); padding: 12px 14px; font-size: 16px; min-height: 48px; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--tan); outline: none; }
.field .err { color: var(--err); font-size: 13px; display: none; }
.field.invalid input, .field.invalid .sizes { border-color: var(--err); }
.field.invalid .err { display: block; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; border: 1.5px solid transparent; border-radius: var(--r-sm); }
.sizes button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.sizes button[aria-pressed="true"] { border-color: var(--brand); background: var(--blush); color: var(--brand); font-weight: 700; }

/* ---------- Pedido ---------- */
.lines { display: grid; gap: 12px; }
.line { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 14px; }
.line .th { width: 92px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--sunk); border: 0; padding: 0; }
.line .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-body { display: grid; gap: 10px; min-width: 0; align-content: start; }
.line-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.line h4 { font-size: 17px; font-variant-numeric: tabular-nums; }
.line .cat { font-size: 13px; color: var(--muted); }
.line .rm { background: none; border: 0; color: var(--err); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.line .field > label { font-size: 13px; }
.line .field select, .line .field textarea { padding: 10px 12px; font-size: 15px; min-height: 44px; }
.line .field textarea { min-height: 70px; }
.add-more { justify-self: start; }
.form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-top: 22px; }
.form h3 { font-size: 19px; }
.row2 { display: grid; gap: 18px; }
.send { margin-top: 22px; display: grid; gap: 10px; }
.send .hint { font-size: 13.5px; color: var(--muted); text-align: center; }
.empty { text-align: center; padding: 36px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); display: grid; gap: 12px; justify-items: center; }
.empty h3 { font-size: 22px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 80; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (min-width: 720px) {
  .hero { padding-top: 22px; }
  .grupo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .step { font-size: 12.5px; }
}
@media (min-width: 1000px) { .grupo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 380px) { .step .lbl { font-size: 10.5px; } .icon-btn { padding: 6px 9px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto !important; } }
