/* Catering by Pi
   Paleta sacada del propio roscón: azúcar, corteza tostada, naranja confitada,
   y el azul de la noche de Reyes para la sección especial. */

:root {
  --azucar: #fdfbf7;
  --miga: #f3ead9;
  --corteza: #3a2414;
  --corteza-suave: #75583f;
  --almendra: #e6d6bb;
  --naranja: #d9690b;
  --naranja-viva: #f08a1d;
  --noche: #18213b;
  --noche-texto: #f4ecdf;
  --noche-suave: #b9b3c4;

  --serif: "Young Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;

  /* Escala tipográfica (razón 1.25) */
  --t-0: 1rem;
  --t-1: 1.25rem;
  --t-2: 1.5625rem;
  --t-3: clamp(1.75rem, 1.2rem + 2vw, 2.45rem);
  --t-4: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);

  --gutter: clamp(1rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--azucar);
  color: var(--corteza);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; }
p { margin: 0; text-wrap: pretty; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--naranja); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--corteza); color: var(--azucar);
  padding: .5rem .9rem; z-index: 20;
}
.skip:focus { top: 1rem; }

/* ---------- Cabecera ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.4rem var(--gutter);
}
/* Logo provisional: la firma (propuesta 1). Se cambiará por la letra real de Pilar. */
.marca, .pie-marca {
  font-family: "Homemade Apple", var(--serif);
  text-decoration: none;
  position: relative;
  display: inline-block;
  line-height: 1.9;
  padding-bottom: .2em;
}
.marca::after, .pie-marca::after {
  content: ""; position: absolute; left: 12%; right: 4%; bottom: .05em; height: .38em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22' preserveAspectRatio='none'%3E%3Cpath d='M2 15 C 70 3, 170 3, 238 11' fill='none' stroke='%23d9690b' stroke-width='2.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.marca { font-size: 1.15rem; }
.top nav { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); font-size: .95rem; font-weight: 500; }
.top nav a { text-decoration: none; padding-block: .25rem; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s ease; }
.top nav a:hover { background-size: 100% 1px; }
.top nav .nav-especial { color: var(--naranja); }
.pagina-roscon .top { color: var(--noche-texto); }
.pagina-roscon .top nav .nav-especial { color: var(--naranja-viva); }

/* ---------- Portada ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100svh;
}
.hero-texto {
  align-self: end;
  padding: 8rem var(--gutter) clamp(3rem, 9vh, 6rem);
  max-width: 40rem;
}
.hero h1 { font-size: var(--t-4); letter-spacing: -.01em; text-wrap: balance; }
.hero-texto p { margin-top: 1.5rem; max-width: 30rem; font-size: var(--t-1); line-height: 1.5; color: var(--corteza-suave); }
.boton {
  display: inline-block; margin-top: 2.2rem;
  padding: .85rem 1.4rem;
  background: var(--corteza); color: var(--azucar);
  text-decoration: none; font-weight: 500; border-radius: 999px;
  transition: background-color .2s ease, transform .2s ease;
}
.boton:hover { background: var(--naranja); }
.boton:active { transform: scale(.97); }

.hero-foto { position: relative; overflow: hidden; }
.hero-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }

/* ---------- Roscón ---------- */
.roscon {
  background-color: var(--noche);
  /* Cielo de noche de Reyes: unas pocas estrellas */
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 34%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 86%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 22% 48%, #fff4 50%, transparent 51%);
  color: var(--noche-texto);
  overflow: clip;
}
.roscon-pin {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  min-height: 100svh;
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(4rem, 10vh, 7rem) var(--gutter);
}
.roscon-textos { display: grid; gap: 3rem; max-width: 32rem; position: relative; z-index: 1; }
.roscon h1 { font-size: var(--t-4); text-wrap: balance; }
.roscon h2 { font-size: var(--t-3); }
.paso p { margin-top: 1.1rem; font-size: var(--t-1); line-height: 1.5; color: var(--noche-suave); max-width: 27rem; }

.tamanos { list-style: none; margin: 1.6rem 0 0; padding: 0; display: flex; align-items: end; gap: clamp(1.2rem, 3vw, 2.4rem); }
.tamanos li { display: grid; justify-items: center; gap: .8rem; }
/* Cada tamaño se dibuja como un roscón visto desde arriba */
.tamanos li::before {
  content: ""; border-radius: 50%;
  width: var(--d); aspect-ratio: 1;
  border: calc(var(--d) * .3) solid #e9b46a;
  background: transparent;
  box-shadow: inset 0 0 0 1px #0002, 0 0 0 1px #0002;
}
.tamanos li:nth-child(1) { --d: 2.8rem; }
.tamanos li:nth-child(2) { --d: 3.8rem; }
.tamanos li:nth-child(3) { --d: 4.8rem; }
.t-nombre { font-weight: 500; font-size: var(--t-0); }

