/* ---------- Base ---------- */
:root {
  --navy: #0f2340;
  --blue: #2f7fd8;
  --blue-light: #7cc4ff;
  --text: #1a2433;
  --muted: #5b6675;
  --light: #f4f6f9;
  --font-serif: "EB Garamond", Georgia, serif;
  --font-sans: "Inter", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* The site is designed light only. Without these, a phone or browser in
   dark mode paints a black background behind the dark text. */
html {
  color-scheme: light;
  background: white;
}

body {
  font-family: var(--font-serif);
  color: var(--text);
  background: white;
  line-height: 1.6;
}

/* Parts waiting for real content (photos, products, packages, videos).
   Remove data-later from the HTML to show one again. */
[data-later] {
  display: none !important;
}

/* Small uppercase label used above headings */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.section-title {
  font-weight: 500;
  font-size: 2.5rem;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 3rem;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1.5rem 3rem;
  background: transparent;
  transition:
    background 0.3s ease,
    padding 0.3s ease,
    box-shadow 0.3s ease;
}

/* Added by JS once the page is scrolled (touch 1) */
.site-header.scrolled {
  padding: 0.9rem 3rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 12px rgba(15, 35, 64, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--navy);
}

.logo {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.2em;
}

/* The X is an SVG, sized to match the height of the capital letters */
.logo-x {
  width: 0.85em;
  height: 0.73em;
  vertical-align: baseline;
}

.tagline {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

/* "Integrated Energy." and "Intelligent Solutions." can each take a line */
.tagline span {
  display: inline-block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto; /* pushes the nav (and everything after it) to the right */
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  white-space: nowrap; /* "Cómo Trabajamos" never breaks onto two lines */
  padding-bottom: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  border-bottom-color: var(--blue);
}

/* "Calcula tu ahorro": the highlighted button on every page (the calculator
   is the star of the site). It's first in the HTML, so keyboard and screen
   reader users reach it first; order: 1 shows it at the END of the laptop menu. */
.nav-link.nav-calc {
  order: 1;
  padding: 0.6rem 1.15rem;
  border: none;
  border-radius: 999px;
  background: #2569b8; /* a darker blue than --blue: white text stays readable (5.5:1) */
  color: white;
  box-shadow: 0 4px 14px rgba(47, 127, 216, 0.35);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.nav-link.nav-calc:hover {
  background: var(--navy);
  transform: translateY(-1px);
}

/* Language switch + menu button, separated from the nav by a thin line */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 2rem;
  border-left: 1px solid rgba(15, 35, 64, 0.15);
}

/* Language switch: both languages visible, a navy pill slides
   behind the active one. JS sets data-active="en" or "es". */
.lang-switch {
  position: relative;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(15, 35, 64, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
}

/* The sliding pill. ::before draws it without extra HTML. */
.lang-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 2px 8px rgba(15, 35, 64, 0.3);
}

/* Added by JS after load, so the pill only animates on clicks */
.lang-switch.animated::before {
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.lang-switch[data-active="es"]::before {
  transform: translateX(100%);
}

.lang-option {
  position: relative; /* sits above the pill */
  width: 2.5rem;
  padding: 0.4rem 0 0.4rem 0.14em; /* left padding balances letter-spacing */
  text-align: center;
  color: var(--muted);
  transition: color 0.4s ease;
}

.lang-switch[data-active="en"] .lang-option:first-child,
.lang-switch[data-active="es"] .lang-option:last-child {
  color: white;
}

.lang-switch:hover {
  border-color: rgba(15, 35, 64, 0.35);
}

/* Hamburger button: two lines that turn into an X. Hidden on desktop. */
.menu-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  position: absolute;
  left: 9px;
  width: 22px;
  height: 1.5px;
  background: var(--navy);
  transition:
    transform 0.3s ease,
    top 0.3s ease;
}

.menu-toggle span:first-child {
  top: 15px;
}

.menu-toggle span:last-child {
  top: 24px;
}

.nav-open .menu-toggle span:first-child {
  top: 19.5px;
  transform: rotate(45deg);
}

.nav-open .menu-toggle span:last-child {
  top: 19.5px;
  transform: rotate(-45deg);
}

/* Stops the page behind from scrolling while the menu or modal is open */
body.no-scroll {
  overflow: hidden;
}

/* Visible outline for keyboard users only (not on mouse clicks) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Pages without a full-screen hero: push content below the fixed header */
.page-content {
  padding-top: 7rem;
}

.page-content h1 {
  font-weight: 500;
  font-size: 2.75rem;
  line-height: 1.2;
  color: var(--navy);
  text-align: center;
  margin-bottom: 1rem;
}

/* ---------- Hero (home page) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* phones: the screen without the address bar (older browsers use the line above) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 7rem;
  background-image: url("../assets/images/hero-home.webp");
  background-size: cover;
  background-position: center;
}

/* Soft light fade on the left so the text is readable (touch 2) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.6) 30%,
    rgba(255, 255, 255, 0) 60%
  );
}

.hero-content {
  position: relative;
  max-width: 540px;
}

.hero-word {
  font-weight: 500;
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.phonetic {
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 0.5rem;
}

.definition {
  margin-top: 1.25rem;
  font-size: 1.2rem;
}

.def-type {
  font-style: italic;
  color: var(--muted);
}

.def-key {
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--navy);
}

/* Only show the definition for the active language.
   applyLanguage() sets <html lang="...">, so CSS can react to it. */
html[lang="es"] .def-en,
html:not([lang="es"]) .def-es {
  display: none;
}

/* Animated flowing line (touch 4) */
.flow-line {
  width: 220px;
  height: 2px;
  margin: 2rem 0;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--blue),
    var(--blue-light),
    var(--blue),
    transparent
  );
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(47, 127, 216, 0.6);
  animation: flow 3s linear infinite;
}

