/* Dulce Vida | Fiestas y Diversión
   Toldo de carrito de dulces: frambuesa, algodón, amarillo de inflable.
   Mobile-first. Sin dependencias externas (fuentes alojadas en /assets/fonts). */

@font-face {
  font-family: "Shrikhand";
  src: url("../fonts/shrikhand-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --frambuesa: #D61F6E;
  --frambuesa-osc: #A8124F;
  --algodon: #FFE3EF;
  --algodon-borde: #F7B8D2;
  --amarillo: #FFC531;
  --ciruela: #2B1240;
  --ciruela-suave: #5B4670;
  --papel: #FFFFFF;
  --wa: #25D366;
  --wa-osc: #1EBE5A;
  --wa-fondo: #EFEAE2;
  --wa-burbuja: #D9FDD3;
  --wa-barra: #008069;

  --display: "Shrikhand", "Cooper Black", Georgia, serif;
  --texto: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Escala 4:3 sobre 17px */
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: clamp(1.125rem, 2.4vw, 1.25rem);
  --t-lg: clamp(1.9rem, 4.6vw, 2.9rem);
  --t-xl: clamp(2.5rem, 7.5vw, 5.5rem);

  --gutter: 1rem;
  --seccion: clamp(3.5rem, 9vw, 6rem);
  --feston: 22px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--texto);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--ciruela);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--frambuesa-osc);
  text-underline-offset: 0.18em;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.005em;
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--ciruela);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ciruela);
  color: var(--papel);
  border-radius: 8px;
  font-weight: 700;
}

.skip:focus {
  top: 1rem;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  font-size: var(--t-sm);
}

.btn-block {
  width: 100%;
}

.btn-wa {
  background: var(--wa);
  color: var(--ciruela);
}

.btn-wa:hover {
  background: var(--wa-osc);
}

.btn-light {
  background: var(--papel);
  color: var(--ciruela);
  box-shadow: 0.25rem 0.25rem 0 var(--ciruela);
}

.btn-light:hover {
  background: var(--amarillo);
}

.btn-light .icon-wa {
  color: #128C4A;
  width: 1.35em;
  height: 1.35em;
}

/* Cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--papel);
  border-bottom: 1px solid var(--algodon-borde);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--frambuesa);
  text-decoration: none;
  margin-right: auto;
}

.nav {
  display: none;
  gap: 1.5rem;
}

.nav a {
  color: var(--ciruela);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--frambuesa);
  text-decoration: underline;
}

/* Portada: el toldo del carrito */
.hero {
  position: relative;
  background: var(--frambuesa);
  color: var(--papel);
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 7vw, 5rem);
  margin-bottom: var(--feston);
}

/* Borde festoneado, como el toldo del carrito de algodón */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--feston);
  background: radial-gradient(circle at 50% 0, var(--frambuesa) calc(var(--feston) - 0.5px), transparent var(--feston)) 0 0 / calc(var(--feston) * 2) var(--feston) repeat-x;
}

.hero-grid {
  display: grid;
  gap: 2.25rem;
  align-items: center;
}

.hero h1 {
  font-size: var(--t-xl);
  line-height: 1.04;
  text-shadow: 0.055em 0.055em 0 var(--ciruela);
  max-width: 12ch;
  text-wrap: balance;
}

.lead {
  margin: 1.25rem 0 1.75rem;
  max-width: 34rem;
  font-size: var(--t-md);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.link-light {
  color: var(--papel);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  padding: 0.5rem 0;
}

.link-light:hover {
  color: var(--amarillo);
}

.hero .link-light:focus-visible,
.hero .btn:focus-visible {
  outline-color: var(--amarillo);
}

.hero-place {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  font-size: var(--t-sm);
  font-weight: 600;
}

/* Encabezados de sección */
.section-head {
  max-width: 40rem;
  margin: 0 0 2rem;
}

.section-head h2 {
  font-size: var(--t-lg);
  line-height: 1.1;
  color: var(--frambuesa);
}

.section-head p {
  margin: 0.75rem 0 0;
  color: var(--ciruela-suave);
}

/* Fiestas realizadas */
.fiestas {
  padding: var(--seccion) 0;
}

.mosaic {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tile-lg {
  grid-column: span 2;
}

.tile a {
  position: relative;
  display: block;
  height: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--algodon);
  color: var(--ciruela);
  text-decoration: none;
}

.tile picture,
.tile img {
  width: 100%;
  height: 100%;
}

.tile img {
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tile a:hover img {
  transform: scale(1.04);
}

.tile-cap {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  max-width: calc(100% - 1rem);
  padding: 0.25rem 0.7rem;
  background: var(--papel);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
}

.tile-lg .tile-cap {
  font-size: var(--t-sm);
  left: 0.75rem;
  bottom: 0.75rem;
}

.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-weight: 700;
}

/* Cotización */
.cotizar {
  background: var(--algodon);
  padding: var(--seccion) 0;
}

.cotizar-grid {
  display: grid;
  gap: 2rem;
}

.quote {
  display: grid;
  gap: 1.75rem;
}

.services {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.services legend {
  padding: 0;
  font-weight: 800;
  font-size: var(--t-md);
}

.hint {
  margin: 0.15rem 0 0.9rem;
  font-size: var(--t-sm);
  color: var(--ciruela-suave);
}

.service-list {
  display: grid;
  gap: 0.6rem;
}

.service {
  position: relative;
  display: block;
  cursor: pointer;
}

.service input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.service-box {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--papel);
  border: 2px solid var(--algodon-borde);
  border-radius: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.service-box::before {
  content: "";
  grid-row: 1 / span 2;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.05rem;
  border: 2px solid var(--ciruela-suave);
  border-radius: 7px;
  background: var(--papel) center / 0 no-repeat;
  transition: background-size 0.15s ease;
}

.service-name {
  font-weight: 700;
  line-height: 1.35;
}

.service-desc {
  font-size: var(--t-sm);
  color: var(--ciruela-suave);
  line-height: 1.45;
}

.service:hover .service-box {
  border-color: var(--frambuesa);
}

.service input:checked + .service-box {
  border-color: var(--frambuesa);
  background: #FFF7FA;
}

.service input:checked + .service-box::before {
  border-color: var(--frambuesa);
  background-color: var(--frambuesa);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 78%;
}

.service input:focus-visible + .service-box {
  outline: 3px solid var(--ciruela);
  outline-offset: 2px;
}

.fields {
  display: grid;
  gap: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.9rem;
  font: inherit;
  color: var(--ciruela);
  background: var(--papel);
  border: 2px solid var(--algodon-borde);
  border-radius: 12px;
  appearance: none;
}

.field input::placeholder {
  color: #8D7C9B;
}

.field input:hover {
  border-color: var(--frambuesa);
}

.field input:focus-visible {
  outline: 3px solid var(--ciruela);
  outline-offset: 1px;
  border-color: var(--frambuesa);
}

/* Vista previa estilo chat de WhatsApp */
.chat {
  align-self: start;
  border-radius: 20px;
  overflow: hidden;
  background: var(--wa-fondo);
  border: 2px solid var(--ciruela);
  box-shadow: 0.5rem 0.5rem 0 var(--ciruela);
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--wa-barra);
  color: var(--papel);
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--frambuesa);
  font-family: var(--display);
  font-size: 0.95rem;
}

