/* Dulzuras Adam's — tokens del design system (tema oscuro).
   https://claude.ai/artifact/Dm7R5QhpjZmVfDZ3FwEdax */
:root {
  color-scheme: dark;
  /* color */
  --ciruela: #2a0c28;        /* fondo del logo */
  --ciruela-700: #4a1d45;
  --on-ciruela: #f7eef4;
  --ciruela-500: #5e2a57;      /* hover de botones claros e íconos sobre ciruela-700 */
  --on-ciruela-muted: #d9bfd1; /* texto secundario sobre ciruela-700 (7.9:1) */
  --surface: #1a0818;
  --surface-raised: #2a0c28;
  --ink: #f7eef4;
  --ink-muted: #c4a9bd;
  --line: #4a2a46;
  --rosa: #e58aa6;
  --on-rosa: #2a0c28;
  --rosa-tint: #3a1534;
  --whatsapp: #4ade80;
  --on-whatsapp: #2a0c28;
  --focus: var(--rosa);
  /* tipografía */
  --font-caps: "Cinzel", Georgia, serif;
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* espaciado y forma */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius-sm: 12px; --radius-md: 18px; --radius-lg: 24px; --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--surface); }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 max(var(--space-4), env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
}

/* Encabezado: banda ciruela del mismo tono que el logo, así la imagen se funde */
.profile {
  text-align: center;
  margin: 0 calc(-1 * max(var(--space-4), env(safe-area-inset-left))) var(--space-6);
  padding: calc(48px + env(safe-area-inset-top)) var(--space-4) var(--space-5);
  background: var(--ciruela);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.logo { margin: 0 auto; width: 290px; max-width: 82%; }
.logo img { width: 100%; height: auto; }
.bio { margin: var(--space-5) 0 0; font-size: .95rem; color: var(--ink-muted); white-space: pre-line; }
.socials { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-4); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ciruela-700); color: var(--on-ciruela);
}
.icon-btn:active { transform: scale(.96); }

.section-title {
  font: 600 .75rem/1.3 var(--font-caps);
  letter-spacing: .18em; text-transform: uppercase;
  text-align: center; margin: 0 0 var(--space-4); color: var(--rosa);
}

/* Lista estilo link-in-bio */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.link {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2); min-height: 72px;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.link:hover { border-color: var(--rosa); }
.link:active { transform: scale(.985); }
.link:focus-visible, .chip:focus-visible, .wa-btn:focus-visible, .icon-btn:focus-visible, .sheet__close:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.link__thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex: none; background: var(--rosa-tint); }
.link__mono {
  display: grid; place-items: center; background: var(--ciruela-700); color: var(--rosa);
  font: 600 1.5rem/1 var(--font-caps);
}
.link__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link__text strong { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.link__text small { color: var(--ink-muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--rosa); font-size: 1.6rem; line-height: 1; }
/* Portada (propuesta C): catálogo destacado con fotos + dos botones claros */
#view-home { display: grid; gap: var(--space-3); }
.hero-card {
  display: block; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--ciruela-700); color: var(--on-ciruela);
  transition: transform .12s ease, background-color .12s ease;
}
.hero-card:hover { background: var(--ciruela-500); }
.hero-card:active { transform: scale(.985); }
.hero-card__strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.hero-slot { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--rosa-tint); }
.hero-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; }
.hero-slot img.is-entering { opacity: 0; }
.hero-card__cap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 14px var(--space-4) var(--space-4) 18px; }
.hero-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-card__text strong { font: 600 1.375rem/1.2 var(--font-caps); }
.hero-card__text small { color: var(--on-ciruela-muted); font-size: .9rem; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tile {
  font: inherit; text-align: left; border: 0; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--ciruela-700); color: var(--on-ciruela);
  transition: transform .12s ease, background-color .12s ease;
}
.tile:hover { background: var(--ciruela-500); }
.tile:active { transform: scale(.97); }
.tile strong { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.tile small { color: var(--on-ciruela-muted); font-size: .8125rem; line-height: 1.35; }
.tile__icon {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ciruela-500); color: var(--rosa); margin-bottom: var(--space-2);
}
.hero-card:focus-visible, .tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Barra del catálogo */
#view-catalogo { scroll-margin-top: var(--space-4); }
.view__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.view__bar .section-title { margin: 0; }
.catalog { display: grid; gap: var(--space-6); }
.cat-section { scroll-margin-top: var(--space-4); }
.cat-section__title {
  display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3);
  font: 600 .8125rem/1.3 var(--font-caps); letter-spacing: .16em; text-transform: uppercase; color: var(--rosa);
}
.cat-section__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cat-jump { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-bottom: var(--space-5); }
.cat-jump__btn {
  min-height: 44px; border: 0; border-radius: var(--radius-pill); background: var(--ciruela-700); color: var(--on-ciruela);
  font: 600 .8125rem/1 var(--font-caps); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.cat-jump__btn:hover { background: var(--ciruela-500); }
.cat-jump__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.back { color: var(--rosa); font-weight: 600; font-size: .95rem; padding: var(--space-2) 0; min-width: 72px; }
.back--spacer { visibility: hidden; text-align: right; }
.back:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.link--plain { margin-top: var(--space-3); padding-left: var(--space-4); background: transparent; box-shadow: none; border-style: dashed; }

.info { margin-top: var(--space-6); text-align: center; font-size: .9rem; color: var(--ink-muted); }
.info p { margin: var(--space-1) 0; }
.info strong { color: var(--ink); font-weight: 600; }
.muted { color: var(--ink-muted); }

/* Hoja de pedido (bottom sheet) */
dialog {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 520px;
  max-height: 94dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-raised); color: var(--ink);
}
dialog::backdrop { background: rgba(10, 2, 9, .7); }
dialog[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { dialog { margin: auto; border-radius: var(--radius-lg); } }
.sheet { display: flex; flex-direction: column; max-height: 94dvh; position: relative; overflow-y: auto; overscroll-behavior: contain; }
.sheet > * { flex: none; }
.sheet__grab { width: 40px; height: 4px; border-radius: 4px; background: rgba(247, 238, 244, .55); margin: 8px auto; position: absolute; left: 0; right: 0; z-index: 2; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(26, 8, 24, .8); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}

.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--rosa-tint);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: auto; max-height: min(44dvh, 400px); aspect-ratio: var(--gallery-ratio, 3 / 4); object-fit: cover; scroll-snap-align: center; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.dots span.on { background: var(--rosa); width: 16px; border-radius: 4px; }

