/* ==================================
   CACHITO CAFÉ · SECCIÓN DE ANTOJOS
   ================================== */

.cachito-antojos {
  --verde: #5a6c32;
  --marron: #693918;
  --naranja: #f89738;
  --crema: #f3d7b6;
  --tinta: #3d1e10;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 6vw, 80px) 24px;
  color: var(--tinta);
  background: #fff3e1;
  font-family: "DM Sans", sans-serif;
}

/* Textura ligera de papel, sin imagen adicional */
.cachito-antojos::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23693918' opacity='.22' filter='url(%23noise)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

.cachito-antojos,
.cachito-antojos * {
  box-sizing: border-box;
}

.cachito-antojos__contenedor {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

.cachito-antojos__cabecera {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.cachito-antojos__etiqueta {
  margin: 0 0 8px;
  color: var(--marron);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.23em;
}

.cachito-antojos__titulo {
  max-width: 900px;
  margin: 0;
  color: var(--tinta);
  font-family: "Outfit", sans-serif;
  font-size: clamp(32px, 4.3vw, 58px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.cachito-antojos__titulo > span {
  color: var(--marron);
}

.cachito-antojos__enlace {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 0;
  color: var(--tinta);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cachito-antojos__enlace::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 4px;
  border-radius: 50%;
  background: var(--naranja);
  transform: rotate(-2deg);
}

.cachito-antojos__enlace:hover {
  color: var(--verde);
}

.cachito-antojos__enlace:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 6px;
  border-radius: 4px;
}

/* Tarjetas */

.cachito-antojos__tarjetas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding: 8px;
}

.cachito-tarjeta {
  --fondo-tarjeta: var(--naranja);
  position: relative;
  isolation: isolate;
  min-width: 0;
}

/* Placas de color detrás de las fotografías */
.cachito-tarjeta::before,
.cachito-tarjeta::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px -8px 48px;
  border-radius: 22px 15px 26px 14px;
  background: var(--fondo-tarjeta);
  transform: rotate(-4deg);
}

.cachito-tarjeta::after {
  inset: -5px 5px 65px -9px;
  opacity: 0.55;
  transform: rotate(3deg);
}

.cachito-tarjeta--cafe {
  --fondo-tarjeta: var(--verde);
}

.cachito-tarjeta--salado::before {
  transform: rotate(3deg);
}

.cachito-tarjeta--dulce::after {
  transform: rotate(-3deg);
}

.cachito-tarjeta__foto {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: var(--crema);
}

.cachito-tarjeta__foto img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Cada tarjeta muestra un tercio de la imagen */
.cachito-tarjeta--cafe img {
  object-position: left center;
}

.cachito-tarjeta--salado img {
  object-position: center center;
}

.cachito-tarjeta--dulce img {
  object-position: right center;
}

/* Etiquetas con apariencia de papel */
.cachito-tarjeta__texto {
  position: relative;
  z-index: 2;
  min-height: 100px;
  margin: -22px 0 0;
  padding: 16px 20px 18px;
}

.cachito-tarjeta__texto::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--crema);
  clip-path: polygon(
    2% 5%, 11% 0%, 22% 3%, 38% 0%,
    54% 3%, 69% 0%, 86% 3%, 98% 0%,
    100% 18%, 98% 35%, 100% 58%, 98% 78%,
    100% 94%, 87% 100%, 70% 97%, 53% 100%,
    36% 97%, 20% 100%, 3% 96%, 0% 79%,
    2% 59%, 0% 39%, 2% 23%
  );
}

.cachito-tarjeta--salado .cachito-tarjeta__texto::before {
  background: #e5dfb9;
}

