/* 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); }
.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-card__strip img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--rosa-tint); }
.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; }
.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: min(44dvh, 400px); 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-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; }
