/* ==========================================
   CACHITO CAFÉ
   ========================================== */

.cachito {
  /* IMAGEN DE FONDO */
  --photo: url("http://cachitocafe.com/wp-content/uploads/2026/10/Imagen-de-ChatGPT-15-oct-2026-17_32_03.png");

  /* IDENTIDAD */
  --cream: #faf4e8;
  --brown: #512b0e;
  --green: #456333;
  --orange: #ed9234;

  /* POSICIÓN DEL VAPOR SOBRE LA FOTO */
  --steam-left: 73%;
  --steam-top: 28%;
  --steam-width: 28%;
  --steam-height: 43%;

  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--cream);
  color: var(--brown);
  font-family: Arial, Helvetica, sans-serif;
}

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

/* FOTOGRAFÍA */

.cachito .cachito-scene {
  position: absolute;
  inset: 0 0 0 43%;
  z-index: 0;
  overflow: hidden;
  background: #917555;
  pointer-events: none;
}

.cachito .cachito-photo {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(
      180deg,
      rgba(35, 25, 12, .04),
      rgba(35, 25, 12, .12)
    ),
    var(--photo);
  background-size: cover;
  background-position: 65% center;
  background-repeat: no-repeat;
}

/* PANEL CREMA CON BORDE CURVO */

.cachito .cachito-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 55%;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(36px, 4vw, 70px) 0;
  background: var(--cream);
}

.cachito .cachito-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -8%;
  right: -9%;
  width: 23%;
  height: 116%;
  border-radius: 42% 58% 64% 36% / 30% 44% 56% 70%;
  background: var(--cream);
  pointer-events: none;
}

.cachito .cachito-copy {
  width: 100%;
  padding-left: clamp(28px, 4.8vw, 92px);
  padding-right: clamp(20px, 2.3vw, 44px);
}

/* LOGO: ESPACIO RESERVADO */

.cachito .cachito-logo-space {
  display: flex;
  align-items: center;
  width: min(100%, 340px);
  min-height: 110px;
  margin-bottom: 18px;
}

.cachito .cachito-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  object-position: left center;
}

/* Oculta la imagen provisional y conserva su espacio */
.cachito .cachito-logo[src="URL_DEL_LOGO"] {
  visibility: hidden;
}

.cachito .cachito-category {
  margin: 0 0 clamp(30px, 3.8vw, 60px);
  color: var(--brown);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.cachito h1 {
  margin: 0;
  color: var(--brown);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5.5vw, 88px);
  font-weight: 700;
  line-height: .99;
  letter-spacing: -.045em;
}

.cachito h1 em {
  display: inline-block;
  margin-top: 9px;
  color: var(--green);
  font-weight: 700;
}

.cachito .cachito-intro {
  margin: clamp(24px, 2.8vw, 42px) 0 28px;
  color: var(--brown);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.6vw, 39px);
  font-weight: 400;
  line-height: 1.2;
}

/* WHATSAPP */

.cachito .cachito-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  max-width: 100%;
  min-height: 60px;
  padding: 17px 27px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: #fffaf1;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(14px, 1.3vw, 19px);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}

.cachito .cachito-button svg {
  display: block;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

.cachito .cachito-button:visited {
  color: #fffaf1;
}

.cachito .cachito-button:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 5px;
}

.cachito .cachito-note {
  margin: 18px 0 0;
  color: var(--brown);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.5vw, 22px);
  line-height: 1.5;
}

.cachito .cachito-address {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: clamp(32px, 4vw, 60px) 0 0;
  color: #705138;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 1px;
}

.cachito .cachito-address::before {
  content: "";
  flex: 0 0 35px;
  height: 1px;
  background: var(--orange);
}

/* MASCOTA */

.cachito .cachito-mascot {
  position: absolute;
  z-index: 3;
  left: 56%;
  bottom: 9%;
  width: clamp(190px, 26vw, 410px);
  height: auto;
  max-width: none;
  filter: drop-shadow(0 12px 8px rgba(50, 29, 10, .12));
  pointer-events: none;
}

.cachito .cachito-mascot[src="URL_DEL_PERRITO"] {
  visibility: hidden;
}

/* VAPOR */

.cachito .cachito-vapor {
  position: absolute;
  left: var(--steam-left);
  top: var(--steam-top);
  width: var(--steam-width);
  height: var(--steam-height);
  transform: translateX(-50%);
  overflow: visible;
  opacity: .8;
  pointer-events: none;
}

.cachito .cachito-wisp {
  transform-box: view-box;
  transform-origin: 50% 100%;
  animation: cachito-rise 10s ease-in-out infinite;
}

