/* ==========================================================================
   HOME WATER SERVICES — DESIGN SYSTEM
   Colors sampled from the official HWS logo. Do not change brand tokens.

   Contents
   1. Tokens          6. Home sections        11. Real-photo layer
   2. Base / reset    7. Contact form          12. Responsive
   3. Utilities       8. Footer / back-to-top
   4. Buttons         9. Scroll reveal
   5. Header / nav   10. Product-page components
   ========================================================================== */

/* ============ 1. TOKENS ============ */
:root {
  --navy: #072E68;
  --navy-deep: #051D42;
  --blue: #0B6CB0;
  --cyan: #00AEEF;
  --cyan-light: #6ED2F7;
  --white: #FFFFFF;
  --black: #0A0A0A;

  --gray-50: #F5F8FA;
  --gray-100: #E9EFF3;
  --gray-300: #C7D3DB;
  --gray-500: #5B6B79;
  --gray-700: #2B3944;

  --font: Arial, Helvetica, sans-serif;

  --max-w: 1320px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ============ 2. BASE / RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ 3. UTILITIES ============ */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.9rem 1.4rem;
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

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

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.eyebrow {
  display: block;
  margin-bottom: 1rem;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow-onnavy { color: var(--cyan-light); }

.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--navy);
  max-width: 20ch;
}
.section-title-sm {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1.75rem;
}
.section-lead {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  color: var(--gray-500);
  max-width: 62ch;
  margin-top: 1.1rem;
}

/* Shared pill look (about badges, pill lists, room lists) */
.about-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
}

/* Shared cyan bullet (product details, compare panels) */
.product-details li::before,
.compare-panel li::before {
  content: "";
  position: absolute;
  left: 0;
  border-radius: 50%;
  background: var(--cyan);
}

/* ============ 4. BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 1.05rem 2rem; font-size: 1rem; }

.btn-cyan,
.btn-call { background: var(--cyan); color: var(--navy-deep); }
.btn-cyan:hover { background: var(--cyan-light); transform: translateY(-2px); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--blue); transform: translateY(-2px); }

.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }

.btn-outline-light { border-color: rgba(255,255,255,0.55); color: var(--white); background: transparent; }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

.btn-call { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
.btn-call:hover { background: var(--cyan-light); transform: translateY(-1px); }

/* ============ 5. HEADER / NAV ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  transition: box-shadow 0.25s var(--ease);
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(7,46,104,0.08); }

.header-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { height: 120px; width: auto; margin-right: 20px; }

.primary-nav ul { display: flex; align-items: center; gap: 2.1rem; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

.chev { transition: transform 0.2s var(--ease); }
.nav-toggle[aria-expanded="true"] .chev,
.mobile-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.has-menu { position: relative; }
.mega-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  min-width: 340px;
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 6px;
  box-shadow: 0 24px 48px rgba(7,46,104,0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.has-menu.open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: background-color 0.15s var(--ease);
}
.mega-item:hover { background: var(--gray-50); }
.mega-item.active { border-left-color: var(--cyan); background: var(--gray-50); }
.mega-item-label { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.mega-item-desc { font-size: 0.82rem; color: var(--gray-500); }

.header-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
}
.menu-btn span {
  display: block;
  width: 24px;
  height: 2.5px;
  margin-inline: auto;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  top: 0; right: 0;
  z-index: 400;
  width: min(88vw, 400px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem 2rem;
  overflow-y: auto;
  background: var(--navy-deep);
  color: var(--white);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}
.mobile-nav.open { transform: translateX(0); }

.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.mobile-nav-logo { height: 46px; width: auto; object-fit: contain; flex-shrink: 0; }
.menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--white);
}

.mobile-nav-list { display: flex; flex-direction: column; }
.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.15rem 0.25rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: left;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  transition: max-height 0.3s var(--ease);
}
.mobile-submenu.open { max-height: 320px; }
.mobile-sublink {
  display: block;
  padding: 0.9rem 1rem 0.9rem 1.5rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--cyan-light);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid transparent;
}
.mobile-sublink.active { border-left-color: var(--cyan); background: rgba(255,255,255,0.06); color: var(--white); }

.mobile-call {
  width: 100%;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 1.05rem;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(5,29,66,0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
}
.mobile-nav-backdrop.open { opacity: 1; visibility: visible; }

body.nav-open { overflow: hidden; }

/* ============ 6. HOME SECTIONS ============ */