.roscon-escena {
  position: relative;
  justify-self: end;
  width: min(92vh, 52vw);
  aspect-ratio: 1;
  margin-right: calc(min(92vh, 52vw) * -0.18);
}
.roscon-escena::before {
  /* luz cálida detrás del roscón */
  content: ""; position: absolute; inset: -12%;
  background: radial-gradient(closest-side, #f08a1d33, transparent 70%);
}
.roscon-giro {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 2.5rem 3rem #0006);
  will-change: transform;
}

.roscon-fotos {
  background: var(--noche);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2vw, 1.5rem);
  padding: 0 var(--gutter) clamp(4rem, 10vh, 7rem);
}
.roscon-fotos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.pie a { color: var(--noche-texto); }

/* Con JS: los pasos se superponen y se van cambiando con el scroll */
.js-anim .roscon-textos { grid-template-areas: "paso"; }
.js-anim .paso { grid-area: paso; align-self: center; }

/* ---------- Historia ---------- */
.historia {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: clamp(5rem, 14vh, 9rem) var(--gutter);
}
.historia-foto img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.foto-pendiente {
  aspect-ratio: 4 / 5; display: grid; place-items: center;
  background: var(--miga); border: 1px dashed var(--almendra);
  color: var(--corteza-suave); font-size: .95rem; text-align: center; padding: 1rem;
}
.historia-texto { max-width: 36rem; }
.historia h2 { font-size: var(--t-3); margin-bottom: 1.8rem; text-wrap: balance; }
.historia-texto p + p { margin-top: 1.1rem; }
.historia-texto p:first-of-type::first-letter {
  font-family: var(--serif); color: var(--naranja);
  float: left; font-size: 3.6em; line-height: .9; padding: .06em .12em 0 0;
}