.cachito-tarjeta__texto h3 {
  position: relative;
  margin: 0 0 3px;
  padding-right: 40px;
  color: var(--tinta);
  font-family: "Outfit", sans-serif;
  font-size: clamp(27px, 2.7vw, 36px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.cachito-tarjeta__texto p {
  margin: 0;
  color: var(--tinta);
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.5;
}

/* Detalles dibujados */

.cachito-tarjeta__estrella {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 16px;
  color: var(--naranja);
  font-size: 38px;
  line-height: 1;
  pointer-events: none;
}

.cachito-tarjeta--dulce .cachito-tarjeta__estrella {
  color: var(--crema);
}

.cachito-tarjeta__vapor {
  position: absolute;
  top: 10px;
  left: 15px;
  width: 58px;
  height: 70px;
  stroke: var(--naranja);
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-10deg);
  pointer-events: none;
}

.cachito-tarjeta__dibujo {
  position: absolute;
  top: -35px;
  right: 4px;
  width: 70px;
  height: 70px;
  padding: 5px;
  border-radius: 45%;
  background: var(--crema);
  stroke: var(--marron);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(10deg);
  pointer-events: none;
}

.cachito-tarjeta__rayos {
  position: absolute;
  top: 6px;
  right: -12px;
  width: 42px;
  height: 65px;
  stroke: var(--naranja);
  stroke-width: 5;
  stroke-linecap: round;
  pointer-events: none;
}

/* Tablet */

@media (max-width: 960px) {
  .cachito-antojos__cabecera {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .cachito-antojos__tarjetas {
    gap: 20px;
  }

  .cachito-tarjeta__texto {
    padding-inline: 12px;
  }

  .cachito-tarjeta__texto h3 {
    font-size: 27px;
  }

  .cachito-tarjeta__dibujo {
    top: -32px;
    width: 54px;
    height: 54px;
  }
}

/* Móvil: tarjetas completas en una columna */

@media (max-width: 680px) {
  .cachito-antojos {
    padding: 38px 22px 46px;
  }

  .cachito-antojos__titulo {
    max-width: 480px;
    font-size: clamp(34px, 8vw, 48px);
  }

  .cachito-antojos__cabecera {
    margin-bottom: 24px;
  }

  .cachito-antojos__tarjetas {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 440px;
    margin-inline: auto;
  }

  .cachito-tarjeta__texto {
    padding: 16px 20px 18px;
  }

  .cachito-tarjeta__texto h3 {
    font-size: 34px;
  }

  .cachito-tarjeta__texto p {
    font-size: 16px;
  }

  .cachito-tarjeta__dibujo {
    width: 68px;
    height: 68px;
  }
}

/* ------------------------------------ CARRUSEL --------------------------------------*/

/* =========================================
   CACHITO · CARRUSEL DE PRODUCTO DESTACADO
   ========================================= */

.cachito-carrusel {
  --verde: #5a6c32;
  --marron: #693918;
  --naranja: #f89738;
  --crema: #f3d7b6;
  --papel: #fff2dc;
  --margen-slide: 10%;
  --separacion: 28px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(40px, 5vw, 72px) 0 50px;
  background: #F3D7B6;
  color: var(--marron);
  font-family: "DM Sans", sans-serif;
}

.cachito-carrusel,
.cachito-carrusel * {
  box-sizing: border-box;
}

.cachito-carrusel [hidden] {
  display: none !important;
}

/* Textura de papel */
.cachito-carrusel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='papel'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23693918' opacity='.25' filter='url(%23papel)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

/* Remate de cuadros */
.cachito-carrusel::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24px;
  background:
    conic-gradient(
      var(--verde) 25%,
      transparent 0 50%,
      var(--verde) 0 75%,
      transparent 0
    ) 0 0 / 48px 48px;
}

/* Encabezado */
.cachito-carrusel__cabecera {
  max-width: 1250px;
  margin: 0 auto 32px;
  padding: 0 24px;
  text-align: center;
}

.cachito-carrusel__etiqueta {
  margin: 0 0 16px;
  color: var(--verde);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.23em;
}

.cachito-carrusel h2 {
  margin: 0;
  color: var(--marron);
  font-family: "Outfit", sans-serif;
  font-size: clamp(36px, 5.5vw, 76px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.cachito-carrusel h2 span {
  position: relative;
  display: inline-block;
  color: var(--verde);
}

.cachito-carrusel h2 span::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 6px;
  border-radius: 50%;
  background: var(--naranja);
  transform: rotate(-2deg);
}

.cachito-carrusel__subtitulo {
  margin: 26px 0 0;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.5;
}

/* Pista: el espacio lateral deja ver los vecinos */
.cachito-carrusel__escenario {
  position: relative;
  max-width: 1600px;
  margin-inline: auto;
}

.cachito-carrusel__pista {
  display: flex;
  gap: var(--separacion);
  overflow-x: auto;
  padding: 18px var(--margen-slide);
  scroll-padding-inline: var(--margen-slide);
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.cachito-carrusel__pista::-webkit-scrollbar {
  display: none;
}

/* Una diapositiva ocupa el ancho interior de la pista */
.cachito-slide {
  display: grid;
  grid-template-columns: 55% 45%;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 420px;
  overflow: hidden;
  border: 7px solid var(--naranja);
  border-radius: 48px 32px 42px 36px;
  background: var(--papel);
  scroll-snap-align: center;
}

/* El efecto de atenuación se activa solo con JavaScript */
.cachito-carrusel.is-ready .cachito-slide {
  opacity: 0.45;
  transition: opacity 250ms ease;
}

.cachito-carrusel.is-ready .cachito-slide.is-active {
  opacity: 1;
}

.cachito-slide__foto {
  min-width: 0;
  min-height: 100%;
  background: var(--crema);
}

.cachito-slide__foto img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 540px;
  object-fit: cover;
}

.cachito-slide__contenido {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 44px 30px;
  text-align: center;
}

/* Borde ondulado entre fotografía y texto */
.cachito-slide__contenido::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 -22px;
  background: var(--papel);
  clip-path: polygon(
    4% 0, 100% 0, 100% 100%, 4% 100%,
    1% 90%, 3% 78%, 0 65%, 3% 51%,
    0 37%, 3% 23%, 1% 11%
  );
}

.cachito-slide__etiqueta {
  margin: 0 0 18px;
  color: var(--verde);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.16em;
}

.cachito-carrusel .cachito-slide h3 {
  max-width: 100%;
  margin: 0 0 18px;
  color: var(--marron);
  font-family: "Outfit", sans-serif;
  font-size: clamp(38px, 5.8vw, 82px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.cachito-slide__descripcion {
  max-width: 350px;
  margin: 0;
  font-size: clamp(16px, 1.7vw, 23px);
  line-height: 1.5;
}

.cachito-slide__adorno {
  margin-top: 24px;
  color: var(--naranja);
  font-size: 52px;
  line-height: 1;
}

/* Flechas superpuestas */
.cachito-carrusel .cachito-carrusel__flecha {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 16px;
  border: 2px solid var(--papel);
  border-radius: 50%;
  background: var(--verde);
  color: var(--papel);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 160ms ease;
}

.cachito-carrusel__flecha--anterior {
  left: var(--margen-slide);
}

.cachito-carrusel__flecha--siguiente {
  left: calc(100% - var(--margen-slide));
}

.cachito-carrusel .cachito-carrusel__flecha:hover {
  background: var(--marron);
}

.cachito-carrusel__flecha svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Puntos y contador */
.cachito-carrusel__pie {
  padding: 12px 20px 8px;
  text-align: center;
}

.cachito-carrusel__puntos {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.cachito-carrusel .cachito-carrusel__punto {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.cachito-carrusel__punto::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 3px solid var(--verde);
  border-radius: 999px;
}

.cachito-carrusel__punto[aria-current="true"]::before {
  width: 30px;
  height: 15px;
  border-color: var(--naranja);
  background: var(--naranja);
}

.cachito-carrusel__contador {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.cachito-carrusel__ayuda {
  margin: 8px 0 0;
  font-size: 14px;
}

.cachito-carrusel :is(button, [tabindex]):focus-visible {
  outline: 3px solid var(--marron);
  outline-offset: 4px;
}

.cachito-carrusel__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Tablet y móvil: foto arriba y texto abajo */
@media (max-width: 760px) {
  .cachito-carrusel {
    --margen-slide: 8%;
    --separacion: 16px;
    padding-top: 36px;
  }

  .cachito-carrusel__cabecera {
    margin-bottom: 18px;
  }

  .cachito-carrusel__etiqueta {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .cachito-slide {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 0;
    border-width: 5px;
    border-radius: 30px 24px 32px 26px;
  }

  .cachito-slide__foto {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .cachito-slide__foto img {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .cachito-slide__contenido {
    padding: 26px 22px;
  }

  .cachito-slide__contenido::before {
    inset: -12px 0 0;
    clip-path: polygon(
      0 3%, 12% 0, 25% 3%, 38% 0,
      50% 3%, 63% 0, 76% 3%, 89% 0,
      100% 3%, 100% 100%, 0 100%
    );
  }

  .cachito-slide__etiqueta {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .cachito-carrusel .cachito-slide h3 {
    margin-bottom: 12px;
    font-size: clamp(38px, 10vw, 56px);
  }

  .cachito-slide__descripcion {
    font-size: 16px;
  }

  .cachito-slide__adorno {
    margin-top: 16px;
    font-size: 36px;
  }

  .cachito-carrusel .cachito-carrusel__flecha {
    width: 46px;
    height: 46px;
    padding: 10px;
  }
}

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

/* -------------------------------------------- MAPA --------------------------------------------*/

/* CACHITO · MAPA PARA EL CONTENEDOR DERECHO */

.cc-ubicacion {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 5px solid #f3d7b6;
  border-radius: 28px 20px 26px 22px;
  background: #f3d7b6;
  color: #693918;
  font-family: "DM Sans", sans-serif;
  box-shadow: 0 12px 30px rgb(35 44 18 / 12%);
}

.cc-ubicacion,
.cc-ubicacion * {
  box-sizing: border-box;
}

.cc-ubicacion [hidden] {
  display: none !important;
}

.cc-ubicacion__mapa {
  width: 100%;
  height: 380px;
  background: #f3d7b6;
}

.cc-ubicacion__estado {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  max-width: calc(100% - 75px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff5e7;
  color: #693918;
  font-size: 13px;
}

/* Franja debajo del mapa */
.cc-ubicacion__pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px;
}

.cc-ubicacion__pie strong {
  display: block;
  color: #693918;
  font-family: "Outfit", sans-serif;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.1;
}

.cc-ubicacion__pie span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
}

.cc-ubicacion__pie a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  border-radius: 999px;
  background: #f89738;
  color: #693918;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cc-ubicacion__pie a:hover {
  background: #693918;
  color: #fff5e7;
}

/* Marcador: no alterar su transform;
   MapLibre lo utiliza para posicionarlo */
.cc-ubicacion .cc-ubicacion__pin {
  width: 88px;
  height: 84px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #693918;
  cursor: pointer;
}

.cc-ubicacion__pin-cuerpo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 66px;
  border: 3px solid #fff5e7;
  border-radius: 50%;
  background: #f89738;
  box-shadow: 0 5px 12px rgb(105 57 24 / 20%);
}

.cc-ubicacion__pin-cuerpo::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  width: 0;
  height: 0;
  border-top: 18px solid #f89738;
  border-right: 12px solid transparent;
  border-left: 12px solid transparent;
  transform: translateX(-50%);
}

.cc-ubicacion__pin strong {
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.cc-ubicacion__pin small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
}

/* Controles del mapa */
.cc-ubicacion .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid #dfc29f;
  border-radius: 12px;
  background: #fff5e7;
}

.cc-ubicacion .maplibregl-ctrl-group button {
  width: 36px;
  height: 36px;
  background-color: #fff5e7;
}

.cc-ubicacion .maplibregl-ctrl-group button:hover {
  background-color: #f3d7b6;
}

/* Créditos del proveedor: mantenerlos visibles */
.cc-ubicacion .maplibregl-ctrl-attrib {
  background: rgb(255 245 231 / 95%);
  color: #693918;
  font-size: 10px;
}

.cc-ubicacion .maplibregl-ctrl-attrib a {
  color: #693918;
}

/* Ventana al pulsar el marcador */
.cc-ubicacion .maplibregl-popup-content {
  padding: 18px;
  border-radius: 14px;
  background: #fff5e7;
  color: #693918;
}

.cc-ubicacion__ficha strong {
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.cc-ubicacion__ficha p {
  margin: 8px 0 0;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.cc-ubicacion :is(a, button):focus-visible {
  outline: 3px solid #693918;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .cc-ubicacion__mapa {
    height: 320px;
  }

  .cc-ubicacion__pie {
    padding: 14px;
  }
}