/* Marea: lino y café. Playfair cursiva (títulos), Cinzel (marca y etiquetas), Montserrat (texto). */
:root {
  --bg: #F5F0E8;
  --card: #E8DFD2;
  --paper: #FBF8F3;
  --ink: #4A3F35;
  --ink-2: #6B5B4E;
  --stone: #A89A8A;
  --sun: #C9B79C;
  --line: #DDD2C3;
  --wa: #4A3F35;
  --display: "Playfair Display", Georgia, serif;
  --caps: "Cinzel", Georgia, serif;
  --body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --radius: 4px;
  --shadow: 0 -10px 40px rgba(74, 63, 53, .14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--body); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 em, h2 em { font-style: italic; color: var(--ink-2); }
.eyebrow { font: 500 .72rem/1 var(--caps); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink);
  font: 500 .78rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-dark, .btn-wa { background: var(--ink); color: var(--paper); }
.btn-dark:hover, .btn-wa:hover { background: #3A3129; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Encabezado */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  height: 60px; padding: 0 var(--gutter);
  background: rgba(245, 240, 232, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 20px; height: 28px; }
.brand-name { font: 500 1rem/1 var(--caps); letter-spacing: .42em; margin-right: -.42em; }
.bag-btn {
  position: absolute; right: 6px; top: 6px; width: 48px; height: 48px;
  display: grid; place-items: center; background: none; border: 0;
}
.bag-btn svg { width: 24px; height: 24px; }
.bag-count {
  position: absolute; right: 6px; top: 8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--ink); color: var(--paper); font: 600 .65rem/18px var(--body); text-align: center;
}

/* Portada */
.hero { display: grid; gap: 28px; padding: 20px var(--gutter) 8px; max-width: 1120px; margin: 0 auto; }
.hero-arch {
  width: min(78vw, 420px); aspect-ratio: 4 / 5; margin: 0 auto;
  border-radius: 50% 50% var(--radius) var(--radius) / 40% 40% var(--radius) var(--radius);
  overflow: hidden; background: var(--card); padding: 10px;
}
.hero-arch img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.hero-text { text-align: center; }
.hero h1 { font-size: clamp(2rem, 8.4vw, 3.4rem); }
.hero h1 em { display: block; }
.lead { color: var(--ink-2); max-width: 34ch; margin: 14px auto 24px; }
@media (min-width: 820px) {
  .hero { grid-template-columns: 1fr 1fr; align-items: center; padding-top: 48px; gap: 56px; }
  .hero-text { text-align: left; order: -1; }
  .lead { margin-left: 0; }
}

.trust {
  list-style: none; margin: 28px auto 0; padding: 18px var(--gutter);
  display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap;
  border-block: 1px solid var(--line); max-width: 1120px;
  font: 500 .7rem/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: var(--stone); }

/* Catálogo */
.section-head { text-align: center; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
.catalog { padding: 56px 0 24px; max-width: 1120px; margin: 0 auto; }
.chips {
  position: sticky; top: 60px; z-index: 10; background: var(--bg);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px var(--gutter) 14px; scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chips { justify-content: center; } }
.chip {
  flex: none; scroll-snap-align: start; min-height: 38px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font: 500 .76rem/1 var(--body); letter-spacing: .06em; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip small { opacity: .65; margin-left: 4px; font-size: .9em; }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 10px;
  padding: 6px var(--gutter) 0;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 20px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-media { position: relative; }
.card-open { all: unset; cursor: pointer; display: block; border-radius: var(--radius); }
.card-open:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.card-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--card); border-radius: var(--radius); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .3s; }
.card-photo img + img { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
  .card:hover .card-photo img:first-child { transform: scale(1.03); }
  .card:hover .card-photo img + img { opacity: 1; }
}
.tag {
  position: absolute; left: 8px; top: 8px; padding: 5px 9px; border-radius: 999px;
  background: rgba(251, 248, 243, .92); font: 600 .6rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
}
.card-info { padding: 10px 2px 0; width: 100%; }
.card-name { font: 600 .86rem/1.35 var(--body); margin: 0; }
.card-stone { font-size: .74rem; color: var(--ink-2); margin: 2px 0 0; line-height: 1.35; }
.card-price { font: 400 1.05rem/1.2 var(--display); margin: 6px 0 0; }
.card-price small { font: 400 .72rem var(--body); color: var(--ink-2); }
.card-add {
  position: absolute; right: 8px; bottom: 8px;
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(251, 248, 243, .94); box-shadow: 0 2px 10px rgba(74, 63, 53, .12);
}
.card-add svg { width: 18px; height: 18px; }
.card.out .card-photo img { filter: grayscale(.85); opacity: .55; }
.card.out .card-name, .card.out .card-price { color: var(--ink-2); }
.card-ask { font: 500 .72rem var(--body); color: var(--ink-2); margin-top: 6px; display: inline-block; }
.note { text-align: center; font-size: .78rem; color: var(--ink-2); max-width: 46ch; margin: 34px auto 0; padding: 0 var(--gutter); }
.empty-grid { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 40px 0; }

/* Encargos */
.encargos {
  margin: 56px var(--gutter) 0; padding: 40px 22px; background: var(--card); border-radius: var(--radius);
  display: grid; gap: 26px; justify-items: center; text-align: center; max-width: 1088px;
}
@media (min-width: 1120px) { .encargos { margin-inline: auto; } }
.encargos-arch {
  position: relative; width: 170px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 50% 50% var(--radius) var(--radius) / 40% 40% var(--radius) var(--radius);
}
.encargos-arch img { width: 100%; height: 100%; object-fit: cover; }
.encargos-arch svg { position: absolute; inset: 0; margin: auto; width: 46px; height: 64px; }
.encargos h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
.encargos p:not(.eyebrow) { color: var(--ink-2); max-width: 38ch; margin: 12px auto 22px; }
@media (min-width: 720px) {
  .encargos { grid-template-columns: auto 1fr; text-align: left; padding: 48px; gap: 48px; justify-items: start; align-items: center; }
  .encargos p:not(.eyebrow) { margin-left: 0; }
}

/* Cómo comprar */
.steps { padding: 64px var(--gutter) 8px; max-width: 1120px; margin: 0 auto; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
@media (min-width: 720px) { .steps ol { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.steps li { text-align: center; padding: 6px 12px; }
.steps span { display: block; font: italic 400 2.6rem/1 var(--display); color: var(--sun); }
.steps b { display: block; font: 500 .9rem/1 var(--caps); letter-spacing: .22em; text-transform: uppercase; margin: 10px 0 6px; }
.steps p { margin: 0 auto; max-width: 28ch; color: var(--ink-2); font-size: .88rem; }

/* Info */
.info { max-width: 720px; margin: 48px auto 0; padding: 0 var(--gutter); }
.info details { border-top: 1px solid var(--line); }
.info details:last-child { border-bottom: 1px solid var(--line); }
.info summary {
  list-style: none; cursor: pointer; min-height: 54px; display: flex; align-items: center; justify-content: space-between;
  font: 500 .8rem/1 var(--caps); letter-spacing: .2em; text-transform: uppercase;
}
.info summary::-webkit-details-marker { display: none; }
.info summary::after { content: "+"; font: 300 1.3rem/1 var(--body); color: var(--ink-2); }
.info details[open] summary::after { content: "–"; }
.info p { margin: 0 0 18px; color: var(--ink-2); font-size: .9rem; white-space: pre-line; }

/* Pie */
.foot { text-align: center; padding: 56px var(--gutter) 120px; margin-top: 56px; background: var(--card); }
.foot-logo { width: 34px; height: 48px; margin: 0 auto 12px; }
.foot .brand-name { margin: 0 0 14px; display: inline-block; }
.foot-links { margin: 0; font-size: .86rem; }
.foot-links a { text-underline-offset: 4px; }
.foot-small { font-size: .74rem; color: var(--ink-2); margin: 10px 0 0; }

/* Barra fija del pedido */
.bag-bar {
  position: fixed; z-index: 30; left: var(--gutter); right: var(--gutter);
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px rgba(74, 63, 53, .3);
  font: 500 .78rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  max-width: 520px; margin: 0 auto;
}
.bag-bar b { font: 400 1.05rem/1 var(--display); letter-spacing: 0; text-transform: none; }

/* Hojas (producto y pedido) */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  background: var(--paper); color: var(--ink); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgba(43, 36, 30, .45); }
@media (min-width: 720px) { dialog.sheet { margin: auto; border-radius: 14px; max-height: 88dvh; } }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: up .28s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.sheet-close { position: sticky; top: 0; z-index: 2; height: 0; display: flex; justify-content: flex-end; }
.sheet-close button {
  margin: 10px 10px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(251, 248, 243, .92); display: grid; place-items: center;
}
.sheet-close svg { width: 20px; height: 20px; }
.sheet-body { padding: 20px 22px calc(28px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 1.75rem; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--card); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4 / 5; max-height: 58dvh; object-fit: cover; scroll-snap-align: center; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; min-height: 16px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink-2); }
.material { color: var(--ink-2); font-size: .86rem; margin: 4px 0 0; }
.price { font: 400 1.5rem/1.2 var(--display); margin: 10px 0 0; }
.desc { color: var(--ink); font-size: .9rem; margin: 12px 0 0; }
.variant { border: 0; margin: 18px 0 0; padding: 0; }
.variant legend, .label { font: 500 .7rem/1 var(--caps); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); padding: 0; margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-radio { position: relative; }
.pill-radio input { position: absolute; opacity: 0; inset: 0; }
.pill-radio span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: .84rem; cursor: pointer; white-space: nowrap;
}
.pill-radio input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pill-radio input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 20px; }
.qty-row .label { margin: 0; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; }
.qty svg { width: 16px; height: 16px; }
.qty output { min-width: 24px; text-align: center; font-weight: 600; }
.hint { font-size: .8rem; color: var(--ink-2); text-align: center; margin: 14px 0 0; }