@keyframes flow {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: 0 0;
  }
}

.statements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.statement-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.statement p {
  font-size: 1.1rem;
  line-height: 1.5;
}

/* "Calcula tu ahorro" under Mission / Vision: scrolls to the calculator */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.25rem;
  padding: 1rem 1.9rem;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 35, 64, 0.25);
}

.hero-cta::after {
  content: "→";
  transition: transform 0.2s ease;
}

.hero-cta:hover::after {
  transform: translateX(4px);
}

.hero-bottom {
  position: absolute;
  left: 3rem;
  right: 7rem; /* leaves room for the assistant button in the corner */
  bottom: 1.75rem; /* lines up with the assistant button */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-sign {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.hero-sign::before {
  content: "";
  width: 48px;
  height: 1px;
  background: var(--navy);
}

/* Staggered fade-in on load (touch 3).
   Each element sets --d (its order); the delay is --d times 0.15s. */
.reveal {
  opacity: 0;
  animation: fade-up 0.8s ease forwards;
  animation-delay: calc(var(--d, 0) * 0.15s);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in on scroll. JS adds .in-view when the element enters the screen.
   Only hidden when JS runs (html.js), so the content never gets stuck invisible.
   "backwards" applies the start of the animation during the delay but
   releases it at the end, so hover effects (transform) keep working. */
.js .scroll-reveal:not(.in-view) {
  opacity: 0;
}

.scroll-reveal.in-view {
  animation: fade-up 0.7s ease backwards;
  animation-delay: calc(var(--d, 0) * 0.12s);
}

/* ---------- Explore cards (touch 6) ---------- */
.explore {
  padding: 6rem 3rem;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.feature-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 10px rgba(15, 35, 64, 0.08);
  text-decoration: none;
  color: var(--text);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 35, 64, 0.14);
}

/* Placeholder images: different crops of the hero photo until real photos
   arrive. Shared by the home cards, product cards and product modal. */
.feature-img,
.product-img,
.modal-img {
  height: 180px;
  background-image: url("../assets/images/hero.webp");
  background-size: 300%;
}

.img-panels {
  background-position: 5% 90%;
}

.img-sun {
  background-position: 50% 55%;
}

.img-equipment {
  background-position: 95% 70%;
}

.img-sky {
  background-position: 90% 15%;
}

/* Icon at the top of each home card (used while the photos are hidden) */
.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: var(--light);
  color: var(--blue);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

/* flex: 1 makes every card body fill the card, so "Learn more" lines up */
.feature-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
}

.feature-body h3 {
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.feature-link {
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- Home videos ---------- */
.videos {
  padding: 0 3rem 6rem;
  text-align: center;
}

.videos .section-title {
  margin-bottom: 0.75rem;
}

.videos-intro {
  margin-bottom: 2.5rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Vertical cards (9:16), like phone videos and reels */
.video-card {
  position: relative;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  background: var(--navy);
  color: white;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.video-card:disabled {
  cursor: default;
}

/* The preview image. No background-position here on purpose:
   the img-* crop classes (or JS, for real posters) set it. */
.video-poster {
  position: absolute;
  inset: 0;
  background-image: url("../assets/images/hero.webp");
  background-size: cover;
  transition: transform 0.6s ease;
}

.video-card:not(:disabled):hover .video-poster {
  transform: scale(1.05);
}

.video-card:disabled .video-poster {
  filter: grayscale(0.3) brightness(0.85);
}

/* Dark fade at the bottom so the white text is readable */
.video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 35, 64, 0.88) 0%,
    rgba(15, 35, 64, 0.15) 50%,
    transparent 70%
  );
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translate(-50%, -50%); /* centers it exactly */
  transition: transform 0.3s ease;
}

.video-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px; /* the triangle looks centered when nudged right */
}

.video-card:hover .video-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.video-soon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.video-info {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.video-tag {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.video-title {
  font-size: 1.25rem;
  line-height: 1.25;
}

/* Full-screen player (created by script.js) */
.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(5, 12, 24, 0.92);
}

.video-overlay.active {
  display: flex;
}

.video-frame video {
  display: block;
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
  background: black;
}

/* YouTube players need a set size: 16:9 that fits the screen */
.video-frame.is-youtube {
  width: min(92vw, calc(86vh * 16 / 9));
  aspect-ratio: 16 / 9;
}

.video-frame.is-youtube iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

.video-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Closing call to action ---------- */
.cta {
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 5rem 2rem;
}

.cta h2 {
  font-weight: 500;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.cta p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2rem;
}

/* Every .cta-btn opens WhatsApp, so they all get the WhatsApp icon */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  background: #25d366;
  color: white;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
}

/* While WhatsApp is switched off (FEATURES.whatsapp in script.js) the big
   buttons ask for a quote: blue, no WhatsApp icon. #2569b8 keeps white
   text readable (5.5:1). */
.cta-btn.cta-quote {
  background: #2569b8;
}

.cta-btn.cta-quote::before {
  display: none;
}

/* Hidden WhatsApp links stay hidden even where a rule sets display */
[data-contact="whatsapp"][hidden] {
  display: none;
}

/* Contact page with WhatsApp off: the email card alone, centered */
.contact-grid:has([data-contact="whatsapp"][hidden]) {
  grid-template-columns: minmax(0, 380px);
  justify-content: center;
}

/* The icon is the WhatsApp shape used as a mask: the button's text color
   (currentColor) shows through it. The SVG is written inside the url()
   as a "data URI", so no extra file has to load. */
.cta-btn::before {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z'/%3E%3C/svg%3E");
  -webkit-mask: var(--wa-icon) center / contain no-repeat;
  mask: var(--wa-icon) center / contain no-repeat;
}

/* ---------- Inner page intro (process, about) ---------- */
.page-intro {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 2rem 3rem;
}

.page-intro p:last-child {
  font-size: 1.2rem;
  color: var(--muted);
}

/* ---------- How We Work ---------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 0 3rem 6rem;
}

.step {
  border-top: 2px solid var(--blue);
  padding-top: 1.5rem;
}

.step-number {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--blue);
}

.step h2 {
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--navy);
  margin: 0.5rem 0;
}

/* ---------- Savings calculator (home page, right under the hero) ---------- */
.hero + .calculator {
  margin-top: 5rem;
}

.calculator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  margin: 0 auto 6rem;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 40px rgba(15, 35, 64, 0.12);
  scroll-margin-top: 6rem; /* the fixed header doesn't cover it when linked to */
}

