/**
 * Shared layout rhythm: navy bands + soft paper (not harsh white).
 * Link after fonts; each page sets body { background: var(--paper) } in inline CSS.
 */
:root {
  --navy: #0f172a;
  --navy-deep: #0b0e17;
  --paper: #d9dfe8;
  --surface: #ffffff;
}

/* Sticky glass header: translúcido + blur en reposo y al scroll (no se vuelve opaco sólido) */
.nav--navy {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(11, 14, 23, 0.66);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.nav--navy.scrolled {
  background: rgba(11, 14, 23, 0.78);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  border-bottom-color: rgba(255, 255, 255, 0.14);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav--navy {
    background: rgba(11, 14, 23, 0.92);
  }
  .nav--navy.scrolled {
    background: rgba(11, 14, 23, 0.95);
  }
  .nav--navy .nav__mob {
    background: var(--navy-deep);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.nav--navy .nav__logo,
.nav--navy .nav__logo__txt {
  color: #f8fafc;
}
.nav--navy .nav__links a {
  color: rgba(248, 250, 252, 0.72);
}
.nav--navy .nav__links a:hover {
  color: #fff;
}
.nav--navy .nav__phone {
  color: rgba(248, 250, 252, 0.88);
}
.nav--navy .nav__phone:hover {
  color: #fff;
}
.nav--navy .ham span {
  background: #f8fafc;
}
.nav--navy .nav__mob {
  background: rgba(11, 14, 23, 0.92);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-top-color: rgba(255, 255, 255, 0.12);
}
.nav--navy .nav__mob a {
  color: rgba(248, 250, 252, 0.78);
}
.nav--navy .nav__mob a:hover {
  color: #fff;
}

.section-paper {
  background: var(--paper);
  color: var(--txt, #111827);
}
.section-navy {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  color: #f8fafc;
}
.section-navy .h-lg {
  color: #fff;
}
.section-navy .sec-lead {
  color: rgba(255, 255, 255, 0.62);
}

.trust-strip--navy {
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.trust-strip--navy .trust-strip-item {
  color: rgba(248, 250, 252, 0.85);
}

.footer--navy {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(248, 250, 252, 0.65);
}
.footer--navy .footer-links a {
  color: rgba(248, 250, 252, 0.55);
}
.footer--navy .footer-links a:hover {
  color: #fff;
}
.footer--navy .footer-copy {
  color: rgba(248, 250, 252, 0.38);
  border-top-color: rgba(255, 255, 255, 0.1);
}
.footer--navy .footer-copy a {
  color: rgba(248, 250, 252, 0.5);
}
.footer--navy .nav__logo__txt {
  color: #f8fafc;
}

/* ─────────────────────────────────────────────
   BRAND ICON (new Next Phase Solar logo — sun + panels)
   Shared across all nav & footer instances
────────────────────────────────────────────── */
.brand-icon {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}
.footer-logo .brand-icon {
  width: 58px;
  height: 58px;
}
@media (max-width: 600px) {
  .brand-icon { width: 40px; height: 40px; }
  .footer-logo .brand-icon { width: 52px; height: 52px; }
}
.nav__logo .brand-icon {
  transition: transform 0.5s cubic-bezier(0.25, 0.9, 0.3, 1.2);
}
.nav__logo:hover .brand-icon {
  transform: rotate(12deg) scale(1.04);
}

/* ─────────────────────────────────────────────
   Footer accent per page (stronger)
   Each page sets --accent and --accent-rgb in its :root
────────────────────────────────────────────── */
.site-footer {
  border-top-width: 2px !important;
  border-top-style: solid !important;
  border-top-color: rgba(var(--accent-rgb, 255, 172, 0), 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(var(--accent-rgb, 255, 172, 0), 0.18);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 60%);
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb, 255, 172, 0), 0) 0%,
    rgba(var(--accent-rgb, 255, 172, 0), 0.9) 50%,
    rgba(var(--accent-rgb, 255, 172, 0), 0) 100%
  );
  pointer-events: none;
  z-index: 3;
  filter: blur(0.3px);
}
.site-footer .footer-col h4 {
  color: rgba(var(--accent-rgb, 255, 172, 0), 1) !important;
}
.site-footer .footer-logo__txt em {
  color: rgba(var(--accent-rgb, 255, 172, 0), 1) !important;
}
.site-footer .footer-watermark {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb, 255, 172, 0), 0.28) 0%,
    rgba(var(--accent-rgb, 255, 172, 0), 0) 82%
  ) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
.site-footer .footer-meta a:hover {
  color: rgba(var(--accent-rgb, 255, 172, 0), 1);
}
.site-footer .footer-col a:hover {
  color: rgba(var(--accent-rgb, 255, 172, 0), 1) !important;
}

/* ─────────────────────────────────────────────
   MOBILE: Sticky bottom CTA (aparece tras 400px scroll)
────────────────────────────────────────────── */
.sticky-cta {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 16px 20px;
  min-height: 56px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb, 255, 172, 0), 1);
  color: #0b0e17;
  font-family: var(--fh, "Montserrat", "Inter", system-ui, sans-serif);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.22);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 899px) {
  .sticky-cta { display: block; }
}
.sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
}
body[data-keyboard="open"] .sticky-cta,
body[data-form-open] .sticky-cta {
  transform: translateY(140%) !important;
  opacity: 0 !important;
}
.sticky-cta:active {
  transform: translateY(0) scale(0.98);
}