.cachito .cachito-wisp:nth-child(2) {
  animation-duration: 13s;
  animation-delay: -6s;
}

.cachito .cachito-wisp:nth-child(3) {
  animation-duration: 16s;
  animation-delay: -10s;
}

@keyframes cachito-rise {
  0% {
    opacity: 0;
    transform: translate(0, 25px) scaleX(.8);
  }
  25% {
    opacity: .55;
  }
  55% {
    opacity: .75;
    transform: translate(-8px, -20px) scaleX(1.06);
  }
  85%, 100% {
    opacity: 0;
    transform: translate(14px, -85px) scaleX(1.18);
  }
}

@media (hover: hover) {
  .cachito .cachito-button:hover {
    background: #334c25;
    color: #fffaf1;
    transform: translateY(-2px);
  }
}

/* CELULAR Y TABLET */

@media (max-width: 900px) {
  .cachito {
    --steam-left: 76%;
    --steam-top: 8%;
    --steam-width: 35%;
    --steam-height: 65%;

    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }

  .cachito .cachito-panel {
    order: 0;
    width: 100%;
    min-height: auto;
    padding: 35px 0 46px;
  }

  .cachito .cachito-panel::after {
    top: auto;
    right: -5%;
    bottom: -32px;
    width: 110%;
    height: 65px;
    border-radius: 0 0 50% 50%;
  }

  .cachito .cachito-copy {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 26px;
  }

  .cachito .cachito-logo-space {
    width: 230px;
    min-height: 85px;
    margin-bottom: 14px;
  }

  .cachito .cachito-logo {
    max-height: 120px;
  }

  .cachito .cachito-category {
    margin-bottom: 30px;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .cachito h1 {
    font-size: clamp(42px, 8.4vw, 67px);
  }

  .cachito .cachito-intro {
    margin-top: 24px;
    font-size: 28px;
  }

  .cachito .cachito-button {
    min-height: 58px;
    padding: 16px 22px;
    font-size: 15px;
  }

  .cachito .cachito-note {
    font-size: 17px;
  }

  .cachito .cachito-address {
    margin-top: 28px;
    font-size: 10px;
  }

  .cachito .cachito-scene {
    position: relative;
    inset: auto;
    order: 1;
    width: 100%;
    height: clamp(340px, 65vw, 480px);
  }

  .cachito .cachito-photo {
    background-position: 65% center;
  }

  .cachito .cachito-mascot {
    left: 5%;
    bottom: 22px;
    width: clamp(180px, 37vw, 290px);
  }
}

/* ACCESIBILIDAD */

@media (prefers-reduced-motion: reduce) {
  .cachito .cachito-wisp {
    animation: none;
    opacity: .2;
  }

  .cachito .cachito-button {
    transition: none;
  }

  .cachito .cachito-button:hover {
    transform: none;
  }
}

/* CORRECCIÓN DEL ORIGEN DEL VAPOR */

.cachito .cachito-scene {
  container-type: size;
}

/* Mantiene el encuadre usado para calcular la posición */
.cachito .cachito-photo {
  background-position: 65% center;
}

.cachito .cachito-vapor {
  /*
   * Posición calculada para nuestra foto de proporción 3:2.
   * Compensa el recorte que produce background-size: cover.
   */
  left: calc(65% + max(8cqw, 12cqh));
  top: calc(50% + max(3.333cqw, 5cqh));

  width: clamp(140px, 20cqw, 230px);
  height: auto;
  aspect-ratio: 3 / 5;

  /* La base del trazo está en y=480 de un SVG de 500 */
  transform: translate(-50%, -96%);
  opacity: .72;
}

.cachito .cachito-wisp {
  transform-box: view-box;
  transform-origin: 50% 96%;
  animation: cachito-vapor-fixed 11s ease-in-out infinite;
}

.cachito .cachito-wisp:nth-child(2) {
  animation-duration: 14s;
  animation-delay: -5s;
}

.cachito .cachito-wisp:nth-child(3) {
  animation-duration: 17s;
  animation-delay: -9s;
}

/* El vapor cambia de forma sin desplazar su punto de salida */
@keyframes cachito-vapor-fixed {
  0%, 100% {
    opacity: .08;
    transform: scale(.82, .86) skewX(-3deg);
  }

  35% {
    opacity: .6;
    transform: scale(1.04, 1) skewX(2deg);
  }

  70% {
    opacity: .3;
    transform: scale(.94, 1.12) skewX(-2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cachito .cachito-wisp {
    animation: none;
    transform: none;
    opacity: .2;
  }
}