.chat-name {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.chat-num {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.9;
}

.chat-body {
  padding: 1.25rem 1rem;
  min-height: 9rem;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.bubble {
  position: relative;
  margin: 0;
  max-width: 92%;
  padding: 0.6rem 0.8rem 0.7rem;
  background: var(--wa-burbuja);
  border-radius: 12px 0 12px 12px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #111B21;
}

.bubble::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  border-top: 10px solid var(--wa-burbuja);
  border-right: 8px solid transparent;
}

.chat-foot {
  padding: 0 1rem 1.1rem;
}

.chat-note {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: #54656F;
  text-align: center;
}

/* Pie */
.site-footer {
  background: var(--ciruela);
  color: #F1E6F5;
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.footer-grid p {
  margin: 0;
}

.footer-brand {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--papel);
  margin-bottom: 0.4rem !important;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--papel);
  font-weight: 600;
  text-decoration: none;
  padding: 0.2rem 0;
}

.footer-links a:hover {
  color: var(--amarillo);
}

.site-footer :focus-visible {
  outline-color: var(--amarillo);
}

.footer-copy {
  margin-top: 2rem;
  font-size: var(--t-sm);
  color: #BFAFCB;
}

/* WhatsApp flotante (solo móvil) */
.wa-float {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--wa);
  color: var(--papel);
  box-shadow: 0 6px 18px rgba(43, 18, 64, 0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wa-float svg {
  width: 2rem;
  height: 2rem;
}

.wa-float.is-hidden {
  opacity: 0;
  transform: translateY(1rem) scale(0.9);
  pointer-events: none;
}

/* Foto ampliada */
.lightbox {
  width: min(960px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--papel);
  color: var(--ciruela);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(43, 18, 64, 0.82);
}

.lightbox[open] {
  animation: abrir 0.2s ease-out;
}

.lightbox img {
  width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  background: #1C0C2A;
}

.lb-cap {
  margin: 0;
  padding: 0.8rem 1.1rem;
  font-weight: 700;
}

.lb-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--papel);
  color: var(--ciruela);
  cursor: pointer;
}

.lb-close svg {
  width: 1.3rem;
  height: 1.3rem;
}

@keyframes abrir {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* Tablet */
@media (min-width: 640px) {
  :root {
    --gutter: 1.5rem;
  }

  .service-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-wide {
    grid-column: span 2;
  }

  .tile-cap {
    font-size: var(--t-sm);
    left: 0.75rem;
    bottom: 0.75rem;
  }
}

/* Escritorio */
@media (min-width: 900px) {
  :root {
    --feston: 26px;
  }

  .nav {
    display: flex;
  }

  /* Sin foto: titular a la izquierda, texto y botones a la derecha */
  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
    column-gap: 3.5rem;
  }

  .hero h1 {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .hero .lead {
    grid-column: 2;
    align-self: end;
    margin-top: 0;
  }

  .hero-actions,
  .hero-place {
    grid-column: 2;
  }

  .mosaic {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .tile-lg {
    grid-row: span 2;
  }

  .tile-lg a {
    aspect-ratio: auto;
  }

  .cotizar-grid {
    grid-template-columns: 1fr 22rem;
    gap: 3rem;
    align-items: start;
  }

  .chat {
    position: sticky;
    top: 6rem;
  }

  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .wa-float {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