/* ---------- Galería (página aparte) ---------- */
.galeria-pagina { padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter) clamp(5rem, 12vh, 8rem); }
.galeria-cabecera { max-width: 42rem; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.galeria-cabecera h1 { font-size: var(--t-4); }
.galeria-cabecera p { margin-top: 1rem; font-size: var(--t-1); line-height: 1.5; color: var(--corteza-suave); }
.galeria-seccion + .galeria-seccion { margin-top: clamp(3rem, 8vh, 5rem); }
.galeria-seccion h2 {
  font-size: var(--t-3); margin-bottom: 1.4rem;
  padding-bottom: .8rem; border-bottom: 1px solid var(--almendra);
}
.top nav a[aria-current="page"]:not(.nav-presupuesto) { background-size: 100% 1px; }

.galeria { list-style: none; margin: 0; padding: 0; columns: 3 16rem; column-gap: clamp(.6rem, 1.5vw, 1rem); }
.galeria li { break-inside: avoid; margin-bottom: clamp(.6rem, 1.5vw, 1rem); }
.galeria-foto {
  display: block; width: 100%; padding: 0; border: 0; background: var(--miga);
  border-radius: 3px; overflow: hidden; cursor: zoom-in;
}
.galeria-foto img { width: 100%; height: auto; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.galeria-foto:hover img { transform: scale(1.03); }
.galeria-foto:focus-visible { outline-offset: 3px; }

.visor {
  padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; overflow: hidden;
}
.visor[open] { display: grid; place-items: center; }
.visor::backdrop { background: #120d08e6; }
.visor img { max-width: min(92vw, 1000px); max-height: 88vh; width: auto; height: auto; border-radius: 3px; }
.visor button {
  position: absolute; border: 0; background: #fdfbf71f; color: #fff;
  width: 3rem; height: 3rem; border-radius: 50%; font: 400 1.9rem/1 var(--sans); cursor: pointer;
  transition: background-color .2s ease;
}
.visor button:hover { background: #fdfbf740; }
.visor-cerrar { top: 1rem; right: 1rem; }
.visor-nav { top: 50%; translate: 0 -50%; }
.visor-ant { left: 1rem; }
.visor-sig { right: 1rem; }

/* ---------- Carta ---------- */
.carta {
  background: var(--miga);
  padding: clamp(5rem, 14vh, 9rem) var(--gutter);
}
.carta-cabecera { max-width: 40rem; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.carta h2 { font-size: var(--t-4); }
.carta-cabecera p { margin-top: 1rem; font-size: var(--t-1); color: var(--corteza-suave); }

.carta-grupos { columns: 3 18rem; column-gap: clamp(2rem, 5vw, 4.5rem); }
.grupo { break-inside: avoid; margin-bottom: 2.8rem; }
.grupo h3 {
  font-size: var(--t-2);
  padding-bottom: .7rem; margin-bottom: .8rem;
  border-bottom: 1px solid var(--almendra);
}
.grupo ul { list-style: none; margin: 0; padding: 0; }
.grupo li { padding: .32rem 0; line-height: 1.4; }

/* ---------- Pie ---------- */
.pie {
  background: var(--noche); color: var(--noche-suave);
  padding: 3.5rem var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; align-items: baseline;
}
.pie-marca { font-size: var(--t-1); color: var(--noche-texto); }

/* ---------- Enlace a presupuesto (todas las páginas) ---------- */
.top nav .nav-presupuesto {
  border: 1px solid currentColor; border-radius: 999px;
  padding: .3rem .85rem; margin-block: -.3rem;
  background: none; transition: background-color .2s ease, color .2s ease;
}
.top nav .nav-presupuesto:hover { background: var(--corteza); color: var(--azucar); }
.pagina-roscon .top nav .nav-presupuesto:hover { background: var(--noche-texto); color: var(--noche); }
.top nav .nav-presupuesto[aria-current="page"] { background: var(--corteza); color: var(--azucar); }

.carta-cta { margin-top: 1rem; }
.top nav .corto { display: none; }

/* En el inicio el menú cae sobre la foto: le damos un fondo para que se lea */
@media (min-width: 801px) {
  .pagina-inicio .top nav {
    align-items: center;
    background: #fdfbf7e0; backdrop-filter: blur(8px);
    padding: .45rem .5rem .45rem 1.2rem; border-radius: 999px;
  }
}

/* ---------- Haz tu presupuesto ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top--fijo { position: relative; border-bottom: 1px solid var(--almendra); background: var(--azucar); }

.presu { padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter) 5rem; }
.presu-cabecera { max-width: 50rem; margin-bottom: 2.5rem; }
.presu-cabecera p { max-width: 42rem; }
.presu-cabecera h1 { font-size: var(--t-4); }
.presu-cabecera p { margin-top: 1rem; font-size: var(--t-1); line-height: 1.5; color: var(--corteza-suave); }

.presu-cuerpo {
  display: grid; grid-template-columns: minmax(0, 1fr) 22rem;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}

.presu-herramientas {
  position: sticky; top: 0; z-index: 3;
  background: var(--azucar);
  padding: .9rem 0 .7rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--almendra);
}
.buscar input {
  width: 100%; font: inherit; color: inherit;
  padding: .7rem 1rem; border: 1px solid var(--almendra); border-radius: 999px;
  background: #fff;
}
.buscar input:focus-visible { outline: 2px solid var(--naranja); outline-offset: 1px; }
.grupos-nav {
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  margin-top: .7rem; padding-bottom: .1rem;
}
.grupos-nav::-webkit-scrollbar { display: none; }
.grupos-nav a {
  flex: none; font-size: .85rem; text-decoration: none; white-space: nowrap;
  padding: .3rem .75rem; border-radius: 999px; background: var(--miga);
  transition: background-color .2s ease;
}
.grupos-nav a:hover { background: var(--almendra); }

.presu-grupo { scroll-margin-top: 9rem; padding-top: 1.8rem; }
.presu-grupo h2 { font-size: var(--t-2); margin-bottom: .4rem; }
.presu-grupo ul { list-style: none; margin: 0; padding: 0; }

.plato {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem .6rem; margin-inline: -.6rem;
  border-bottom: 1px solid #efe5d3; border-radius: 4px;
  transition: background-color .2s ease;
}
.plato.elegido { background: var(--miga); }
.plato-info { display: grid; gap: .1rem; min-width: 0; }
.plato-nombre { line-height: 1.35; }
.plato-precio { font-size: .9rem; font-weight: 600; color: var(--corteza); font-variant-numeric: tabular-nums; }
.plato-u { font-weight: 400; color: var(--corteza-suave); }

.contador { display: flex; align-items: center; gap: .15rem; flex: none; }
.contador button {
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 1px solid var(--almendra); background: #fff; color: var(--corteza);
  font: 500 1.2rem/1 var(--sans); cursor: pointer;
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
.contador button:hover:not(:disabled) { background: var(--miga); }
.contador button:active:not(:disabled) { transform: scale(.92); }
.contador button:disabled { opacity: .35; cursor: default; }
.contador .mas { background: var(--corteza); border-color: var(--corteza); color: var(--azucar); }
.contador .mas:hover { background: var(--naranja) !important; border-color: var(--naranja); }
.num { min-width: 2rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.sin-resultados, .presu-estado { padding: 2rem 0; color: var(--corteza-suave); }

/* Resumen */
.resumen { position: sticky; top: 1.5rem; }
.resumen-barra { display: none; }
.resumen-detalle {
  background: #fff; border: 1px solid var(--almendra); border-radius: 6px;
  padding: 1.6rem 1.5rem;
}
.resumen h2 { font-size: var(--t-2); margin-bottom: 1rem; }
.resumen-vacio { color: var(--corteza-suave); }
.resumen-lineas { list-style: none; margin: 0; padding: 0; max-height: 45vh; overflow-y: auto; }
.resumen-lineas li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid #efe5d3; font-size: .92rem;
}
.l-cant { font-weight: 600; font-variant-numeric: tabular-nums; }
.l-precio { flex: none; font-variant-numeric: tabular-nums; }
.resumen-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 1rem; padding-top: .4rem;
}
.resumen-total strong { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); font-variant-numeric: tabular-nums; }
.resumen-nota { margin-top: .6rem; font-size: .85rem; color: var(--corteza-suave); }
.resumen-acciones { display: grid; gap: .6rem; margin-top: 1.4rem; }
.resumen-acciones .boton { margin: 0; text-align: center; border: 0; font: inherit; font-weight: 500; cursor: pointer; }
.boton--whatsapp { background: #1f7a4d; }
.boton--whatsapp:hover { background: #17603c; }
.boton-texto {
  justify-self: center; background: none; border: 0; padding: .4rem;
  font: inherit; font-size: .9rem; color: var(--corteza-suave); text-decoration: underline; cursor: pointer;
}
.resumen-aviso { margin-top: .6rem; font-size: .88rem; color: var(--naranja); min-height: 1.3em; }

/* ---------- Móvil ---------- */
@media (max-width: 800px) {
  .top { padding-block: 1rem; }
  .top nav { gap: .9rem; font-size: .9rem; }
  .top .marca { font-size: .95rem; white-space: nowrap; }
  .top nav a { white-space: nowrap; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-foto { order: -1; height: 62svh; }
  .hero-texto { padding: 2.2rem var(--gutter) 3.5rem; }
  .top { color: var(--azucar); text-shadow: 0 1px 12px #0007; }

  .roscon-pin { grid-template-columns: 1fr; padding: 4rem var(--gutter); gap: 2.5rem; }
  .roscon-escena { order: -1; justify-self: center; width: min(82vw, 30rem, 46svh); margin: 0; }
  .js-anim .roscon-textos { min-height: 15rem; align-content: start; }
  .js-anim .paso { align-self: start; }

  .roscon-fotos { grid-template-columns: 1fr; padding-top: 0; }

  .top nav .nav-opcional { display: none; }
  .pagina-inicio .top nav .nav-especial { color: #ffc07a; }
  .top--fijo { color: var(--corteza); text-shadow: none; }

  .presu-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .presu { padding-bottom: 7rem; }
  .resumen {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 15;
    background: var(--azucar); border-top: 1px solid var(--almendra);
    box-shadow: 0 -8px 24px #3a24141a;
  }
  .resumen-barra {
    display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 1rem var(--gutter); border: 0; background: none; color: inherit;
    font: inherit; font-size: .95rem; cursor: pointer; text-align: left;
  }
  .resumen-barra strong { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; }
  .resumen.con-cosas .resumen-barra { background: var(--corteza); color: var(--azucar); }
  .resumen-barra::after { content: "▴"; margin-left: .5rem; transition: transform .2s ease; }
  .resumen.abierto .resumen-barra::after { transform: rotate(180deg); }
  .resumen-detalle { display: none; border: 0; border-radius: 0; max-height: 70svh; overflow-y: auto; padding: 1.2rem var(--gutter) 1.5rem; }
  .resumen.abierto .resumen-detalle { display: block; }
  .resumen-lineas { max-height: none; }
  .pagina-roscon .top { text-shadow: none; }
  .historia { grid-template-columns: 1fr; }
  .galeria { columns: 2; }
  .visor-nav { top: auto; bottom: 1.5rem; translate: none; }
  .historia-foto { max-width: 26rem; }
}

@media (max-width: 520px) {
  .top nav .largo { display: none; }
  .top nav .corto { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
