/* ==========================================================================
   CulturApp — hoja de estilos
   Réplica en CSS del diseño original de Figma (dandy-float-75073502.figma.site)
   ========================================================================== */

/* ------------------------------ 1. Tokens ------------------------------- */
:root {
  /* Marca */
  --wine:        #8B2835;
  --wine-dark:   #71202b;
  --blue:        #2563EB;
  --blue-dark:   #1D4ED8;

  /* Escala de grises */
  --white:       #FFFFFF;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-300:    #D1D5DB;
  --gray-400:    #9CA3AF;
  --gray-500:    #6B7280;
  --gray-600:    #4B5563;
  --gray-700:    #374151;
  --gray-800:    #1F2937;
  --gray-900:    #111827;
  --yellow-400:  #FACC15;

  /* Tipografía */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji";

  /* Radios */
  --r-lg:  0.5rem;
  --r-xl:  0.75rem;
  --r-2xl: 1rem;
  --r-3xl: 1.5rem;
  --r-full: 9999px;

  /* Sombras */
  --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);

  /* Layout */
  --container: 80rem;   /* 1280px */
  --gutter: 1rem;
}

/* ------------------------------- 2. Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El diseño es solo claro: que el navegador pinte scrollbars y controles a juego. */
  color-scheme: light;
  /* Cabecera sticky arriba y barras fijas abajo: al tabular, que el elemento
     enfocado no quede debajo de ninguna de las dos. */
  scroll-padding-top: 5rem;
  scroll-padding-bottom: 8rem;
}

body {
  margin: 0;
  background-color: var(--white);
  color: var(--gray-900);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Quita el retardo de 300 ms del doble toque y el destello azul de Android. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* El diseño original no usa negritas: todos los títulos van en peso normal. */
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul {
  margin: 0;
  font-weight: 400;
}

/* Evita viudas en los titulares. */
h1, h2, h3 { text-wrap: balance; }

/* El nav es sticky: sin esto, el ancla deja el título debajo de la barra. */
[id] { scroll-margin-top: 5rem; }

ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

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

button, input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Primer tabulador de la página: salta la navegación. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background-color: var(--wine);
  color: var(--white);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  transition: top .15s ease;
}
/* :focus, no :focus-visible: debe aparecer también con foco programático. */
.skip-link:focus { top: 0; }

/* ------------------------------ 3. Iconos ------------------------------- */
.icon { display: block; flex-shrink: 0; }
.icon--16 { width: 1rem;    height: 1rem; }
.icon--20 { width: 1.25rem; height: 1.25rem; }
.icon--24 { width: 1.5rem;  height: 1.5rem; }
.icon--32 { width: 2rem;    height: 2rem; }

/* ----------------------------- 4. Contenedor ---------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 56rem; } /* 896px */

/* ------------------------------ 5. Botones ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--r-lg);
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.btn--primary {
  background-color: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background-color: var(--blue-dark);
  box-shadow: var(--shadow-lg);
}

.btn--md { padding: 0.75rem 1.5rem; }
.btn--lg { padding: 1rem 2rem;    box-shadow: var(--shadow-lg); }
.btn--lg:hover { box-shadow: var(--shadow-xl); }
.btn--xl { padding: 1rem 2.5rem;  font-size: 1.125rem; box-shadow: var(--shadow-xl); }
.btn--xl:hover { box-shadow: var(--shadow-2xl); }

.btn--block { display: flex; width: 100%; padding: 0.75rem 1.5rem; margin-top: 0.5rem; }

.btn__arrow { transition: transform .2s ease; }
.btn--icon:hover .btn__arrow { transform: translateX(0.25rem); }

/* ------------------------------- 6. Navbar ------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.navbar__brand {
  font-size: 1.5rem;
  line-height: 2rem;
  color: var(--wine);
}

.navbar__links { display: none; }

.navbar__links a {
  color: var(--gray-700);
  transition: color .2s ease;
}
.navbar__links a:hover { color: var(--wine); }

.navbar__toggle {
  display: flex;
  padding: 0.5rem;
  color: var(--gray-900);
}

.navbar__mobile {
  border-top: 1px solid var(--gray-200);
  background-color: var(--white);
}

.navbar__mobile-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 1rem 1rem;
}

.navbar__mobile-inner a {
  padding-block: 0.5rem;
  color: var(--gray-700);
}

/* -------------------------------- 7. Hero ------------------------------- */
.hero {
  padding-block: 4rem;
  background-image: linear-gradient(to bottom right, var(--gray-50) 0%, var(--white) 100%);
  /* Los halos decorativos sobresalen 24 px a cada lado; en móvil eso
     desbordaba la página 8 px. `clip` los recorta sin crear scroll. */
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero__content { display: flex; flex-direction: column; gap: 1.5rem; }

.hero__title {
  font-size: 3rem;
  line-height: 1;
  color: var(--wine);
}

.hero__subtitle {
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--gray-600);
}

