/* Tikout — base responsive + media queries.
   Los estilos inline del bundle de Claude Design tienen especificidad
   máxima, así que las reglas por breakpoint usan `!important` a
   propósito para override predecible. */

/* ── Reset ligero ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; }
/* dc-runtime pins <body> to 100vh (a leftover from its "loading
   screen" flex centering). Force it back to auto so the page can
   scroll normally — without this, window.scrollY caps at the size
   of the initial viewport regardless of content height. */
body { height: auto !important; min-height: 0 !important; }
/* No overflow-x: hidden safety net — every section keeps
   scrollWidth === innerWidth on its own, and enabling it turns
   html/body into a scroll container that breaks scrollTo. */
img, video, iframe, svg { max-width: 100%; height: auto; }

/* Sin zoom en iOS: form controls siempre ≥16px + altura táctil */
input, textarea, select { font-size: 16px !important; }
input, select { min-height: 44px !important; }

/* Tipografía fluida global — el desktop sigue igual, el móvil escala */
h1 { font-size: clamp(32px, 8vw, 62px) !important; line-height: 1.08 !important; }
h2 { font-size: clamp(26px, 6vw, 44px) !important; line-height: 1.15 !important; }

/* ── Header (index) ────────────────────────────────────────────── */
#site-nav-hamburger { display: none; }

@media (max-width: 900px) {
  #site-header .header-inner { position: relative; }
  #site-nav-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid #B9C4BD; border-radius: 10px;
    background: transparent; cursor: pointer; padding: 0;
    font-size: 22px; color: #16211C; line-height: 1;
  }
  #site-nav-links {
    position: absolute !important; top: 100% !important; left: 0 !important; right: 0 !important;
    background: rgba(250,249,245,0.98); backdrop-filter: blur(8px);
    border-bottom: 1px solid #E3E7E2; box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    padding: 8px 20px 20px !important; gap: 0 !important;
    flex-direction: column !important; align-items: stretch !important;
    display: none !important;
  }
  #site-nav-links.is-open { display: flex !important; }
  /* dc-runtime strips <sc-if> from the DOM, so the direct child of
     #site-nav-links is the language block's inner <div>. Force it
     to column so the row of links reflows vertically in the dropdown. */
  #site-nav-links > div {
    display: flex !important; flex-direction: column !important;
    align-items: stretch !important; gap: 0 !important; width: 100%;
  }
  #site-nav-links a {
    display: block !important;
    padding: 14px 4px !important; border-bottom: 1px solid #E3E7E2;
    font-size: 16px !important;
  }
  #site-nav-links > div a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  #site-header .header-inner { padding: 12px 16px !important; gap: 10px !important; }
  #site-header .header-inner > div:last-child { gap: 8px !important; }
  #site-header .header-inner > div:first-child { font-size: 18px !important; letter-spacing: 0.18em !important; }
  #site-header a[href="#contratar"] { padding: 9px 14px !important; font-size: 13px !important; }
  #site-header [style*="border-radius: 100px"][style*="IBM Plex Mono"] { font-size: 12px !important; }
  #site-header [style*="border-radius: 100px"][style*="IBM Plex Mono"] > div { padding: 5px 10px !important; }
  #site-nav-hamburger { width: 40px !important; height: 40px !important; font-size: 20px !important; }
}

@media (max-width: 400px) {
  #site-header a[href="#contratar"] { padding: 8px 12px !important; font-size: 12px !important; }
  #site-header .header-inner > div:first-child { font-size: 16px !important; letter-spacing: 0.16em !important; }
}

/* ── Hero: background image full-bleed + overlays ──────────────── */
#hero-section {
  background: url('../img/hero-bg.webp') center 60% / cover no-repeat;
  isolation: isolate;
  min-height: 92vh;
  display: flex;
  align-items: center;
}
/* Diagonal cream veil: solid on the copy (top-left), fading to the
   right and down so the landscape reads on the right. Meets AA on
   the H1/paragraph area even against the darkest patches. */
#hero-section::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(250,249,245,0.92) 0%,
    rgba(250,249,245,0.78) 22%,
    rgba(250,249,245,0.42) 46%,
    rgba(250,249,245,0.08) 68%,
    rgba(250,249,245,0)    88%
  );
}
/* Clean cut between the hero and the dark Sostenibilidad section
   below — a fade to white would flash between the cream landscape
   and the forest overlay; a fade to #14211C reads as "something
   broke" against the bright hero. Straight edge is the calmest
   join here. */

@media (max-width: 640px) {
  #hero-section {
    background-image: url('../img/hero-bg-mobile.webp');
    background-position: center bottom;
  }
  /* Vertical veil for mobile: cream at the top for the copy, image
     fully visible at the bottom. */
  #hero-section::before {
    background: linear-gradient(
      180deg,
      rgba(250,249,245,0.96) 0%,
      rgba(250,249,245,0.78) 35%,
      rgba(250,249,245,0.28) 65%,
      rgba(250,249,245,0)    92%
    );
  }
}