.sheet__body { padding: var(--space-2) var(--space-5); }
.sheet__body--top { padding-top: 44px; }
.sheet__grab--dark { background: var(--line); }
.sheet__body h2 { font: 600 1.375rem/1.3 var(--font-caps); margin: var(--space-1) 0 2px; text-wrap: balance; }
.sheet__body > .muted { margin: 0 0 var(--space-4); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--space-4); }
legend, .field > span { font-weight: 600; font-size: .9rem; margin-bottom: var(--space-2); display: block; padding: 0; }
.field em { font-weight: 400; color: var(--ink-muted); font-style: normal; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-pill);
  padding: 9px 16px; font: 500 .95rem var(--font-sans); cursor: pointer; min-height: 42px;
}
.chip:hover { border-color: var(--rosa); }
.chip[aria-pressed="true"] { background: var(--rosa); border-color: var(--rosa); color: var(--on-rosa); font-weight: 600; }
.extras { display: grid; gap: var(--space-3); }
.extra { padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.extra .chip:not([aria-pressed="true"]) { background: var(--surface-raised); }
.extra__name { margin: 0 0 var(--space-2); font-weight: 600; font-size: .95rem; }
.legend-hint { font-weight: 400; color: var(--ink-muted); font-style: normal; }
.size-items__title { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.size-items__lead { display: block; color: var(--ink); margin-bottom: var(--space-1); }
.size-items__note { display: inline-block; margin-top: var(--space-2); padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--rosa); color: var(--on-rosa); font-weight: 600; font-size: .8125rem; }
.size-items { list-style: none; margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; color: var(--ink); }
.size-detail { margin: var(--space-2) 0 0; font-size: .875rem; color: var(--ink-muted); min-height: 1.2em; }
.field { display: block; margin-bottom: var(--space-4); }
.field input, .field textarea {
  width: 100%; font: 16px/1.4 var(--font-sans); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); opacity: .8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--rosa); }
.field textarea { resize: vertical; }

.sheet__cta {
  position: sticky; bottom: 0; padding: var(--space-3) var(--space-5) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface-raised) 75%, rgba(42, 12, 40, 0));
}
.wa-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; border: 0; border-radius: var(--radius-pill); background: var(--whatsapp); color: var(--on-whatsapp);
  font: 600 1.0625rem var(--font-sans); cursor: pointer;
}
.wa-btn:active { transform: scale(.985); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Selector de modo mayorista: dos opciones lado a lado */
#may-mode { display: grid; grid-template-columns: 1fr 1fr; }
#may-mode .chip { text-align: center; padding-inline: 8px; }

/* Aviso al superar el máximo de opciones */
.pick-msg {
  position: sticky; bottom: 84px; z-index: 3; margin: 0 var(--space-5); padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--rosa); color: var(--on-rosa); font-weight: 600; font-size: .9rem; text-align: center;
}

/* Relleno libre */
.chip--other { border-style: dashed; }
.filling-other { margin: var(--space-3) 0 0; }