.hero__actions { padding-top: 1rem; }

.hero__media { position: relative; }

.hero__image-frame {
  position: relative;
  z-index: 1;
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.hero__image-frame img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.hero__glow {
  position: absolute;
  border-radius: var(--r-full);
  opacity: .1;
  filter: blur(64px);
  pointer-events: none;
}

.hero__glow--wine {
  bottom: -1.5rem; left: -1.5rem;
  width: 8rem; height: 8rem;
  background-color: var(--wine);
}

.hero__glow--blue {
  top: -1.5rem; right: -1.5rem;
  width: 10rem; height: 10rem;
  background-color: var(--blue);
}

/* ------------------------------ 8. Secciones ---------------------------- */
.section { padding-block: 5rem; }
.section--white { background-color: var(--white); }
.section--gray  { background-color: var(--gray-50); }

.section__head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
  text-align: center;
}

.section__title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  color: var(--wine);
}

.section__subtitle {
  max-width: 42rem;
  margin-inline: auto;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--gray-600);
}

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

/* ------------------------------- 9. Cards ------------------------------- */
.card {
  padding: 2rem;
  background-color: var(--gray-50);
  border-radius: var(--r-xl);
}

.card--feature { transition: box-shadow .2s ease; }
.card--feature:hover { box-shadow: var(--shadow-lg); }

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--blue);
  color: var(--white);
  border-radius: var(--r-lg);
  transition: transform .2s ease;
}
.card--feature:hover .card__icon { transform: scale(1.1); }

.card__title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--gray-900);
}

.card__text { color: var(--gray-600); }

/* Testimonios */
.card--quote { margin: 0; }

.stars { display: flex; gap: 0.25rem; margin-bottom: 1rem; }
.stars svg { width: 1.25rem; height: 1.25rem; fill: var(--yellow-400); color: var(--yellow-400); }

.card__quote {
  margin: 0 0 1.5rem;
  color: var(--gray-700);
}

.person { display: flex; align-items: center; gap: 0.75rem; }

.person__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  background-color: var(--wine);
  color: var(--white);
  border-radius: var(--r-full);
}

.person__name { display: block; color: var(--gray-900); }
.person__role {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-500);
}

/* ----------------------- 10. Cómo funciona (split) ---------------------- */
.split {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.split__media {
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.split__media img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.split__content { display: flex; flex-direction: column; gap: 2rem; }

.steps { display: flex; flex-direction: column; gap: 2rem; }

.step { display: flex; gap: 1rem; }

.step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--blue);
  color: var(--white);
  border-radius: var(--r-full);
}

.step__title {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--gray-900);
}

.step__text { color: var(--gray-600); }

/* ----------------------------- 11. Métricas ----------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  text-align: center;
}

.stat__value {
  margin-bottom: 0.5rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  color: var(--wine);
  /* Cifras de la misma anchura: la fila no baila al cambiar. */
  font-variant-numeric: tabular-nums;
}

.stat__label { margin: 0; color: var(--gray-600); }

/* -------------------------------- 12. CTA ------------------------------- */
.cta {
  padding-block: 5rem;
  background-color: var(--wine);
  color: var(--white);
  text-align: center;
}

.cta__title { font-size: 2.25rem; line-height: 2.5rem; }

.cta__text {
  margin-top: 2rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: rgb(255 255 255 / .9);
}

.cta__actions { margin-top: 3rem; }

/* ------------------------------ 13. Footer ------------------------------ */
.footer {
  padding-block: 3rem;
  background-color: var(--gray-900);
  color: var(--white);
}

.footer__grid { display: grid; gap: 2rem; }

.footer__brand { display: flex; flex-direction: column; gap: 1rem; }

