/* ==========================================================================
   EGEO · Landing
   Paleta y tipografías según EGEO_Manual_de_Marca_v2_1.html
   ========================================================================== */

/* --- Tipografías self-hosted (variable fonts, subset latin) --------------- */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens -------------------------------------------------------------- */

:root {
  --blue: #293A66;
  --blue-dark: #1A2640;
  --ink: #1C2740;
  --gold: #C9A97A;
  --gold-deep: #A8854F;
  --cream: #F5EFE2;
  --cream-panel: #FDFBF6;
  --line-panel: #EBE3D2;
  --grey: #6B7A8D;
  --grey-soft: #9AA6B5;

  --rule: rgba(41, 58, 102, 0.22);
  --rule-soft: rgba(41, 58, 102, 0.14);
  --rule-input: rgba(41, 58, 102, 0.25);
  --rule-step: rgba(41, 58, 102, 0.35);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Raleway', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  /* clip y no hidden: hidden en body se propaga al viewport y deja de contener el
     desborde lateral de los hijos, así que igual aparecía scroll en X. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(201, 169, 122, 0.28);
  color: var(--blue-dark);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  to { opacity: 0; }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  /* Se ve si la foto todavía no está o falla la carga. */
  background: linear-gradient(160deg, #FBF8F1 0%, var(--cream) 45%, #E8DFCC 100%);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media picture {
  display: block;
  height: 100%;
}

.hero-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-wrap {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(26px, 4.5vh, 44px);
  padding: 24px clamp(24px, 7vw, 110px);
  text-align: left;
}

.hero-group {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 40px);
  width: fit-content;
}

/* Contenedor de referencia del wordmark. Va acá y no en .hero-group porque ese es
   fit-content y el containment inline le rompería el cálculo del ancho. */
.brand {
  container-type: inline-size;
  animation: fadeUp 1s var(--ease-out) 0.1s both;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
}

/* El wordmark llena exactamente el ancho del contenedor. El ancho del texto es
   k * font-size + 3 * letter-spacing, con k = 2.5411 para Cormorant Garamond 300;
   con ambos valores en cqw eso queda clavado en 100cqw a cualquier tamaño.
   Si cambia la tipografía o el peso hay que recalibrar: medir el ancho de EGEO a
   letter-spacing 0 para sacar k, y despejar a en k * a + 3 * (0.1714 * a) = 1
   (0.1714 es la proporción letter-spacing / font-size del diseño). */
.wordmark {
  margin: 0;
  /* Compensa el letter-spacing sobrante después de la última O. */
  margin-right: -5.61cqw;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 32.73cqw;
  letter-spacing: 5.61cqw;
  line-height: 0.95;
  color: var(--blue);
}

.lede {
  margin: 0;
  /* .hero-group es fit-content: sin el width: 0 el párrafo aportaría su ancho en
     una sola línea al cálculo y estiraría todo el bloque. Así el ancho lo sigue
     fijando el wordmark y el texto se acomoda a ese contenedor. */
  width: 0;
  min-width: 100%;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--grey);
  text-wrap: pretty;
  animation: fadeUp 1.05s var(--ease-out) 0.22s both;
}

.hero-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(20px, 3.2vh, 30px);
  animation: fadeUp 1.1s var(--ease-out) 0.35s both;
}

/* --- Productos ----------------------------------------------------------- */

/* Grid y no flex: las tres columnas miden lo mismo aunque los nombres tengan
   largos distintos, así las reglas de arriba quedan parejas. */
.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(10px, 1.6vw, 22px) 12px;
  border-top: 0.5px solid var(--rule);
}

.product-icon {
  height: 36px;
  display: flex;
  align-items: flex-end;
}

.product-name {
  font-family: var(--serif);
  font-size: clamp(18px, 2.3vh, 21px);
  font-weight: 400;
  letter-spacing: 2.5px;
  color: var(--blue);
}

.product-weight {
  margin-top: -6px;
  font-size: clamp(13px, 1.8vh, 15px);
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--blue);
}

.product-tag {
  margin-top: -8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* --- Botón principal ----------------------------------------------------- */

.cta {
  display: block;
  width: 100%;
  padding: 17px 38px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: var(--cream);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(41, 58, 102, 0.22);
  transition: background 0.35s ease, transform 0.35s ease;
}

.cta:hover {
  background: var(--blue-dark);
  color: var(--cream);
  transform: translateY(-2px);
}

.cta:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* --- Pie del hero -------------------------------------------------------- */

.place {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(2.5svh, 16px);
  z-index: 2;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(41, 58, 102, 0.62);
}

.diamond {
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* --- Modal de pedido ----------------------------------------------------- */

.cart {
  width: min(520px, 100%);
  max-height: 88vh;
  padding: clamp(26px, 4vw, 38px);
  border: 0.5px solid var(--line-panel);
  border-radius: 22px;
  background: var(--cream-panel);
  color: var(--ink);
  font-family: var(--sans);
  box-shadow: 0 40px 90px -30px rgba(26, 38, 64, 0.5);
  overflow: auto;
}

.cart[open] { animation: fadeUp 0.45s var(--ease-out) both; }

.cart::backdrop {
  background: rgba(26, 38, 64, 0.5);
  backdrop-filter: blur(6px);
}

/* El <dialog> modal no bloquea el scroll de fondo por sí solo. */
html:has(dialog[open]) { overflow: hidden; }

.cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 6px;
}

.cart-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  color: var(--blue);
}

