/* Layout: one column of full-width bands; the brand's cow label, ringed by turning gold rays, anchors the hero. */
:root {
  --milk: #fbf7ee;        /* page background, the cream white of the cheese slice */
  --surface: #ffffff;
  --ink: #241800;         /* logo script black-brown */
  --muted: #6b5c45;
  --line: #e9dfcb;
  --sun: #fcb43c;         /* brand gold (logo ring, outline and sunflowers) */
  --sun-deep: #8a6118;    /* darker gold, readable as text on light backgrounds */
  --on-sun: #241800;
  --band: #241800;
  --on-band: #fbf3e2;
  --label: #fffdf8;       /* paper behind the logo art, same in both themes */
  --whatsapp: #1c8f4b;
  --on-whatsapp: #ffffff;
  --danger: #b3261e;
  --shadow: 0 10px 30px rgb(36 24 0 / 0.12);

  --font-display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 4vw, 2.6rem);
  --step-4: clamp(2.4rem, 7vw, 4.4rem);
  --radius: 14px;
  --max: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
--milk: #16110a;
    --surface: #221a10;
    --ink: #f8f0e0;
    --muted: #c4b59b;
    --line: #3a2e1d;
    --sun: #fcb43c;
    --sun-deep: #fcb43c;
    --on-sun: #241800;
    --band: #221a10;
    --on-band: #f8f0e0;
    --label: #fffdf8;
    --whatsapp: #25a35a;
    --on-whatsapp: #ffffff;
    --danger: #ff8a80;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
--milk: #16110a;
  --surface: #221a10;
  --ink: #f8f0e0;
  --muted: #c4b59b;
  --line: #3a2e1d;
  --sun: #fcb43c;
  --sun-deep: #fcb43c;
  --on-sun: #241800;
  --band: #221a10;
  --on-band: #f8f0e0;
  --label: #fffdf8;
  --whatsapp: #25a35a;
  --on-whatsapp: #ffffff;
  --danger: #ff8a80;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--milk);
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.demo {
  background: var(--sun);
  color: var(--on-sun);
  text-align: center;
  font-size: var(--step--1);
  font-weight: 600;
  padding-block: 0.4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--milk) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-logo { width: 2.6rem; height: auto; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  line-height: 1;
  display: flex;
  flex-direction: column;
}
.brand-name small {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav { display: flex; gap: 1.25rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.lang {
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  background: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}
.lang .lang-short { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .header-wa { margin-left: auto; }
  .header-inner { gap: 0.6rem; }
  .brand { gap: 0.45rem; }
  .brand-logo { width: 2.2rem; }
  .brand-name { font-size: 1.05rem; white-space: nowrap; }
  .header-wa { padding: 0.4rem 0.75rem; }
  .lang { padding: 0.35rem 0.6rem; }
  .lang .lang-long { display: none; }
  .lang .lang-short { display: inline; }
}
@media (max-width: 389px) {
  .brand-name { display: none; }
}

/* Hero */
.hero { overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}
.hero-copy { display: grid; gap: 1.1rem; min-width: 0; }
.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sun-deep);
}
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.02em; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 34ch; }
.hero-note { font-size: var(--step--1); color: var(--muted); max-width: 44ch; }
.hero-points { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0; list-style: none; font-weight: 600; }
.hero-points li { display: flex; align-items: center; gap: 0.45rem; }
.hero-points li::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--sun); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-sun-slot {
  width: 100%;
  max-width: 26rem;
  aspect-ratio: 1;
  justify-self: center;
}
.hero-sun {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
/* With JavaScript the sun becomes a backdrop fixed in the middle of the screen.
   Its rays always turn; scrolling adds extra turn on top (--scroll-turn, set in app.js).
   At the top of the page the logo shows in full on the first screen, with the hero text
   peeking below it; scrolling fades it to the faint backdrop (opacity set in app.js). */
.sun-float .hero-sun-slot { position: absolute; width: 0; height: 0; }
.sun-float .hero-inner {
  grid-template-columns: minmax(0, 1fr);
  padding-top: calc(100svh - 11rem);
}
.sun-float .hero-sun {
  position: fixed;
  top: calc(50% + 1.5rem);
  left: 50%;
  width: min(84vw, 68vh);
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0.14;
  pointer-events: none;
}
.sun-float .hero-sun span { animation-duration: 40s; transform: rotate(var(--scroll-turn, 0deg)); }
.sun-float main .wrap,
.sun-float .site-footer .wrap { position: relative; z-index: 1; }
/* Rays: thin gold wedges cut into a ring around the logo label, slowly turning. */
.hero-sun span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--sun) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 81% 100%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 80%, #000 81% 100%, transparent 100%);
  animation: turn 120s linear infinite;
}
.hero-label {
  position: absolute;
  inset: 11%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--label);
  box-shadow: var(--shadow);
}
.hero-label img { width: 68%; height: auto; }
@keyframes turn { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) { .hero-sun span { animation: none; } }
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-sun-slot { order: -1; max-width: 15rem; justify-self: center; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--milk); }
.btn-whatsapp { background: var(--whatsapp); color: var(--on-whatsapp); width: 100%; }
.header-wa { width: auto; padding: 0.4rem 0.95rem; font-size: var(--step--1); }
.icon-btn.theme-toggle { width: 2.2rem; height: 2.2rem; flex: none; font-size: 1rem; line-height: 1; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { display: grid; gap: 0.5rem; margin-bottom: 1.75rem; max-width: 40rem; }
.section-head h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.01em; }
.section-head p { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.cake-note { max-width: 65ch; margin-top: 1.25rem; padding: 0.75rem 1rem; border-left: 4px solid var(--sun); background: var(--surface); color: var(--muted); font-size: var(--step--1); }
.reference { display: grid; gap: 0.35rem; }
.chip {
  font: inherit;
  font-weight: 600;
  font-size: var(--step--1);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--milk); border-color: var(--ink); }