.calc-inputs {
  padding: 3rem;
}

.calc-inputs h2 {
  font-weight: 500;
  font-size: 2.25rem;
  line-height: 1.2;
  color: var(--navy);
}

.calc-intro {
  margin: 0.5rem 0 2.5rem;
  color: var(--muted);
}

.calc-field {
  margin-bottom: 2rem;
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.calc-label-row label,
.calc-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.calc-label {
  margin-bottom: 0.75rem;
}

.calc-value {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--navy);
}

/* Typed bill amount: looks like the big number, with an underline */
.calc-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #d5dae2;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--navy);
  transition: border-color 0.2s ease;
}

/* :focus-within = while the input inside it is being typed in */
.calc-input-wrap:focus-within {
  border-bottom-color: var(--blue);
}

/* "kWh" after the typed number, smaller than the number itself */
.calc-unit {
  margin-left: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* "6 paneles de 630 W" and "3.78 kWp" on two lines (the text has a line break) */
#calc-system {
  white-space: pre-line;
}

/* Numbered steps: 1 (usage), 2 (coverage), 3 (result) */
.calc-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}

.calc-step-num {
  flex-shrink: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 0.78rem;
  letter-spacing: 0;
}

/* Step 3 sits on the navy results panel */
.calc-step-dark {
  margin-bottom: 1.25rem;
  color: white;
}

.calc-step-dark .calc-step-num {
  background: var(--blue-light);
  color: var(--navy);
}

/* "Sé mis kWh" / "Sé cuánto pago" switch */
.calc-mode {
  display: inline-flex;
  margin-bottom: 1.1rem;
  padding: 4px;
  border-radius: 999px;
  background: var(--light);
}

.calc-mode-btn {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.calc-mode-btn.active {
  background: var(--navy);
  color: white;
}

/* "$" before the typed amount in "Sé cuánto pago" mode */
.calc-prefix {
  margin-right: 0.1rem;
}

/* "¿Dónde lo encuentro?" link-style button; the arrow turns when open */
.calc-where {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding: 0.25rem 0;
  border: none;
  background: none;
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.calc-where::after {
  content: "▾";
  transition: transform 0.25s ease;
}

.calc-where[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* The drawn sample bill */
.calc-bill-help {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--light);
  animation: fade-up 0.35s ease;
}

.calc-bill-help svg {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  font-family: var(--font-sans);
}

.bill-paper {
  fill: white;
  stroke: #d5dae2;
}

.bill-band {
  fill: #1a9e5c;
}

.bill-title {
  fill: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.bill-line {
  fill: #e5e8ed;
}

.bill-row text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.bill-row .bill-value {
  font-size: 13px;
  font-weight: 700;
}

.bill-hl {
  fill: transparent;
  stroke: transparent;
  transition:
    fill 0.3s ease,
    stroke 0.3s ease;
}

/* Highlight the line the visitor needs: kWh, or the total to pay in $ mode */
.calc-bill-help[data-mode="kwh"] .bill-kwh .bill-hl,
.calc-bill-help[data-mode="usd"] .bill-total .bill-hl {
  fill: rgba(47, 127, 216, 0.12);
  stroke: var(--blue);
  stroke-width: 2;
}

.calc-bill-help[data-mode="kwh"] .bill-kwh text,
.calc-bill-help[data-mode="usd"] .bill-total text {
  fill: var(--navy);
}

.calc-bill-caption {
  margin-top: 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-align: center;
  color: var(--text);
}

/* Coverage quick picks: 50 / 75 / 100 % */
.calc-quick-row {
  display: flex;
  gap: 0.4rem;
}

.calc-quick {
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(15, 35, 64, 0.18);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.calc-quick:hover {
  border-color: var(--navy);
}

.calc-quick.active {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.calc-number {
  width: 6ch;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: right;
  outline: none;
  -moz-appearance: textfield; /* hides the up/down arrows in Firefox */
  appearance: textfield;
}

/* Hides the up/down arrows in Chrome, Edge, Opera and Safari */
.calc-number::-webkit-inner-spin-button,
.calc-number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Custom slider. "appearance: none" removes the browser's default look.
   The input itself is 32px tall and invisible, so it's easy to grab with a
   finger; the thin visible track is drawn inside it (the -track rules below).
   --fill is set by JS so the track is colored up to the handle. */
.calc-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: grab;
}

.calc-field input[type="range"]:active {
  cursor: grabbing;
}

/* The track: a blue-to-light-blue gradient up to the handle, gray after it.
   Chrome/Edge/Opera/Safari draw it with one background... */
.calc-field input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--blue), var(--blue-light)) 0 0 / var(--fill, 50%) 100% no-repeat,
    #e5e8ed;
}

/* ...Firefox has a separate "progress" part for the filled side */
.calc-field input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e8ed;
}

.calc-field input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
}

/* The handle: white with a blue center dot. It grows a soft blue halo on
   hover and gets bigger while you drag it. margin-top centers the 26px
   handle on the 8px track: (8 - 26) / 2 = -9px. */