/* Pedido */
.bag-list { list-style: none; margin: 18px 0 0; padding: 0; }
.bag-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bag-item img { width: 64px; height: 80px; object-fit: cover; border-radius: var(--radius); background: var(--card); }
.bag-item b { display: block; font-size: .86rem; font-weight: 600; line-height: 1.3; }
.bag-item small { display: block; color: var(--ink-2); font-size: .75rem; }
.bag-item .qty { margin-top: 6px; width: max-content; }
.bag-item .qty button { width: 32px; height: 32px; }
.bag-item .sub { font: 400 1rem var(--display); text-align: right; }
.bag-item .rm { border: 0; background: none; color: var(--ink-2); font-size: .72rem; text-decoration: underline; padding: 6px 0; display: block; margin-left: auto; }
.empty { color: var(--ink-2); text-align: center; padding: 26px 0; }
.order { display: grid; gap: 16px; margin-top: 18px; }
.order[hidden] { display: none; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 4px; }
.total span { font: 500 .74rem/1 var(--caps); letter-spacing: .22em; text-transform: uppercase; }
.total b { font: 400 1.5rem var(--display); }
.order > label { display: grid; gap: 6px; font: 500 .7rem/1 var(--caps); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.order input:not([type="radio"]), .order textarea {
  font: 400 1rem/1.4 var(--body); color: var(--ink); letter-spacing: 0; text-transform: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.order input:focus, .order textarea:focus { outline: none; border-color: var(--ink-2); }
.order fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.order legend { font: 500 .7rem/1 var(--caps); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; padding: 0; }
.small { font-size: .76rem; color: var(--ink-2); margin: 0; }
.center { text-align: center; }
.error { color: #8A3B2E; font-size: .84rem; margin: 0; }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 999px; font-size: .84rem; box-shadow: 0 8px 26px rgba(74, 63, 53, .16); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