.footer__logo { font-size: 1.5rem; line-height: 2rem; }

.footer__about {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-400);
}

.footer__social { display: flex; gap: 1rem; }
.footer__social a { color: var(--gray-400); transition: color .2s ease; }
.footer__social a:hover { color: var(--white); }

.footer__heading {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-400);
}

.footer__list a { transition: color .2s ease; }
.footer__list a:hover { color: var(--white); }

.footer__contact { display: flex; align-items: center; gap: 0.5rem; }

.footer__bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-800);
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-400);
}

/* ---------------------------- 14. Chat widget --------------------------- */
.chat-fab {
  position: fixed;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background-color: var(--blue);
  color: var(--white);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-2xl);
  transition: transform .2s ease, background-color .2s ease;
}
.chat-fab:hover { transform: scale(1.1); }

.chat {
  position: fixed;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(24rem, calc(100vw - 2rem));
  height: min(600px, calc(100dvh - 3rem - env(safe-area-inset-bottom)));
  background-color: var(--white);
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  animation: chat-in .18s ease-out;
}

@keyframes chat-in {
  from { opacity: 0; transform: translateY(0.75rem) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  background-color: var(--wine);
  color: var(--white);
}

.chat__identity { display: flex; align-items: center; gap: 0.75rem; }

.chat__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgb(255 255 255 / .2);
  border-radius: var(--r-full);
}

.chat__title { font-size: 1rem; line-height: 1.5rem; }

.chat__status {
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(255 255 255 / .8);
}

.chat__close {
  padding: 0.375rem;
  color: var(--white);
  border-radius: var(--r-lg);
  transition: background-color .2s ease;
}
.chat__close:hover { background-color: rgb(255 255 255 / .2); }

.chat__messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  /* Que el scroll del chat no arrastre la página de debajo. */
  overscroll-behavior: contain;
  background-color: var(--gray-50);
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 0.75rem; animation: msg-in .2s ease-out; }
.msg--user { flex-direction: row-reverse; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(0.375rem); }
  to   { opacity: 1; transform: none; }
}

.msg__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-full);
}
.msg--bot  .msg__avatar { background-color: var(--gray-200); color: var(--gray-700); }
.msg--user .msg__avatar { background-color: var(--wine);     color: var(--white); }

.msg__bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: var(--r-2xl);
}
.msg--bot  .msg__bubble { background-color: var(--white); color: var(--gray-900); }
.msg--user .msg__bubble { background-color: var(--wine);  color: var(--white); }

.msg__text { font-size: 0.875rem; line-height: 1.25rem; }

.msg__time {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
}
.msg--bot  .msg__time { color: var(--gray-500); }
.msg--user .msg__time { color: rgb(255 255 255 / .7); }

.chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--white);
  border-top: 1px solid var(--gray-200);
}

.chip {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--wine);
  border: 2px solid var(--wine);
  border-radius: var(--r-full);
  transition: background-color .2s ease;
}
.chip:hover { background-color: var(--gray-50); }

.chat__form {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 1rem;
  background-color: var(--white);
  border-top: 1px solid var(--gray-200);
}

.chat__input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--r-2xl);
  background-color: var(--white);
}
.chat__input:focus-visible {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgb(139 40 53 / .25);
}

.chat__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  background-color: var(--blue);
  color: var(--white);
  border-radius: var(--r-2xl);
  transition: background-color .2s ease, opacity .2s ease;
}
.chat__send:hover:not(:disabled) { background-color: var(--blue-dark); }
.chat__send:disabled { opacity: .5; cursor: not-allowed; }

[hidden] { display: none !important; }

/* --------------------------- 15. Breakpoints ---------------------------- */

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

/* md — 768px */
@media (min-width: 768px) {
  .navbar__links {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  .navbar__toggle { display: none; }
  .navbar__mobile { display: none !important; }

  .hero { padding-block: 6rem; }
  .hero__grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__title { font-size: 3.75rem; }

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

  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .cta__title { font-size: 3rem; line-height: 1; }

  .footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* lg — 1024px */
@media (min-width: 1024px) {
  :root { --gutter: 2rem; }
}

/* Pantallas pequeñas: el chat ocupa casi todo el alto disponible */
@media (max-width: 480px) {
  .chat { right: 1rem; left: 1rem; bottom: 1rem; width: auto; }
}

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