.calc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue) 0 4px, white 4.5px);
  box-shadow:
    0 2px 10px rgba(15, 35, 64, 0.28),
    0 0 0 0 rgba(47, 127, 216, 0);
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;
}

.calc-field input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue) 0 4px, white 4.5px);
  box-shadow:
    0 2px 10px rgba(15, 35, 64, 0.28),
    0 0 0 0 rgba(47, 127, 216, 0);
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;
}

.calc-field input[type="range"]:hover::-webkit-slider-thumb,
.calc-field input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 2px 10px rgba(15, 35, 64, 0.28),
    0 0 0 7px rgba(47, 127, 216, 0.14);
}

.calc-field input[type="range"]:hover::-moz-range-thumb,
.calc-field input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow:
    0 2px 10px rgba(15, 35, 64, 0.28),
    0 0 0 7px rgba(47, 127, 216, 0.14);
}

.calc-field input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow:
    0 4px 14px rgba(15, 35, 64, 0.3),
    0 0 0 10px rgba(47, 127, 216, 0.18);
}

.calc-field input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow:
    0 4px 14px rgba(15, 35, 64, 0.3),
    0 0 0 10px rgba(47, 127, 216, 0.18);
}

/* The halo replaces the default focus outline on the slider */
.calc-field input[type="range"]:focus {
  outline: none;
}

/* Results side: navy panel */
.calc-results {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 3rem;
  background: var(--navy);
  color: white;
}

.calc-results-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.calc-big {
  font-size: 4rem;
  font-weight: 500;
  line-height: 1.1;
  margin: 0.25rem 0 0.5rem;
}

/* "Pagarías unos $64 al mes en lugar de $160." */
.calc-sentence {
  margin-bottom: 1.75rem;
  font-size: 1.2rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.calc-bars {
  width: 100%;
  display: grid;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.calc-bar-row {
  display: grid;
  grid-template-columns: 5rem 1fr 4.5rem;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.calc-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.calc-bar span {
  display: block;
  height: 100%;
  border-radius: 5px;
}

.bar-now {
  width: 100%;
  background: rgba(255, 255, 255, 0.45);
}

/* Same timing and easing as the numbers (animateNumber in script.js),
   so the bar and the amounts move together */
.bar-after {
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.calc-bar-value {
  text-align: right;
  font-weight: 600;
  color: white;
}

.calc-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.calc-stats dt {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.calc-stats dd {
  font-size: 1.35rem;
  font-weight: 500;
}

.calc-results .cta-btn {
  margin-top: 2rem;
}

/* Recommended products (hidden until turned on in script.js) */
.calc-recommend {
  width: 100%;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.calc-recommend-list {
  list-style: none;
  margin-top: 0.75rem;
}

.calc-recommend-list li,
.calc-recommend-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.calc-recommend-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.calc-recommend-total {
  font-weight: 600;
}

.calc-note {
  margin-top: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
}

/* Band on the Solutions page that links to the calculator */
.calc-promo {
  max-width: 1100px;
  margin: 0 auto 6rem;
  padding: 3rem;
  border-radius: 16px;
  background: var(--navy);
  color: white;
  text-align: center;
}

.calc-promo h2 {
  font-weight: 500;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.calc-promo p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.75rem;
}

.calc-promo-btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  background: white;
  color: var(--navy);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.calc-promo-btn:hover {
  transform: translateY(-2px);
}

/* ---------- FAQ (on How We Work) ---------- */
.faq {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  scroll-margin-top: 6rem; /* the fixed header doesn't cover it when linked to */
}

.faq .section-title {
  text-align: center;
  margin-bottom: 2rem;
}

.faq-list {
  border-top: 1px solid #e5e8ed;
}

.faq-item {
  border-bottom: 1px solid #e5e8ed;
}

/* <details>/<summary> is a built-in open/close element: no JS needed */
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  list-style: none; /* hides the default triangle */
}

.faq-item summary::-webkit-details-marker {
  display: none; /* hides the triangle in Safari */
}

/* The "+" turns into an "x" when the question is open */
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--blue);
  transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  max-width: 640px;
  padding-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--muted);
}

/* ---------- About ---------- */
.about-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 0 3rem 5rem;
}

/* While the photo is hidden, the story is one centered column,
   centered like the titles around it */
.about-story:has(> [data-later]) {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  text-align: center;
}

.about-img {
  min-height: 360px;
  border-radius: 10px;
  background-image: url("../assets/images/hero.webp");
  background-size: cover;
  background-position: 30% center;
}

.about-text h2 {
  font-weight: 500;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.about-text p {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

/* Business philosophy: five pillars on a light band.
   3 + 2 cards on laptops (the last two centered), 2 per row on tablets,
   1 per row on phones (see the media queries at the end). */
.philosophy {
  background: var(--light);
  text-align: center;
  padding: 5rem 3rem;
}

.philosophy .section-title {
  margin-bottom: 1.25rem;
}

/* "Cinco pilares." / "Un propósito compartido.": each sentence stays whole */
.philosophy .section-title span {
  display: inline-block;
}

.philosophy-intro {
  max-width: 680px;
  margin: 0 auto 3rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.pillars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.pillar {
  flex: 0 1 calc((100% - 3rem) / 3);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.75rem;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 10px rgba(15, 35, 64, 0.08);
}

.pillar h3 {
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.pillar p {
  color: var(--muted);
}

.philosophy-closing {
  max-width: 640px;
  margin: 3rem auto 0;
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--navy);
  text-wrap: balance; /* lines of similar length, never one word alone */
}

/* ---------- Solutions page: the 4 solutions ---------- */
.solutions {
  padding: 0 3rem 6rem;
}

/* auto-fit: 4 cards side by side on wide screens, fewer as it narrows */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.solution-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem 1.75rem;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 10px rgba(15, 35, 64, 0.08);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 35, 64, 0.14);
}

.solution-icon {
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--light);
  color: var(--blue);
}

.solution-icon svg {
  width: 24px;
  height: 24px;
}

.solution-card h2 {
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--navy);
}