.cart-close {
  padding: 2px 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: var(--grey);
  transition: color 0.3s ease;
}

.cart-close:hover { color: var(--blue); }

.cart-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cart-sub {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--grey);
  text-wrap: pretty;
}

.cart-rows { border-top: 0.5px solid var(--rule-soft); }

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--rule-soft);
}

.cart-row-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--blue);
}

.cart-row-meta {
  margin: 2px 0 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0.5px solid var(--rule-step);
  border-radius: 50%;
  background: transparent;
  color: var(--blue);
  font-family: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.step:hover {
  border-color: var(--gold);
  background: var(--cream);
}

.step:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.step-qty {
  min-width: 22px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
}

/* --- Campos -------------------------------------------------------------- */

.field {
  display: block;
  margin: 20px 0 0;
}

.field + .field { margin-top: 16px; }

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.field-label i {
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  color: var(--grey-soft);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 0.5px solid var(--rule-input);
  border-radius: 12px;
  background: #FFFFFF;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s ease;
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus { border-color: var(--gold); }

/* --- Enviar -------------------------------------------------------------- */

.cart-send {
  margin: 22px 0 0;
  padding: 17px 20px;
}

/* Sin href = todavía no hay frascos en el pedido. */
.cart-send:not([href]) {
  opacity: 0.45;
  pointer-events: none;
}

.cart-hint {
  margin: 12px 0 0;
  font-size: 11.5px;
  font-weight: 300;
  color: var(--grey-soft);
  text-align: center;
}

/* --- Mobile -------------------------------------------------------------- */

/* En vertical el hero se parte en dos pantallas: el frasco solo, y al scrollear la
   marca con las presentaciones. La etiqueta de la foto ya dice EGEO, así que hace de
   marca arriba y el wordmark deja de duplicarse: por eso no hay degradé que tapar. */
@media (max-width: 780px) {
  .hero {
    height: auto;
    overflow: visible;
    background: var(--cream);
  }

  /* Primera pantalla: la foto a su escala, centrada. No se estira para llenar.
     El agrandado va en el ancho de la imagen y no en un transform del contenedor:
     un scale desborda por los cuatro costados, mete scroll en X y empuja el
     indicador de scroll por debajo del fold. */
  .hero-media {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    height: 100svh;
    overflow: clip;
  }

  .hero-media picture {
    width: 100%;
    height: auto;
  }

  /* El crema de la foto y el del fondo no son el mismo tono: el fundido lo disimula. */
  .hero-bg {
    width: 150%;
    height: auto;
    margin-left: -25%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  }

  /* Se apaga apenas empezás a bajar. Donde no hay scroll-driven animations queda
     fijo, que es el comportamiento anterior: degrada sin romperse. */
  .hero-media::before,
  .hero-media::after {
    content: "";
    position: absolute;
    left: 50%;
    animation: fadeOut linear both;
    animation-timeline: scroll();
    animation-range: 0 14svh;
  }

  .hero-media::before {
    bottom: 64px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    background: var(--gold);
    transform: rotate(45deg);
  }

  .hero-media::after {
    bottom: 24px;
    width: 1px;
    height: 34px;
    background: linear-gradient(180deg, var(--rule) 0%, rgba(41, 58, 102, 0) 100%);
  }

  /* Segunda pantalla. */
  .hero-wrap {
    height: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    padding: max(7svh, 52px) 20px 22px;
    text-align: center;
  }

  .hero-group {
    width: 100%;
    gap: 28px;
  }

  .lede { margin-inline: auto; }

  /* De tres columnas apretadas a filas: mismo patrón que las del modal de pedido. */
  .products {
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 0.5px solid var(--rule);
  }

  .product {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    grid-template-areas:
      "icon name   weight"
      "icon tag    weight";
    align-items: center;
    gap: 0 16px;
    padding: 14px 2px;
    border-top: none;
    border-bottom: 0.5px solid var(--rule-soft);
    text-align: left;
  }

  .product-icon {
    grid-area: icon;
    justify-content: center;
  }

  .product-name { grid-area: name; }

  .product-weight {
    grid-area: weight;
    margin-top: 0;
  }

  .product-tag {
    grid-area: tag;
    margin-top: 2px;
  }

  .place {
    position: static;
    margin: 0 0 max(6svh, 40px);
  }
}

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