/* ─────────────────────────────────────────────
   MOBILE: Footer accordion (cols → <details>)
────────────────────────────────────────────── */
@media (max-width: 899px) {
  .site-footer .footer-cols {
    display: block !important;
    grid-template-columns: none !important;
  }
  .site-footer .footer-col {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
  }
  .site-footer .footer-col:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .site-footer .footer-col h4 {
    position: relative;
    margin: 0 !important;
    padding: 18px 0;
    min-height: 52px;
    display: flex;
    align-items: center;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    user-select: none;
  }
  .site-footer .footer-col h4::-webkit-details-marker { display: none; }
  .site-footer .footer-col h4::after {
    content: "";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease;
    opacity: 0.8;
  }
  .site-footer .footer-col.is-open h4::after,
  .site-footer details.footer-col[open] > summary::after {
    transform: translateY(-30%) rotate(-135deg);
  }
  .site-footer .footer-col__list {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
  }
  .site-footer .footer-col.is-open .footer-col__list {
    max-height: 340px;
    padding-bottom: 14px;
  }
  .site-footer .footer-col a,
  .site-footer .footer-col span {
    padding: 10px 0 !important;
    font-size: 14px !important;
    min-height: 40px;
    display: flex !important;
    align-items: center;
  }
  .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .site-footer .footer-meta {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ─────────────────────────────────────────────
   MOBILE: Touch targets + safe area
────────────────────────────────────────────── */
@media (max-width: 899px) {
  html { scroll-padding-top: 76px; }
  body { font-size: 16px; }
  input, textarea, select {
    font-size: 16px !important; /* evita zoom iOS Safari */
  }
  .btn, button, .nav__mob a, .faq-q, a.btn {
    min-height: 44px;
  }
}

/* ─────────────────────────────────────────────
   MOBILE: Nav mobile pulido + compact CTA
────────────────────────────────────────────── */
@media (max-width: 899px) {
  /* Compact yellow CTA visible in mobile header */
  .nav--navy .nav__cta {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }
  .nav--navy .nav__cta .nav__phone { display: none; }
  .nav--navy .nav__cta .btn,
  .nav--navy .nav__cta a.btn,
  .nav--navy .nav__cta > a[class*="btn"] {
    padding: 0 12px !important;
    min-height: 38px !important;
    height: 38px !important;
    font-size: 11.5px !important;
    letter-spacing: 0.06em !important;
    line-height: 38px;
    border-radius: 10px;
  }
  .nav--navy .nav__inner { gap: 10px; }
  .nav--navy .nav__mob {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100svh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav--navy .nav__mob .mob-phone {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff !important;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav--navy .nav__mob .mob-phone::before {
    content: "";
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffac00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/></svg>") center/contain no-repeat;
  }
}
body.nav-open { overflow: hidden; }

/* ─────────────────────────────────────────────
   MOBILE: Testimonios carousel (scroll-snap)
────────────────────────────────────────────── */
@media (max-width: 899px) {
  .testimonials-grid,
  .rev-grid,
  .review-grid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px !important;
    padding: 6px 4px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .testimonials-grid::-webkit-scrollbar,
  .rev-grid::-webkit-scrollbar,
  .review-grid::-webkit-scrollbar { display: none; }
  .testimonials-grid > *,
  .rev-grid > *,
  .review-grid > * {
    flex: 0 0 86%;
    scroll-snap-align: center;
  }
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: -4px 0 16px;
  }
  .carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb, 255, 172, 0), 0.25);
    transition: background 0.2s, transform 0.2s;
  }
  .carousel-dot.is-active {
    background: rgba(var(--accent-rgb, 255, 172, 0), 1);
    transform: scale(1.3);
  }
}
@media (min-width: 900px) {
  .carousel-dots { display: none; }
}

/* ─────────────────────────────────────────────
   MOBILE: Secciones single-column uniformes
────────────────────────────────────────────── */
@media (max-width: 899px) {
  .prob-grid,
  .feat-grid,
  .steps,
  .stats-row,
  .trust-row,
  .cards,
  .rev-grid,
  .benefits-grid,
  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .prob-card,
  .feat-card,
  .step,
  .card,
  .stat-card {
    padding: 24px 20px !important;
    border-radius: 16px !important;
  }
  .section { padding: 56px 0 !important; }
  .sec-head { margin-bottom: 32px !important; }
  .h-lg { font-size: clamp(1.9rem, 6vw, 2.4rem) !important; line-height: 1.1 !important; }
  .sec-lead { font-size: 15px !important; line-height: 1.6 !important; }
  /* How-it-works: esconder la l\u00ednea horizontal (solo desktop) */
  .steps::before { display: none !important; }
}

/* ─────────────────────────────────────────────
   MOBILE: Calculadora stack y sliders touch
────────────────────────────────────────────── */
@media (max-width: 899px) {
  .calc-wrap {
    grid-template-columns: 1fr !important;
  }
  .calc-inputs,
  .calc-results {
    padding: 28px 22px !important;
  }
  .calc-cards {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .calc-card { padding: 18px 16px !important; }
  .calc-card__val { font-size: 32px !important; }
  input[type="range"] { height: 8px !important; }
  input[type="range"]::-webkit-slider-thumb { width: 28px !important; height: 28px !important; }
  input[type="range"]::-moz-range-thumb { width: 28px !important; height: 28px !important; }
  .pill { min-height: 44px !important; padding: 0 16px !important; font-size: 14px !important; }
}

/* ─────────────────────────────────────────────
   MOBILE: FAQ accordion polish
────────────────────────────────────────────── */
@media (max-width: 899px) {
  .faq-q, .faq__question {
    min-height: 56px;
    font-size: 16px !important;
    padding: 16px 18px !important;
  }
  .faq-a, .faq__answer {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
}