/* "Smart Solutions" under the Controls title */
.solution-label {
  margin-top: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
}

.solution-card p:not(.solution-label) {
  margin-top: 0.6rem;
  color: var(--muted);
}

.solution-link {
  margin-top: auto;
  padding-top: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
}

/* Intro line under a centered section title */
.section-intro {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.packages .section-title,
.catalog .section-title {
  margin-bottom: 0.75rem;
}

/* ---------- Solutions page: packages tríptico ---------- */
.packages {
  padding: 0 3rem 6rem;
  text-align: center;
  scroll-margin-top: 6rem;
}

/* Laid out like an open tríptico: three panels joined by dashed
   fold lines, the featured one in navy */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 40px rgba(15, 35, 64, 0.12);
  text-align: left;
}

.triptych-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2.5rem 2rem;
  /* light shading toward the folds, like folded paper */
  background: linear-gradient(
    90deg,
    rgba(15, 35, 64, 0.035),
    transparent 10%,
    transparent 90%,
    rgba(15, 35, 64, 0.035)
  );
}

.triptych-panel + .triptych-panel {
  border-left: 1px dashed #cfd6e0;
}

.triptych-panel.featured,
.triptych-panel.featured + .triptych-panel {
  border-left-color: transparent;
}

.triptych-panel.featured {
  background: var(--navy);
  color: white;
}

.triptych-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.triptych-number {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--blue);
}

.triptych-panel h3 {
  margin-top: 0.5rem;
  font-weight: 500;
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--navy);
}

.triptych-tagline {
  color: var(--muted);
}

.triptych-list {
  width: 100%;
  display: grid;
  gap: 0.6rem;
  margin: 1.5rem 0 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e8ed;
  list-style: none;
}

.triptych-list li {
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.4;
}

.triptych-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--blue);
}

/* The button sits at the bottom, so all three line up */
.triptych-panel .cta-btn {
  margin-top: auto;
}

/* Colors on the navy (featured) panel */
.featured .triptych-number,
.featured .triptych-list li::before {
  color: var(--blue-light);
}

.featured h3 {
  color: white;
}

.featured .triptych-tagline {
  color: rgba(255, 255, 255, 0.7);
}

.featured .triptych-list {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.packages-note {
  margin-top: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Products ---------- */
.catalog {
  text-align: center;
  scroll-margin-top: 6rem; /* the "See products" links land below the header */
}


.filters {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 0 2rem 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(15, 35, 64, 0.18);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--navy);
}

.filter-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 3rem 6rem;
}

/* The cards are <button>s, so we reset the browser's button styles */
.product-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 10px rgba(15, 35, 64, 0.08);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 35, 64, 0.14);
}

.product-img {
  height: 200px;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.5rem;
}

.product-tag {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
}

.product-body h2 {
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--navy);
}

/* ---------- Product modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  justify-content: center;
  align-items: center;
  background: rgba(15, 35, 64, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  background: white;
  box-shadow: 0 20px 60px rgba(15, 35, 64, 0.3);
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.modal-img {
  height: 200px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.75rem 2rem 2rem;
}

.modal-body h2 {
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--navy);
}

.modal-body .cta-btn {
  margin-top: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 3rem 6rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 10px rgba(15, 35, 64, 0.08);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 35, 64, 0.14);
}

.contact-icon {
  width: 56px;
  height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--light);
  color: var(--navy);
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.icon-whatsapp {
  background: #25d366;
  color: white;
}

.contact-card h2 {
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--navy);
}

.contact-card p {
  color: var(--muted);
}

.contact-value {
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--blue);
}

/* ---------- Quote form (contact page) ---------- */
.quote {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 3rem 6rem;
  scroll-margin-top: 6rem; /* the fixed header doesn't cover it when linked to */
}

.quote-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.quote-intro .section-title {
  margin-bottom: 0.75rem;
}

.quote-intro p:last-child {
  font-size: 1.15rem;
  color: var(--muted);
}

.quote-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  padding: 2.5rem;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 40px rgba(15, 35, 64, 0.12);
}

/* Fields that span both columns */
.quote-wide {
  grid-column: 1 / -1;
}

.quote-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.quote-field input,
.quote-field select,
.quote-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d5dae2;
  border-radius: 10px;
  background-color: white;
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px or more stops iPhones from zooming in on tap */
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 127, 216, 0.15);
}

/* Dropdowns: hide the browser arrow and draw our own chevron */
.quote-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 18px;
  cursor: pointer;
}

.quote-field textarea {
  min-height: 7rem;
  resize: vertical;
}

/* Spam trap: moved off screen instead of display: none, so bots still see it */
.quote-trap {
  position: absolute;
  left: -9999px;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.5rem;
}

