/* ============================================================
   DULCERA BAKEHOUSE — demo estática para portfolio
   HTML + CSS + JS vanilla. Sin frameworks, sin build.

   Índice
   00 Tipografía · 01 Variables · 02 Reset · 03 Utilidades
   04 Header · 05 Hero · 06 Categorías · 07 Best sellers
   08 Historia · 09 Testimonios · 10 Newsletter · 11 Footer
   12 Responsive
   ============================================================ */

/* ---------- 00 Tipografía (auto-hospedada) ---------- */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/baloo2-600.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/baloo2-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/nunito-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/nunito-600.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/caveat-600.woff2') format('woff2'); }

/* ---------- 01 Variables ---------- */
:root {
  /* Verdes, amarillo y crema muestreados de las propias fotos y de la
     referencia, para que los fondos CSS empalmen con las imágenes. */
  --verde: #013A2A;
  --verde-hero: #003224;
  --verde-claro: #0A5B42;
  --amarillo: #FAC034;
  --amarillo-osc: #E9A916;
  --crema: #FCFAF5;
  --menta: #EFF8F1;
  --tinta: #17241E;
  --gris: #6B7A72;
  --blanco: #FFFFFF;
  --linea: #E7E3D8;
  --linea-clara: rgba(255, 255, 255, .22);

  --ff-head: 'Baloo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ff-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ff-script: 'Caveat', 'Segoe Script', cursive;

  --edge: 4.5%;            /* la caja de contenido de la referencia */
  --r-card: 22px;
  --r-panel: 30px;
  --sombra: 0 2px 4px rgba(20, 40, 30, .04), 0 14px 30px rgba(20, 40, 30, .08);
  --section-y: clamp(48px, 5.6vw, 88px);
}

/* ---------- 02 Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
body {
  margin: 0; background: var(--crema); color: var(--tinta);
  font-family: var(--ff-body); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--ff-head); font-weight: 700; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 99; background: var(--verde); color: #fff; padding: 10px 18px; border-radius: 999px; }
.skip-link:focus { left: 12px; }

/* ---------- 03 Utilidades ---------- */
.container { padding-inline: var(--edge); }
.section { padding-block: var(--section-y); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: clamp(24px, 4vw, 60px); margin-bottom: clamp(26px, 3vw, 40px); }
.section__head--fila { align-items: center; }
.section__titulo { font-size: clamp(30px, 4.4vw, 64px); letter-spacing: -.015em; }
.section__titulo--chico { font-size: clamp(26px, 3.4vw, 46px); }
.section__aside { text-align: right; flex: none; }
.section__aside p { color: var(--gris); font-size: clamp(14px, 1.15vw, 16.5px); line-height: 1.55; }
.section__lead { color: var(--gris); font-size: clamp(14px, 1.15vw, 16.5px); margin-top: 4px; }

/* Subrayado de marcador, como en la referencia */
.subrayado { position: relative; display: inline-block; }
.subrayado::after {
  content: ''; position: absolute; left: 2%; right: 2%; bottom: -.06em; height: .12em;
  background: var(--amarillo); border-radius: 999px; z-index: -1;
}