/* Promo del mes: tarjeta destacada arriba del catálogo */
.promo-list { margin-bottom: var(--space-4); }
.promo-list:empty { display: none; }
.link--promo { background: var(--rosa); border-color: var(--rosa); color: var(--on-rosa); box-shadow: 0 4px 18px rgba(229, 138, 166, .25); }
.link--promo:hover { border-color: var(--on-rosa); }
.link--promo .link__text strong { font: 600 1.05rem/1.25 var(--font-caps); letter-spacing: .04em; }
.link--promo .link__text small { color: var(--on-rosa); opacity: .85; }
.link--promo .chev { color: var(--on-rosa); }
.link--promo .link__mono { background: var(--on-rosa); color: var(--rosa); font-family: var(--font-sans); }

/* Catálogo no disponible */
.catalog-error { text-align: center; color: var(--ink-muted); margin: var(--space-4) 0; }

/* Fecha chica en las tarjetas del catálogo festivo */
.link__date { font: 600 .6875rem/1.2 var(--font-caps); letter-spacing: .12em; text-transform: uppercase; color: var(--rosa); margin-bottom: 1px; }

/* Dirección en el inicio */
.address {
  display: inline-flex; align-items: center; gap: 8px; margin-top: var(--space-3); padding: 6px 14px;
  border-radius: var(--radius-pill); color: var(--on-ciruela-muted); font-size: .875rem; line-height: 1.35;
  text-decoration: none; max-width: 100%;
}
.address svg { flex: none; color: var(--rosa); }
.address > span { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.address > span > span { text-decoration: underline; text-decoration-color: rgba(229, 138, 166, .5); text-underline-offset: 3px; }
.address > span > small { font-size: .8125rem; opacity: .85; }
.address:hover { background: var(--ciruela-700); }
.address:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Fotos de un grupo para elegir (ej. Budines de la promo) */
.extra__photos { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 0 var(--space-3); padding-bottom: 2px; }
.extra__photos img { flex: none; height: 132px; width: auto; max-width: 80%; object-fit: cover; border-radius: var(--radius-sm); scroll-snap-align: start; background: var(--surface-raised); }

/* ── Mi pedido (carrito) ── */
.sheet__cta--two { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
.sheet__cta--two > button { white-space: nowrap; }
@media (min-width: 440px) { .sheet__cta--two { grid-template-columns: 1fr 1fr; } }
.add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 12px;
  border: 0; border-radius: var(--radius-pill); background: var(--rosa); color: var(--on-rosa);
  font: 600 1rem var(--font-sans); cursor: pointer;
}
.sheet__cta--two .wa-btn { font-size: 1rem; padding: 0 12px; }
.add-btn:active { transform: scale(.985); }
.add-btn:focus-visible, .cart-bar:focus-visible, .text-btn:focus-visible, .cart-item__remove:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

.cart-bar {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(488px, calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))));
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px;
  border: 0; border-radius: var(--radius-pill); background: var(--rosa); color: var(--on-rosa);
  font: 600 1.0625rem var(--font-sans); cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.cart-bar__count {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  background: var(--on-rosa); color: var(--rosa); font-size: .875rem; font-variant-numeric: tabular-nums;
}
body.has-cart .page { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

.toast {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  margin: 0; padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--ciruela); font-weight: 600; font-size: .9375rem; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}

.cart-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); counter-reset: item; }
.cart-item { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.cart-item__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.cart-item__head strong { font-weight: 600; font-size: 1rem; }
.cart-item__head strong::before { counter-increment: item; content: counter(item) ". "; color: var(--rosa); }
.cart-item ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; color: var(--ink-muted); font-size: .875rem; }
.cart-item__remove {
  flex: none; border: 0; background: none; color: var(--rosa); font: 600 .875rem var(--font-sans);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0;
}
.cart-actions { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.text-btn { border: 0; background: none; color: var(--rosa); font: 600 .9375rem var(--font-sans); cursor: pointer; padding: 8px 0; }
.text-btn--muted { color: var(--ink-muted); font-weight: 500; }
.wa-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Mi pedido: datos de quien pide */
.cart-who { border-top: 1px solid var(--line); padding-top: var(--space-4); margin-bottom: var(--space-2); }
.cart-who__title { margin: 0 0 var(--space-3); font: 600 1rem/1.3 var(--font-sans); }
.cart-delivery { margin-bottom: var(--space-4); }

/* Imagen de referencia */
.ref-field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: var(--space-2); }
.ref-field em { font-weight: 400; color: var(--ink-muted); font-style: normal; }
.ref-pick { position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 16px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--rosa); font-weight: 600; cursor: pointer;
}
.ref-pick:hover { border-color: var(--rosa); }
.ref-pick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.ref-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ref-preview {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: var(--space-3);
  padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.ref-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--rosa-tint); }
.ref-status { font-size: .875rem; color: var(--ink-muted); min-width: 0; }
.add-btn:disabled { opacity: .5; cursor: progress; }