/* ---- Hero (shared with product pages) ---- */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-brand {
  margin-bottom: 0.4rem;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.hero-title {
  margin-block: 0.2rem 1.3rem;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--navy);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero-title {
    background: linear-gradient(100deg, var(--navy) 35%, var(--blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.hero-sub {
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  color: var(--gray-500);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-300);
}
.hero-stats li { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 800; color: var(--navy); }
.stat-label { max-width: 14ch; font-size: 0.82rem; color: var(--gray-500); }

.hero-visual { position: relative; }
.hero-visual-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--navy) 0%, var(--blue) 55%, var(--cyan) 100%);
  overflow: hidden;
}
.hero-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-visual-caption {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.85);
  background: linear-gradient(0deg, rgba(5,29,66,0.55), transparent);
}
.hero-badge {
  position: absolute;
  right: 1.25rem;
  top: -1.25rem;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.1rem 1.3rem;
  background: var(--white);
  border-top: 3px solid var(--cyan);
  border-radius: 4px;
  box-shadow: 0 20px 40px rgba(7,46,104,0.18);
}
.hero-badge-num { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.hero-badge-label { font-size: 0.78rem; color: var(--gray-500); line-height: 1.35; }

/* ---- Solutions intro ---- */
.solutions-intro {
  padding-block: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.solutions-intro .section-title { max-width: none; }
.solutions-intro .section-lead { margin-inline: auto; }

/* ---- Product rows (home + product pages) ---- */
.product { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.product-alt { background: var(--gray-50); }
.product-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.product-alt .product-inner { direction: rtl; }
.product-alt .product-inner > * { direction: ltr; }

.product-visual {
  position: relative;
  aspect-ratio: 5 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--gray-100), var(--white));
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.product-spec-strip {
  position: absolute;
  left: 0; right: 0;
  bottom: 2.75rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding-inline: 1rem;
}
.product-spec-strip span {
  padding: 0 0.75rem;
  border-right: 1px solid var(--gray-300);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}
.product-spec-strip span:last-child { border-right: none; }

.product-visual-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 0.85rem 1.1rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gray-500);
  text-align: center;
  background: linear-gradient(0deg, var(--white) 55%, transparent);
}

.product-index {
  margin-bottom: 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.product-title {
  margin-bottom: 1.1rem;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.product-desc {
  max-width: 54ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--gray-700);
}
.product-details {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-block: 1.5rem 2rem;
}
.product-details li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.96rem;
  color: var(--gray-700);
}
.product-details li::before { top: 0.5em; width: 8px; height: 8px; }

/* ---- More solutions ---- */
.more-solutions {
  padding-block: clamp(3rem, 6vw, 5rem);
  background: var(--navy-deep);
  color: var(--white);
}
.more-solutions .section-title { color: var(--white); }
.more-solutions .section-lead { color: rgba(255,255,255,0.72); }
.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin-top: 2.5rem;
  background: rgba(255,255,255,0.14);
  border-radius: 6px;
  overflow: hidden;
}
.more-item {
  padding: 1.75rem 1.6rem;
  background: var(--navy-deep);
  transition: background-color 0.2s var(--ease);
}
.more-item:hover { background: var(--navy); }
.more-item h3 {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cyan-light);
}
.more-item p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.68);
}

/* ---- Story ---- */
.story { padding-block: clamp(3rem, 6vw, 5rem); }
.story-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
/* Replaces the former invalid <img>-inside-<svg> markup. Same 5:4 box,
   photo fills it edge to edge exactly as before. inline-block keeps the
   original inline <svg>'s baseline spacing so the layout is pixel-identical. */
.story-visual { position: relative; }
.story-media { display: inline-block; width: 100%; aspect-ratio: 5 / 4; }
.story-points {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.75rem;
}
.story-points li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
}
.story-dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
}

/* ---- Why HWS ---- */
.why {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  background: var(--navy);
  color: var(--white);
  text-align: center;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1.75rem;
}
.why-num {
  display: block;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--cyan);
}
.why-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.78);
}

/* ---- About ---- */
.about { padding-block: clamp(3rem, 6vw, 5rem); }
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
}
.about-copy p {
  max-width: 60ch;
  margin-bottom: 1.1rem;
  font-size: 1.03rem;
  line-height: 1.7;
  color: var(--gray-700);
}
.about-badges,
.pill-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---- Service area ---- */
.service-area {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  background: var(--gray-50);
}
.area-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.area-list li {
  padding: 0.6rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 999px;
}

/* ---- Testimonial ---- */
.testimonial {
  padding-block: clamp(3rem, 6vw, 5rem);
  text-align: center;
}
.testimonial-inner { max-width: 720px; margin-inline: auto; }
.quote-mark {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 5rem;
  line-height: 1;
  font-weight: 800;
  color: var(--cyan);
}
.testimonial-text {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--navy);
}
.testimonial-name {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-500);
}