/* Product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card.is-sold-out { opacity: 0.6; }
.card-photo { width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.slideshow { position: relative; overflow: hidden; background: var(--line); }
.slideshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.slideshow img.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slideshow img { transition: none; } }
.placeholder {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
}
.placeholder-quesos {
  background:
    radial-gradient(circle at 22% 30%, var(--milk) 0 7%, transparent 8%),
    radial-gradient(circle at 70% 65%, var(--milk) 0 5%, transparent 6%),
    radial-gradient(circle at 80% 22%, var(--milk) 0 4%, transparent 5%),
    var(--sun);
  color: var(--on-sun);
}
.placeholder-tortas {
  background: repeating-linear-gradient(180deg, var(--band) 0 18%, var(--sun) 18% 22%);
  color: var(--on-band);
}
.card-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem 1.1rem 1.1rem; flex: 1; min-width: 0; }
.card-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sun-deep);
}
.card-title { font-size: var(--step-1); font-weight: 700; }
.card-text { color: var(--muted); font-size: 0.95rem; }
.card-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.card-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.card-price.is-quote { font-weight: 500; color: var(--muted); font-size: var(--step--1); }
.btn-add { background: var(--sun); color: var(--on-sun); padding: 0.5rem 1.1rem; }
.btn-add[aria-pressed="true"] { background: var(--ink); color: var(--milk); }
.btn-add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* Cake prices */
.prices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.price-table { width: 100%; max-width: 46rem; border-collapse: collapse; }
.price-table th, .price-table td { text-align: left; padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-table thead th { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sun-deep); }
.price-table tbody th { font-weight: 500; }
.price-table td { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); white-space: nowrap; text-align: right; padding-right: 0; }
.price-table thead th:last-child { text-align: right; padding-right: 0; }
.price-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem 2rem; margin: 0; max-width: 60rem; }
.price-facts dt { font-family: var(--font-display); font-weight: 700; color: var(--sun-deep); }
.price-facts dd { margin: 0.25rem 0 0; color: var(--muted); }

/* Cheese guide band */
.section-band { background: var(--band); color: var(--on-band); }
.section-band .section-head p { color: color-mix(in srgb, var(--on-band) 75%, transparent); }
.table-scroll { overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: var(--step-1); }
.guide-table th, .guide-table td {
  text-align: left;
  padding: 0.9rem 1rem 0.9rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--on-band) 20%, transparent);
  vertical-align: top;
}
.guide-table thead th {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sun);
}
.guide-table tbody th { font-family: var(--font-display); font-weight: 700; white-space: nowrap; color: var(--sun); }

/* Steps */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
}
.steps li { counter-increment: step; display: grid; gap: 0.4rem; min-width: 0; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--sun-deep);
}
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding-block: 1rem; max-width: 46rem; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq details p { color: var(--muted); padding-top: 0.6rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem 6rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; color: var(--muted); font-size: 0.95rem; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--ink); }

/* Floating cart button */
.cart-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--milk);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.1rem 0.8rem 1.3rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.cart-count {
  min-width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sun);
  color: var(--on-sun);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.cart-fab.bump { animation: bump 0.35s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .cart-fab.bump { animation: none; } }

/* Cart dialog */
.cart {
  width: min(30rem, 100vw);
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  border: 0;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px)) calc(1.25rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
  background: var(--milk);
  color: var(--ink);
  overflow-y: auto;
}
.cart::backdrop { background: rgb(22 17 10 / 0.6); }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cart-head h2 { font-size: var(--step-2); font-weight: 800; }
.icon-btn {
  font: inherit;
  font-size: 1.1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.cart-empty { color: var(--muted); }
.lines { list-style: none; margin: 0; padding: 0; display: grid; }
.line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.line-name { font-weight: 600; }
.line-price { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 0.4rem; }
.step {
  font: inherit;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.step-qty { min-width: 3.2rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.line-remove, .link-btn {
  font: inherit;
  font-size: var(--step--1);
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  justify-self: start;
}
.cart-total { font-weight: 700; padding-block: 1rem; font-variant-numeric: tabular-nums; }

.order-form { display: grid; gap: 0.9rem; }
.order-form label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.order-form input:not([type="radio"]), .order-form textarea {
  font: inherit;
  font-weight: 400;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.order-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.order-form legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.order-form .radio { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.field-error { color: var(--danger); font-size: var(--step--1); font-weight: 600; }
.form-hint { color: var(--muted); font-size: var(--step--1); text-align: center; }

/* Gallery */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 45%), 1fr));
  gap: 0.75rem;
}
.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--line);
  cursor: zoom-in;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.gallery-more { margin-top: 1.25rem; font-weight: 600; }
.gallery-more a { color: var(--ink); }

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border: 0;
  padding: calc(3.5rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  background: rgb(22 17 10 / 0.94);
  color: #fbf3e2;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(22 17 10 / 0.6); }
.lightbox-figure { margin: 0; display: grid; gap: 0.75rem; justify-items: center; max-height: 100%; }
.lightbox-figure img {
  max-width: min(100%, 60rem);
  max-height: calc(100dvh - 9rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  width: auto;
  height: auto;
  border-radius: var(--radius);
}
.lightbox-figure figcaption { text-align: center; max-width: 40ch; }
.lightbox-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox-prev { left: max(0.5rem, env(safe-area-inset-left, 0px)); }
.lightbox-next { right: max(0.5rem, env(safe-area-inset-right, 0px)); }
@media (prefers-reduced-motion: reduce) { .gallery-item img { transition: none; } }