.quote-submit {
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 30px;
  background: var(--navy);
  color: white;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.quote-submit:hover {
  transform: translateY(-2px);
}

.quote-submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.quote-privacy {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Success / error message after sending (empty = hidden) */
.quote-status {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.quote-status:empty {
  display: none;
}

.quote-status.success {
  background: #e7f6ec;
  color: #17663a;
}

.quote-status.error {
  background: #fdecec;
  color: #a12a2a;
}

/* ---------- Assistant: floating Flux X button + chat panel (created by script.js) ---------- */
.assistant-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 95;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 50%;
  background: white;
  box-shadow: 0 6px 24px rgba(15, 35, 64, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.assistant-toggle:hover {
  transform: scale(1.06);
}

/* The logo and the "x" sit on top of each other and swap when open */
.assistant-logo,
.assistant-x {
  position: absolute;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.assistant-logo {
  width: 28px;
}

.assistant-x {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  color: var(--navy);
  opacity: 0;
  transform: rotate(-90deg);
}

.assistant.open .assistant-logo {
  opacity: 0;
  transform: rotate(90deg);
}

.assistant.open .assistant-x {
  opacity: 1;
  transform: none;
}

.assistant-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 6.25rem;
  z-index: 95;
  width: 360px;
  max-height: min(600px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 20px 60px rgba(15, 35, 64, 0.3);
  /* closed state: invisible, slightly lower and smaller */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

.assistant.open .assistant-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--navy);
  color: white;
}

.assistant-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: white;
}

.assistant-avatar img {
  width: 20px;
}

.assistant-title {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
}

.assistant-subtitle {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
}

.assistant-close {
  margin-left: auto;
  border: none;
  background: none;
  color: white;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* The scrollable middle: messages + question chips */
.assistant-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--light);
}

.assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.assistant-bubble {
  max-width: 88%;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 1rem;
  line-height: 1.45;
  scroll-margin-top: 1rem;
}

.from-bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 35, 64, 0.08);
}

.from-user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--navy);
  color: white;
}