.script { font-family: var(--ff-script); font-size: clamp(24px, 3vw, 43px); line-height: 1; display: flex; align-items: center; gap: 10px; }
.script--claro { color: #fff; }
.script__glifo { width: 1em; height: 1em; stroke-width: 1.5; opacity: .9; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon--crown { width: .8em; height: .8em; color: var(--amarillo); }
.icon--corazon { width: .7em; height: .7em; color: #F2795A; }
.icon--quote { width: 30px; height: 30px; color: var(--linea); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex: none;
  padding: 13px 30px; border-radius: 999px;
  font-family: var(--ff-head); font-size: 16px; font-weight: 700; white-space: nowrap;
  transition: background-color .2s, color .2s, transform .2s, box-shadow .2s, border-color .2s;
}
.btn .icon { width: 17px; height: 17px; transition: transform .2s; }
.btn:hover .icon { transform: translateX(3px); }
.btn--amarillo { background: var(--amarillo); color: var(--verde); }
.btn--amarillo:hover { background: var(--amarillo-osc); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(250, 192, 52, .35); }
.btn--linea { border: 1.5px solid var(--linea-clara); color: #fff; padding: 11px 22px; font-size: 14px; }
.btn--linea:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.btn--linea-osc { border-color: var(--linea); color: var(--verde); background: var(--blanco); }
.btn--linea-osc:hover { background: var(--amarillo); border-color: var(--amarillo); }

.link-flecha { display: inline-flex; align-items: center; gap: 7px; font-family: var(--ff-head); font-size: 16px; font-weight: 700; }
.link-flecha .icon { width: 16px; height: 16px; transition: transform .2s; }
.link-flecha:hover .icon { transform: translateX(3px); }
.link-flecha--sm { font-size: clamp(12px, 1vw, 14px); font-weight: 600; }
.link-flecha--sm .icon { width: 13px; height: 13px; }

.estrellas { display: inline-flex; gap: 1.5px; color: var(--amarillo); }
.estrellas .icon { width: 13px; height: 13px; }

.avatar {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--verde); color: var(--amarillo);
  font-family: var(--ff-head); font-size: 15px; font-weight: 700;
}

/* ---------- 04 Header ---------- */
.site-header { background: var(--crema); }
.site-header__inner { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 36px); padding-block: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo__mark { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--verde); }
.logo__mark svg { width: 27px; height: 27px; fill: none; stroke: var(--amarillo); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.logo__text { display: flex; flex-direction: column; line-height: 1; font-family: var(--ff-head); font-size: 28px; font-weight: 700; color: var(--verde); }
.logo__text small { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--amarillo-osc); margin-top: 2px; }
.logo--claro .logo__text { color: #fff; }
.logo--claro .logo__mark { background: rgba(255, 255, 255, .1); }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); margin-inline: auto; }
.nav__link { position: relative; font-family: var(--ff-head); font-size: 17px; font-weight: 600; color: var(--tinta); padding-block: 6px; transition: color .2s; }
.nav__link:hover { color: var(--amarillo-osc); }
.nav__link.is-active::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: 0; height: 3px; background: var(--amarillo); border-radius: 999px; }
.site-header__acciones { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--verde); transition: background-color .2s; }
.icon-btn:hover { background: #F1EEE4; }
.icon-btn--menu { display: none; }
.icon-btn--menu .icon-close { display: none; }
.cart-badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--amarillo); color: var(--verde);
  font-family: var(--ff-head); font-size: 11px; font-weight: 700; line-height: 1;
}
.cart-badge.is-pulse { animation: pulso .35s ease-out; }
@keyframes pulso { 0% { transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- 05 Hero ---------- */
.hero { padding-inline: 1.4%; }
.hero__panel { position: relative; isolation: isolate; border-radius: var(--r-panel); overflow: hidden; background: var(--verde-hero); }
.hero__media img { width: 100%; }
.hero__texto {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  /* La franja de features viene quemada en la foto entre el 81% y el 92%
     de la altura: este padding deja el texto por encima. */
  padding: 0 0 8.2% 5.2%; width: 56%;
}
.hero__titulo { margin: 6px 0 0; font-size: clamp(34px, 6.7vw, 96px); line-height: 1.02; color: #fff; letter-spacing: -.015em; }
.hero__titulo em { font-style: normal; color: var(--amarillo); }
.hero__lead { margin: 14px 0 22px; color: rgba(255, 255, 255, .84); font-size: clamp(13.5px, 1.28vw, 18.5px); line-height: 1.6; }

/* ---------- 06 Categorías ---------- */
.categorias__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(12px, 1.2vw, 18px); }
.categoria {
  display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden;
  background: var(--card); transition: transform .25s, box-shadow .25s;
}
.categoria:hover { transform: translateY(-5px); box-shadow: var(--sombra); }
/* La foto trae el producto centrado; se recorta el sobrante de abajo
   para que el rótulo caiga sobre el color liso de la tarjeta. */
.categoria img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 34%; }
.categoria__pie { display: flex; flex-direction: column; gap: 3px; padding: 0 9% 9%; }
.categoria__pie strong { font-family: var(--ff-head); font-size: clamp(17px, 1.65vw, 24px); font-weight: 700; color: var(--tinta); }
.categoria__pie .link-flecha--sm { color: rgba(23, 36, 30, .72); }

/* ---------- 07 Best sellers ---------- */
.best { padding-block: 0 var(--section-y); }
.best__panel { background: var(--verde); color: #fff; border-radius: var(--r-panel); padding: clamp(28px, 3.4vw, 52px); }
.best__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: clamp(22px, 2.6vw, 36px); }
.best__titulo { font-size: clamp(26px, 4vw, 58px); }
.best__head p { margin-top: 4px; color: rgba(255, 255, 255, .78); font-size: clamp(14px, 1.15vw, 16.5px); }

.productos { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.4vw, 20px); }
.producto { background: var(--blanco); color: var(--tinta); border-radius: var(--r-card); padding: 12px 14px 16px; }
.producto__foto { position: relative; margin-bottom: 12px; }
.producto__foto img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; }
.badge {
  position: absolute; top: 9px; left: 9px; padding: 4px 11px; border-radius: 999px;
  background: var(--amarillo); color: var(--verde);
  font-family: var(--ff-head); font-size: 11.5px; font-weight: 700;
}
.producto h3 { font-size: clamp(15px, 1.2vw, 17.5px); font-weight: 600; line-height: 1.25; }
.producto__precio { margin-top: 2px; font-family: var(--ff-head); font-size: clamp(18px, 1.55vw, 23px); font-weight: 700; color: var(--verde); }
.producto__rating { display: flex; align-items: center; gap: 6px; margin: 2px 0 12px; font-size: 12px; color: var(--gris); }
.producto__rating small { color: #9AA79F; }
.btn--carrito { width: 100%; padding: 11px 14px; border: 1.5px solid var(--linea); font-size: clamp(13px, 1.05vw, 15px); color: var(--verde); }
.btn--carrito .icon { width: 15px; height: 15px; }
.btn--carrito:hover { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn--carrito:hover .icon { transform: none; }

/* ---------- 08 Historia ---------- */
.historia { position: relative; background: var(--crema); }
.historia__media img { width: 100%; }
.historia__texto { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding-left: 42%; padding-right: 22%; }
.historia__eyebrow { font-family: var(--ff-head); font-size: clamp(17px, 1.9vw, 27px); font-weight: 600; color: var(--verde); }
.historia__titulo { font-size: clamp(24px, 3.4vw, 50px); color: var(--tinta); }
.historia__texto > p { margin: 14px 0 24px; max-width: 46ch; color: var(--gris); font-size: clamp(13px, 1.18vw, 17px); line-height: 1.7; }
.historia__texto .btn { align-self: flex-start; }

/* ---------- 09 Testimonios ---------- */
.testimonios { background: var(--menta); padding-block: var(--section-y); }
.resenas { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 24px); }
.resena { background: var(--blanco); border-radius: var(--r-card); padding: clamp(20px, 2vw, 28px); }
.resena__top { display: flex; align-items: flex-start; justify-content: flex-start; gap: 14px; margin-bottom: 16px; }
.resena blockquote { font-size: clamp(14.5px, 1.18vw, 17px); line-height: 1.7; color: #3B4A43; }
.resena figcaption { display: flex; flex-direction: column; margin: 16px 0 8px; line-height: 1.35; }
.resena figcaption strong { font-family: var(--ff-head); font-size: clamp(16px, 1.3vw, 19px); font-weight: 700; }
.resena figcaption small { font-size: 12.5px; color: var(--gris); }

/* ---------- 10 Newsletter ---------- */
/* La imagen ya trae el panel amarillo, los iconos sociales y el
   arranque de la ola verde del footer: va pegada al footer. */
.newsletter { position: relative; background: var(--crema); margin-top: var(--section-y); }
.newsletter__media img { width: 100%; }
.newsletter__texto { position: absolute; inset: 0; z-index: 2; padding: 9% 0 0 8%; width: 52%; }
.newsletter__texto h2 { font-size: clamp(24px, 3.7vw, 54px); color: var(--verde); line-height: 1.1; }
.newsletter__texto p { margin-top: 12px; color: #6B5312; font-size: clamp(13px, 1.25vw, 18px); font-weight: 600; line-height: 1.5; }

/* ---------- 11 Footer ---------- */
.site-footer { background: var(--verde); color: #fff; padding-block: 0 24px; margin-top: -1px; }
.site-footer__cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 34px 30px; padding-bottom: clamp(26px, 3vw, 40px); }
.site-footer__marca p { margin-top: 16px; color: rgba(255, 255, 255, .66); font-size: clamp(14px, 1.1vw, 16px); max-width: 34ch; }
.site-footer h3 { margin-bottom: 16px; font-size: clamp(18px, 1.5vw, 22px); }
.site-footer__cols a { color: rgba(255, 255, 255, .66); transition: color .2s; }
.site-footer__cols nav a { font-size: clamp(14.5px, 1.1vw, 16px); }
.site-footer__cols a:hover { color: var(--amarillo); }
.site-footer__cols nav li + li { margin-top: 9px; }
.contacto li { display: flex; gap: 10px; font-size: clamp(14.5px, 1.1vw, 16px); color: rgba(255, 255, 255, .66); line-height: 1.5; }
.contacto li + li { margin-top: 12px; }
.contacto .icon { width: 17px; height: 17px; margin-top: 4px; color: var(--amarillo); }
.redes { display: flex; gap: 9px; margin-top: 20px; }
.redes a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--linea-clara); color: #fff; transition: background-color .2s, color .2s, border-color .2s; }
.redes a:hover { background: var(--amarillo); border-color: var(--amarillo); color: var(--verde); }
.redes .icon { width: 17px; height: 17px; }
.site-footer__pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 22px; border-top: 1px solid var(--linea-clara); font-size: 13px; color: rgba(255, 255, 255, .55); }
.site-footer__pie p:last-child { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   12 RESPONSIVE
   ============================================================ */

/* --- Tablet ancha --- */
@media (max-width: 1180px) {
  .hero__texto { width: 58%; padding-bottom: 10%; }
  .historia__texto { padding-left: 40%; padding-right: 15%; }
}

/* --- Tablet --- */
@media (max-width: 960px) {
  :root { --edge: 5%; }
  .icon-btn--menu { display: grid; }
  .site-header { position: relative; z-index: 30; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 8px; background: var(--crema); border-bottom: 1px solid var(--linea); box-shadow: var(--sombra);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .22s, transform .22s, visibility .22s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link { padding: 13px 16px; border-radius: 12px; }
  .nav__link:hover { background: #F1EEE4; }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { background: rgba(250, 192, 52, .25); }

  .categorias__grid { grid-template-columns: repeat(3, 1fr); }
  .productos { grid-template-columns: repeat(2, 1fr); }
  .resenas { grid-template-columns: 1fr; }
  .site-footer__cols { grid-template-columns: 1fr 1fr; }
}

/* --- Todo lo que no es desktop: los textos dejan de ir encima --- */
@media (max-width: 767px) {
  :root { --edge: 18px; --r-panel: 22px; --r-card: 18px; }

  /* Hero: el texto va arriba, sobre el mismo verde de la foto, y la
     foto se recorta para no dejar un vacío verde enorme. */
  .hero { padding-inline: 12px; }
  .hero__panel { display: flex; flex-direction: column; }
  .hero__texto { position: static; order: -1; width: 100%; padding: 30px 20px 26px; }
  .hero__titulo { font-size: clamp(34px, 11vw, 48px); }
  .hero__lead br { display: none; }
  .hero__media img { aspect-ratio: 9 / 11; object-fit: cover; object-position: center 82%; }
  .hero .btn { align-self: stretch; }

  .section__head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .section__aside { text-align: left; }
  .section__aside p br { display: none; }
  .categorias__grid { grid-template-columns: repeat(2, 1fr); }
  .productos { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .producto h3 { font-size: 14.5px; }

  /* Historia: foto arriba (recortada donde termina el dibujo), texto debajo */
  .historia__texto { position: static; width: 100%; padding: 26px var(--edge) 34px; }
  .historia__media img { aspect-ratio: 9 / 8; object-fit: cover; object-position: center top; }

  /* Newsletter: el texto va arriba y la foto debajo, para que los iconos
     sociales y la ola verde queden pegados al footer, como en la referencia.
     El amarillo es el muestreado de seccion-4-m, así no se ve el empalme. */
  .newsletter { margin-top: 0; background: #FDC745; display: flex; flex-direction: column; }
  .newsletter__texto { position: static; order: -1; width: 100%; background: #FDC745; padding: 30px var(--edge) 22px; }
  .newsletter__media img { aspect-ratio: 9 / 13; object-fit: cover; object-position: center 100%; }
  .historia__texto p br, .newsletter__texto h2 br, .newsletter__texto p br { display: none; }

  .site-footer__cols { grid-template-columns: 1fr; gap: 26px; }
  .site-footer__pie { flex-direction: column; align-items: flex-start; }
}

/* --- Pantallas angostas: la barra de iconos no entra completa --- */
@media (max-width: 480px) {
  .icon-btn--cuenta { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .logo__mark { width: 40px; height: 40px; }
  .logo__mark svg { width: 24px; height: 24px; }
  .logo__text { font-size: 24px; }
}

@media (max-width: 330px) {
  .categorias__grid, .productos { grid-template-columns: 1fr; }
}