/* ── Hero content ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  #hero-section { min-height: 80vh; }
  #hero-row {
    flex-direction: column !important; gap: 40px !important;
    padding: 60px 20px !important; align-items: stretch !important;
  }
  #hero-row > div { flex: 1 1 100% !important; }
  .hero-cta-row {
    flex-direction: column !important; align-items: stretch !important;
    gap: 12px !important;
  }
  .hero-cta-row a {
    text-align: center !important;
    padding: 16px 24px !important;
    min-height: 52px;
    display: flex !important; align-items: center; justify-content: center;
  }
}
@media (max-width: 640px) {
  /* Mobile: natural content height, no vh, fixed 64 px vertical padding. */
  #hero-section { min-height: 0; display: block; }
  #hero-row { padding: 64px 20px !important; }
}

/* ── Cómo funciona ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  #como > div { padding: 60px 20px !important; }
  #como-cards { flex-wrap: wrap !important; gap: 20px !important; }
  #como-cards > div { flex: 1 1 calc(50% - 10px) !important; }
}
@media (max-width: 640px) {
  #como-cards > div { flex: 1 1 100% !important; }
}

/* ── Beneficios (lista + calculadora) ──────────────────────────── */
@media (max-width: 1024px) {
  #beneficios {
    flex-direction: column !important; gap: 40px !important;
    padding: 60px 20px !important; align-items: stretch !important;
  }
  #beneficios > div { flex: 1 1 100% !important; }
}
@media (max-width: 640px) {
  #beneficios { padding: 48px 16px !important; }
  #calc-inner { padding: 28px 24px !important; }
  #calc-headline { font-size: 44px !important; }
  #calc-stats-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
}

/* ── Testimonio ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #testimonio-inner { padding: 88px 20px !important; }
  #testimonio-quote { font-size: 22px !important; line-height: 1.5 !important; }
}
@media (max-width: 640px) {
  #testimonio-inner { padding: 64px 16px !important; }
}

/* ── Sostenibilidad: forest background + dark overlay ──────────── */
#sost-section {
  background: url('../img/sostenibilidad-bg.webp') center / cover no-repeat;
  isolation: isolate;
}
#sost-section::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(20,33,28,0.72) 0%,
    rgba(20,33,28,0.55) 100%);
}
@media (max-width: 640px) {
  #sost-section { background-image: url('../img/sostenibilidad-bg-mobile.webp'); }
}

/* Data-viz cards on top of the forest */
.sost-card {
  flex: 1 1 0;
  display: flex; align-items: center; gap: 20px;
  background: rgba(250,249,245,0.10);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(250,249,245,0.25);
  border-radius: 16px;
  padding: 24px 22px;
}
.sost-donut {
  position: relative; flex-shrink: 0;
  width: 96px; height: 96px;
}
.sost-donut-svg { width: 100%; height: 100%; display: block; }
.sost-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
}
.sost-body { display: flex; flex-direction: column; min-width: 0; }
.sost-num {
  font-size: 34px; font-weight: 900; letter-spacing: -0.01em;
  color: #FAF9F5; line-height: 1; font-variant-numeric: tabular-nums;
}
.sost-desc {
  margin-top: 8px;
  font-size: 15px; line-height: 1.5;
  color: rgba(250,249,245,0.80);
}

@media (max-width: 900px) {
  #sostenibilidad { padding: 96px 20px !important; }
  #sost-cards { flex-wrap: wrap !important; gap: 16px !important; }
  .sost-card { flex: 1 1 calc(50% - 8px) !important; padding: 20px !important; gap: 16px; }
  .sost-donut { width: 72px; height: 72px; }
  .sost-icon { width: 30px; height: 30px; }
  .sost-num { font-size: 28px; }
}
@media (max-width: 640px) {
  .sost-card { flex: 1 1 100% !important; }
  #sostenibilidad { padding: 72px 16px !important; }
  #sost-section { min-height: 0 !important; }
}

/* Respect reduced motion: land straight on the final state */
@media (prefers-reduced-motion: reduce) {
  .sost-ring { transition: none !important; }
}

/* ── Precios ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #contratar > div { padding: 60px 20px !important; }
  #precios-cards > div { padding: 32px 24px !important; }
}
@media (max-width: 640px) {
  #contratar > div { padding: 48px 16px !important; }
  #precios-cards > div { padding: 28px 20px !important; }
}

/* ── FAQ ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #faq { padding: 60px 20px !important; }
}
@media (max-width: 640px) {
  #faq details { padding: 16px 18px !important; }
  #faq summary { font-size: 16px !important; }
}

/* ── Contacto ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  #contacto-row {
    flex-direction: column !important; gap: 40px !important;
    padding: 60px 20px !important;
  }
  #contacto-row > div { flex: 1 1 100% !important; }
}
@media (max-width: 640px) {
  #contacto-row { padding: 48px 16px !important; }
}

/* ── Footer ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #site-footer > div {
    flex-direction: column !important; align-items: flex-start !important;
    padding: 32px 20px !important; gap: 16px !important;
  }
}

/* ── Legal pages (privacidad, terminos) ────────────────────────── */
@media (max-width: 640px) {
  .legal-wrap { padding: 40px 20px 80px !important; }
  .legal-wrap h1 { font-size: clamp(28px, 8vw, 38px) !important; }
  .legal-wrap .card { padding: 18px 20px !important; }
}