.assistant-label {
  margin: 1.25rem 0 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.assistant-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.assistant-chip {
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(47, 127, 216, 0.35);
  border-radius: 999px;
  background: white;
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.assistant-chip:hover {
  background: var(--blue);
  color: white;
}

.assistant-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.assistant-link {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
}

.assistant-link:hover {
  color: var(--blue);
}

/* Teaser: small speech bubble above the button */
.assistant-teaser {
  position: fixed;
  right: 1.5rem;
  bottom: 6rem;
  z-index: 95;
  max-width: 250px;
  border-radius: 14px;
  border-bottom-right-radius: 4px; /* "points" toward the button */
  background: white;
  box-shadow: 0 10px 30px rgba(15, 35, 64, 0.2);
  /* hidden until JS adds .show-teaser */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transform-origin: bottom right;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

.assistant.show-teaser .assistant-teaser {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.assistant-teaser-text {
  display: block;
  padding: 0.85rem 2rem 0.85rem 1rem; /* right padding leaves room for the × */
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.assistant-teaser-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.assistant-teaser-close:hover {
  background: var(--light);
}

.assistant-contact {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #e5e8ed;
}

.assistant-contact p {
  margin-bottom: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

.assistant-contact-links {
  display: flex;
  gap: 0.5rem;
}

.assistant-contact-links a {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.5rem;
  border-radius: 999px;
  background: var(--light);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

/* While WhatsApp is off: the quote form, same blue as the other quote buttons */
.assistant-contact-links .assistant-quote {
  background: #2569b8;
  color: white;
}

.assistant-contact-links .assistant-wa {
  background: #25d366;
  color: white;
}

.assistant-wa svg {
  width: 15px;
  height: 15px;
}

/* ---------- 404 page ---------- */
.not-found {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 2rem 7rem;
  text-align: center;
}

.not-found-code {
  font-size: 7rem;
  font-weight: 500;
  line-height: 1;
  color: var(--blue);
}

.not-found p:not(.not-found-code) {
  font-size: 1.2rem;
  color: var(--muted);
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.not-found-btn {
  padding: 0.9rem 2rem;
  border: 1px solid var(--navy);
  border-radius: 30px;
  background: var(--navy);
  color: white;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.not-found-btn:hover {
  transform: translateY(-2px);
}

.not-found-btn-outline {
  background: none;
  color: var(--navy);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--light);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Flex + wrap instead of a fixed grid, so the columns spread out evenly
   whether the social column is shown or hidden */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 3rem 3rem;
}

.footer-brand {
  flex: 2 1 280px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.2em;
  color: var(--navy);
  text-decoration: none;
}

/* Same size as the X in the header logo */
.footer-logo img {
  width: 0.85em;
  height: 0.73em;
  vertical-align: baseline;
}

.footer-tagline {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.footer-about {
  max-width: 300px;
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
}

.footer-col {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-heading {
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--blue);
}

/* The display rules above would otherwise win over the hidden attribute */
.site-footer [hidden] {
  display: none;
}

.footer-bottom {
  padding: 1.5rem 3rem;
  border-top: 1px solid #e5e8ed;
  text-align: center;
  font-size: 0.8rem;
}

/* Turn off animations for people who ask their system for less motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .flow-line,
  .modal,
  .calc-bill-help,
  .scroll-reveal.in-view {
    animation: none;
    opacity: 1;
  }

  .js .scroll-reveal:not(.in-view) {
    opacity: 1;
  }

  .bar-after {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive ----------
   Large screens (1440px+): everything as written above.
   Laptops (1100-1439px): tighter header so the full menu still fits.
   Tablet and phone sideways (up to 1099px): hamburger menu, fewer columns.
   Short screens (phone sideways): compact header and hero.
   Phone (up to 768px): the block at the very bottom. */

/* Laptops: the full Spanish menu with the "Calcula tu ahorro" button needs
   ~1,350px at full size, so tighten the header below 1,440px */
@media (max-width: 1439px) {
  .site-header {
    gap: 1.5rem;
    padding: 1.25rem 2rem;
  }

  .site-header.scrolled {
    padding: 0.8rem 2rem;
  }

  .main-nav {
    gap: 1.4rem;
  }

  .nav-link {
    letter-spacing: 0.08em;
  }

  .header-actions {
    padding-left: 1.25rem;
  }

  /* Tagline on two lines, so the logo column is narrower */
  .tagline span {
    display: block;
  }
}

/* Tablets and phones turned sideways: the menu becomes the hamburger */
@media (max-width: 1099px) {
  .site-header,
  .site-header.scrolled {
    gap: 0.75rem;
    padding: 1rem 1.5rem;
  }

  .header-actions {
    margin-left: auto;
    padding-left: 0;
    border-left: none;
  }

  .menu-toggle {
    display: block;
  }

  /* Logo and buttons stay above the open menu */
  .brand,
  .header-actions {
    position: relative;
    z-index: 1;
  }

  /* The nav becomes a full-screen menu, hidden until .nav-open.
     It scrolls if the screen is too short for all the links, and
     "safe center" keeps the first link reachable when that happens. */
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin-left: 0;
    padding: 5.5rem 1.5rem 2rem;
    overflow-y: auto;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    gap: 2.25rem;
    background: rgba(255, 255, 255, 0.97);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .nav-open .main-nav {
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 0.95rem;
    letter-spacing: 0.12em;
  }

  /* In the open menu the calculator button comes first (its HTML position) */
  .nav-link.nav-calc {
    order: 0;
    padding: 0.85rem 1.75rem;
  }

  .hero {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* The text takes a bigger share of a narrower screen: a wider light fade
     keeps "Visión" readable over the house */
  .hero::before {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.88) 0%,
      rgba(255, 255, 255, 0.72) 50%,
      rgba(255, 255, 255, 0.25) 78%,
      rgba(255, 255, 255, 0) 95%
    );
  }

  .hero-bottom {
    left: 2rem;
  }

  /* Four cards in a row get too narrow: two by two instead */
  .feature-grid,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .explore,
  .philosophy {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .videos,
  .steps,
  .about-story,
  .product-grid,
  .solutions,
  .packages {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .calculator,
  .calc-promo {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .calc-inputs,
  .calc-results {
    padding: 2.5rem 2rem;
  }

  .triptych-panel {
    padding: 2.25rem 1.5rem;
  }

  /* "Consultar este paquete" fits on one line in the narrower panels */
  .triptych-panel .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }

  .footer-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Narrow tablets and phones (sideways too): the calculator's two halves and
   the tríptico's three panels get too tight, so they stack */
@media (max-width: 900px) {
  .calculator {
    grid-template-columns: 1fr;
  }

  /* Pillars two by two (the fifth centered under them) */
  .pillar {
    flex-basis: calc((100% - 1.5rem) / 2);
  }

  /* The tríptico folds into a single column: fold lines become horizontal */
  .triptych {
    grid-template-columns: 1fr;
    max-width: 540px;
  }

  .triptych-panel {
    padding: 2rem 1.5rem;
  }

  .triptych-panel:not(.featured) {
    background: white;
  }

  .triptych-panel + .triptych-panel {
    border-left: none;
    border-top: 1px dashed #cfd6e0;
  }

  .triptych-panel.featured,
  .triptych-panel.featured + .triptych-panel {
    border-top-color: transparent;
  }

  .triptych-panel .cta-btn {
    font-size: 1rem;
  }
}

/* Phones turned sideways: wide but only ~360-430px tall
   (max-width keeps short laptop windows on the normal layout) */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1099px) {
  .site-header,
  .site-header.scrolled {
    padding: 0.5rem 1.5rem;
  }

  .tagline {
    display: none;
  }

  .main-nav {
    gap: 1.1rem;
    padding-top: 4rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .page-content {
    padding-top: 5rem;
  }

  .hero {
    padding-top: 5rem;
    padding-bottom: 4.5rem;
  }

  .hero-word {
    font-size: 3.25rem;
  }

  .phonetic {
    font-size: 1.4rem;
  }

  .definition {
    margin-top: 0.75rem;
    font-size: 1.05rem;
  }

  .flow-line {
    margin: 1.25rem 0;
  }

  .statement p {
    font-size: 1rem;
  }

  .hero-bottom {
    bottom: 1.25rem;
  }

  .feature-img {
    height: 140px;
  }

  /* Pop-ups have to fit in the short height */
  .modal {
    max-height: 94vh;
  }

  .modal-img {
    height: 120px;
  }

  .modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
  }

  .assistant-toggle {
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
  }

  /* The bubble would cover a big part of a 375px-tall screen; the button stays */
  .assistant-teaser {
    display: none;
  }

  /* Beside the button instead of above it, and below the header */
  .assistant-panel {
    top: 4.25rem;
    bottom: 1rem;
    right: 4.75rem;
    max-height: none;
  }

  .video-frame video {
    max-height: 80vh;
  }

  .video-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Small phones sideways (up to 768px wide) also get the phone block below,
     which would stack everything in one tall column. The "body" in front
     makes these rules win over it, even though the phone block comes later. */
  body .site-header,
  body .site-header.scrolled {
    padding: 0.5rem 1.25rem;
  }

  body .page-content {
    padding-top: 5rem;
  }

  body .hero {
    padding-top: 5rem;
  }

  body .statements,
  body .feature-grid,
  body .steps,
  body .about-story,
  body .product-grid,
  body .contact-grid,
  body .quote-form {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Videos: three cards visible in the swipe row, not one giant card */
  body .video-card {
    flex-basis: 30%;
  }

  body .assistant-panel {
    top: 4rem;
    bottom: 1rem;
    left: auto;
    right: 4.75rem;
    width: 340px;
    max-height: none;
  }
}

/* Phones upright only show a narrow slice of the hero photo: a lighter crop
   of the same picture (hero-home-phone.webp, 166 KB instead of 578 KB). It was
   cut so that the phone block's background-position (72%) frames it exactly
   like the full photo. Re-crop it if the hero photo changes. */
@media (max-width: 768px) and (orientation: portrait) {
  .hero {
    background-image: url("../assets/images/hero-home-phone.webp");
  }
}

/* Mobile (keep this block at the very bottom) */
@media (max-width: 768px) {
  /* EB Garamond looks small on phones: a slightly bigger base size
     makes paragraphs without their own font-size easier to read */
  body {
    font-size: 1.0625rem;
  }

  .site-header,
  .site-header.scrolled {
    padding: 1rem 1.25rem;
  }

  .logo {
    font-size: 1.4rem;
  }

  .tagline {
    display: none; /* the hero already shows it */
  }

  .page-content {
    padding-top: 6rem;
  }

  .page-content h1,
  .section-title {
    font-size: 2rem;
  }

  .section-title {
    margin-bottom: 2rem;
  }

  .page-intro {
    padding: 1rem 1.25rem 2.5rem;
  }

  /* Calculator buttons: easier to tap with a thumb */
  .calc-mode-btn,
  .calc-quick {
    min-height: 40px;
  }

  .calc-where {
    min-height: 40px;
  }

  /* The text block and the tagline stack in normal flow instead of the
     tagline being pinned to the bottom, so they never overlap on short phones.
     margin: auto 0 keeps the text centered in the space that's left. */
  .hero {
    padding: 6.5rem 1.25rem 1.5rem;
    /* Phones only show a narrow slice: keep the house and its solar panels in view */
    background-position: 72% center;
  }

  .hero-content {
    margin: auto 0;
  }

  .hero::before {
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0.7) 75%,
      rgba(255, 255, 255, 0.3)
    );
  }

  .hero-word {
    font-size: 3rem;
  }

  .flow-line {
    margin: 1.5rem 0;
  }

  .hero-bottom {
    position: static;
    margin-top: 2.5rem;
    padding-right: 5rem; /* stays clear of the assistant button */
  }

  .hero-sign {
    gap: 0.75rem;
    font-size: 0.68rem;
    line-height: 1.5;
  }

  .hero-sign::before {
    width: 28px;
  }

  /* "Integrated Energy." and "Intelligent Solutions." on two lines */
  .hero-sign-text span {
    display: block;
  }

  .statements,
  .feature-grid,
  .steps,
  .about-story,
  .product-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .statements {
    gap: 1.25rem;
  }

  .explore,
  .philosophy {
    padding: 4rem 1.25rem;
  }

  .pillar {
    flex-basis: 100%;
  }

  .feature-img {
    height: 160px;
  }

  .feature-body {
    padding: 1.25rem;
  }

  .cta {
    padding: 4rem 1.25rem;
  }

  .cta h2 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  .cta p {
    font-size: 1.05rem;
  }

  .steps,
  .about-story,
  .product-grid,
  .contact-grid {
    padding: 0 1.25rem 4rem;
  }

  /* Smaller side margin + padding: the card and its padding were
     eating almost 90px of a 360px screen */
  .calculator {
    grid-template-columns: 1fr;
    margin: 0 0.75rem 4rem;
  }

  .hero + .calculator {
    margin-top: 2.5rem;
  }

  .calc-inputs,
  .calc-results {
    padding: 2rem 1.25rem;
  }

  .calc-inputs h2 {
    font-size: 1.9rem;
  }

  .calc-intro {
    margin-bottom: 2rem;
  }

  .calc-big {
    font-size: 3rem;
  }

  .calc-stats {
    gap: 1.25rem 1rem;
  }

  .calc-stats dd {
    font-size: 1.1rem;
  }

  .calc-promo {
    margin: 0 0.75rem 4rem;
    padding: 2.5rem 1.25rem;
  }

  .calc-promo h2 {
    font-size: 1.6rem;
  }

  .faq {
    padding: 0 1.25rem 4rem;
  }

  .solutions,
  .packages {
    padding: 0 1.25rem 4rem;
  }

  .section-intro {
    padding: 0 0.25rem;
  }

  /* (the tríptico already stacks from 900px down) */
  /* WhatsApp buttons: a bit less padding so their text stays on one line
     on 360px phones */
  .cta-btn {
    padding: 0.9rem 1.4rem;
  }

  .calc-results .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
  }

  .quote {
    padding: 0 0.75rem 4rem;
  }

  .quote-intro {
    padding: 0 0.5rem;
  }

  .quote-form {
    grid-template-columns: 1fr;
    padding: 1.75rem 1.25rem;
  }

  .faq-item summary {
    font-size: 1.15rem;
  }

  /* Videos become a row you swipe sideways. scroll-snap stops each
     swipe neatly on a card. */
  .videos {
    padding: 0 0 4rem;
  }

  .videos .eyebrow,
  .videos .section-title,
  .videos-intro {
    padding: 0 1.25rem;
  }

  .video-grid {
    display: flex;
    gap: 0.9rem;
    max-width: none;
    padding: 0 1.25rem 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* hides the scrollbar in Firefox */
  }

  .video-grid::-webkit-scrollbar {
    display: none; /* hides the scrollbar in Chrome, Safari, Opera */
  }

  .video-card {
    flex: 0 0 68%;
    scroll-snap-align: center;
  }

  .footer-inner {
    gap: 2rem 1.5rem;
    padding: 3rem 1.25rem 2rem;
  }

  .footer-brand {
    flex-basis: 100%;
  }

  /* Left-aligned with room on the right, so the assistant button
     doesn't cover the copyright line */
  .footer-bottom {
    padding: 1.25rem 5.5rem 1.5rem 1.25rem;
    text-align: left;
  }

  .assistant-toggle {
    right: 1rem;
    bottom: 1rem;
  }

  .assistant-teaser {
    right: 1rem;
    bottom: 5.25rem;
  }

  /* On phones the panel uses almost the full width */
  .assistant-panel {
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    width: auto;
    max-height: calc(100vh - 7rem);
  }
}