/* ---- Final CTA ---- */
.final-cta {
  padding-block: clamp(3.5rem, 7vw, 6rem);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
}
.final-cta-inner { max-width: 780px; margin-inline: auto; text-align: center; }
.final-cta-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.final-cta-sub {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: rgba(255,255,255,0.78);
}
.final-cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

/* ============ 7. CONTACT FORM ============ */
.contact-form {
  margin-top: 3.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: left;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-field { display: flex; flex-direction: column; margin-bottom: 1.25rem; }
.form-field label {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.form-field input,
.form-field textarea {
  padding: 0.85rem 1rem;
  font-family: var(--font);
  font-size: 0.98rem;
  color: var(--black);
  background: rgba(255,255,255,0.95);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--cyan); }
.form-field.error input,
.form-field.error textarea { border-color: var(--black); border-width: 2px; background: var(--white); }
.field-error {
  min-height: 1em;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--white);
}
.field-error:not(:empty)::before { content: "\25B2  "; font-size: 0.65rem; }
.form-submit { width: 100%; margin-top: 0.5rem; }
.form-status {
  min-height: 1.2em;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  color: var(--cyan-light);
}
.form-status.is-error { color: var(--white); }

/* ============ 8. FOOTER / BACK TO TOP ============ */
.site-footer {
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.5rem;
  background: var(--navy-deep);
  color: rgba(255,255,255,0.8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.footer-logo { height: 230px; width: auto; object-fit: contain; flex-shrink: 0; }
.footer-brand p { font-weight: 700; color: var(--white); }
.footer-heading {
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-light);
}
.footer-col a,
.footer-col p {
  display: block;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
}
.footer-col a:hover,
.footer-bottom a:hover { color: var(--cyan-light); }
.footer-social { display: flex; gap: 1rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.5rem;
  font-size: 0.82rem;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(7,46,104,0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background-color 0.2s var(--ease);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--blue); }

/* ============ 9. SCROLL REVEAL ============
   Scoped to html.js so content stays visible if JavaScript is
   disabled or fails (progressive enhancement). The .js class is
   set by a one-line inline script in each page's <head>. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============ 10. PRODUCT-PAGE COMPONENTS ============ */

/* ---- Product hero ---- */
.product-hero .hero-inner { grid-template-columns: 0.85fr 1.15fr; }
.hero--flip .hero-inner { direction: rtl; }
.hero--flip .hero-inner > * { direction: ltr; }

.hero-visual-frame--ro {
  background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 45%, var(--cyan) 100%);
}
.hero-visual-frame--alkaline {
  background: linear-gradient(160deg, #EAF9FF 0%, var(--cyan-light) 55%, var(--cyan) 100%);
}
.hero-visual-frame--alkaline .hero-visual-caption {
  color: rgba(7,46,104,0.8);
  background: linear-gradient(0deg, rgba(255,255,255,0.8) 40%, transparent);
}

/* ---- Section wrappers ---- */
.product-section { padding-block: clamp(3rem, 6vw, 5rem); }
.product-section--alt { background: var(--gray-50); }
.product-section--dark { background: var(--navy-deep); color: var(--white); }
.product-section--dark .section-title { color: var(--white); }
.product-section--dark .section-lead { color: rgba(255,255,255,0.75); }
.product-section--center { text-align: center; }
.product-section--center .section-title,
.product-section--center .section-lead { margin-inline: auto; }

/* ---- Benefit / problem icon grid ---- */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.75rem, 3vw, 2.5rem);
  margin-top: 2.5rem;
}
.benefit-item { display: flex; flex-direction: column; gap: 0.85rem; }
.benefit-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  color: var(--blue);
}
.benefit-icon svg { width: 24px; height: 24px; }
.benefit-item h3 { font-size: 1.02rem; font-weight: 800; color: var(--navy); }
.benefit-item p { font-size: 0.92rem; line-height: 1.6; color: var(--gray-500); }

/* ---- Process / flow diagram (vertical by default) ---- */
.product-process {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2.75rem;
}
.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 260px;
  padding: 0.5rem 1.5rem;
  text-align: center;
}
.process-step-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
}
.process-step-num svg { width: 24px; height: 24px; }
.process-step h3 { font-size: 1rem; font-weight: 800; color: var(--navy); }
.process-step p { font-size: 0.88rem; line-height: 1.55; color: var(--gray-500); }
.process-arrow {
  position: relative;
  flex-shrink: 0;
  width: 2px;
  height: 32px;
  background: var(--gray-300);
}
.process-arrow::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--gray-300);
}

/* ---- pH scale (alkaline page) ---- */
.ph-scale { max-width: 640px; margin: 2.5rem auto 0; }
.ph-scale-bar {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E8622C 0%, #F2C230 30%, var(--cyan-light) 55%, var(--blue) 78%, var(--navy) 100%);
}
.ph-scale-marker {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 26px;
  background: var(--navy);
}
/* Marker positions moved out of inline style="" so a strict CSP can be used */
.ph-scale-marker--4  { left: 20%; }
.ph-scale-marker--7  { left: 46%; }
.ph-scale-marker--9  { left: 65%; }
.ph-scale-marker--14 { left: 95%; }
.ph-scale-marker::after {
  content: attr(data-label);
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.ph-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  font-size: 0.78rem;
  color: var(--gray-500);
}

/* ---- Compare panels (softener vs. salt-free) ---- */
.compare-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.compare-panel {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
}
.compare-panel--featured { border-color: var(--cyan); box-shadow: 0 20px 40px rgba(7,46,104,0.08); }
.compare-panel h3 { font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.compare-tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}
.compare-panel p { margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.6; color: var(--gray-500); }
.compare-panel ul { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.compare-panel li { position: relative; padding-left: 1.3rem; font-size: 0.9rem; color: var(--gray-700); }
.compare-panel li::before { top: 0.55em; width: 7px; height: 7px; }

/* ---- Related-solutions switcher ---- */
.product-navigation { padding-block: clamp(2.5rem, 5vw, 4rem); background: var(--gray-50); }
.solutions-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 2rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  overflow: hidden;
}
.solutions-switch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: var(--white);
  border-top: 3px solid transparent;
  transition: background-color 0.2s var(--ease);
}
.solutions-switch-item:hover { background: var(--gray-50); }
.switch-label { font-weight: 800; color: var(--navy); font-size: 0.98rem; }
.switch-desc { font-size: 0.82rem; color: var(--gray-500); }
.solutions-switch-item.active { border-top-color: var(--cyan); background: var(--navy); cursor: default; }
.solutions-switch-item.active .switch-label { color: var(--white); }
.solutions-switch-item.active .switch-desc { color: rgba(255,255,255,0.72); }

/* ============ 11. REAL-PHOTO LAYER ============
   An <img class="media-photo"> sits above the built-in illustration and
   placeholder caption. While the photo is present the placeholder layers
   are hidden — via :has() (works with no JS, no flash) and via the
   .has-photo class script.js adds (older browsers). If the photo 404s,
   script.js removes the <img> and the illustration shows again. */
.media-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-visual-frame.has-photo .hero-waves,
.hero-visual-frame.has-photo .hero-visual-caption,
.product-visual.has-photo .product-spec-strip,
.product-visual.has-photo .product-visual-caption { display: none; }

@supports selector(:has(*)) {
  .hero-visual-frame:has(> .media-photo) .hero-waves,
  .hero-visual-frame:has(> .media-photo) .hero-visual-caption,
  .product-visual:has(> .media-photo) .product-spec-strip,
  .product-visual:has(> .media-photo) .product-visual-caption { display: none; }
}

/* ============ 12. RESPONSIVE ============ */
@media (min-width: 860px) {
  .product-process--horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
  }
  .product-process--horizontal .process-arrow {
    width: 32px;
    height: 2px;
    margin-top: 26px;
  }
  .product-process--horizontal .process-arrow::after {
    top: 50%;
    right: -1px;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
    border-left: 7px solid var(--gray-300);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: none;
  }
}

@media (max-width: 1024px) {
  .primary-nav { display: none; }
  .menu-btn { display: flex; }
  .btn-call span { display: none; }
  .btn-call {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
  }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .hero-inner,
  .product-hero .hero-inner { grid-template-columns: 1fr; }
  .hero--flip .hero-inner { direction: ltr; }
  .hero-visual { order: -1; width: 100%; max-width: 420px; margin: 1.5rem auto 0; }
  .hero-badge { right: 0.75rem; top: -1rem; max-width: 180px; padding: 0.85rem 1rem; }
  .hero-badge-num { font-size: 1.3rem; }
  .hero-stats { gap: 1.5rem; }

  .product-inner,
  .product-alt .product-inner { grid-template-columns: 1fr; direction: ltr; }
  .product-visual,
  .story-visual { order: -1; width: 100%; max-width: 460px; margin-inline: auto; }

  .story-inner,
  .about-grid,
  .form-row,
  .compare-panels { grid-template-columns: 1fr; }

  .why-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .solutions-switch { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand-logo { height: 44px; }
  .hero-stats { flex-direction: column; gap: 1.1rem; }
  .hero-actions,
  .final-cta-actions { flex-direction: column; }
  .hero-actions .btn,
  .final-cta-actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
