/*
Theme Name: Chula Homes
Theme URI: https://chula.co.ke
Author: Chula Homes
Description: Front-end theme for Chula Homes doors, windows, locks and outdoor. WooCommerce ready.
Version: 1.5.0
Requires at least: 6.0
Text Domain: chula-homes
*/

:root {
  --blue: #1a73e8;
  --blue-dark: #0d5bbd;
  --blue-deep: #0a4a99;
  --blue-soft: #e8f1fc;
  --ink: #111;
  --ink-soft: #333;
  --muted: #666;
  --line: #e5e5e5;
  --bg: #f7f7f5;
  --white: #fff;
  --success: #1a7f37;
  --radius: 12px;
  --radius-lg: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.2, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }
ul { list-style: none; }
.container { width: min(1180px, 92%); margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 980px;
  transition: transform 0.2s var(--spring), background 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,115,232,0.3);
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
  background: var(--bg);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--line); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--bg); }
.btn-on-colour {
  background: #fff;
  color: var(--ink);
}
.btn-on-colour:hover { background: #f0f0f0; }
.btn-on-colour-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
  min-height: 48px;
  padding: 0 22px;
  border-radius: 980px;
  font-weight: 600;
  font-size: 15px;
}
.btn-on-colour-ghost:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 28px;
}
.logo img { height: 38px; width: auto; }
.nav-links {
  display: none;
  gap: 4px;
  margin-left: auto;
}
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 980px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--bg); color: var(--blue); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
@media (min-width: 900px) { .header-actions { margin-left: 0; } }
.menu-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 50%;
}
@media (min-width: 900px) { .menu-toggle { display: none; } }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 88vw);
  height: 100%;
  background: #fff;
  padding: 72px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(100%);
  transition: transform 0.4s var(--spring);
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-panel a {
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
}
.mobile-nav-panel a:active { background: var(--bg); }

/* HERO: full product slideshow + copy panel */
.hero {
  display: grid;
  background: var(--bg);
  min-height: 560px;
}
@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.15fr 0.95fr;
    min-height: 640px;
  }
}
.hero-slides {
  position: relative;
  min-height: 380px;
  background: #1a1a1a;
  overflow: hidden;
}
@media (min-width: 960px) { .hero-slides { min-height: 100%; } }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s var(--ease), visibility 0.85s;
}
.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-slide-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 24px 56px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  z-index: 2;
}
.hero-slide-info .sku {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}
.hero-slide-info h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.hero-slide-info p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 14px;
  max-width: 40ch;
}
.hero-slide-info .btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
.hero-slide-info .btn:hover { background: #eee; }
.hero-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: width 0.25s, background 0.25s, border-radius 0.25s;
}
.hero-dot.active {
  width: 22px;
  border-radius: 4px;
  background: #fff;
}
.hero-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.25);
}
.hero-arrow:hover { background: rgba(255,255,255,0.35); }
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--blue);
  width: 0%;
  z-index: 5;
}

.hero-content {
  padding: 48px 28px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 960px) {
  .hero-content { padding: 56px 48px 56px 40px; }
}
.hero-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.hero-content h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.hero-content .lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 28px;
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.hero-stats b {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.02em;
}
.hero-stats span {
  font-size: 13px;
  color: var(--muted);
}

/* Strip */
.strip {
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  padding: 12px 0;
}
.strip-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .strip-track { animation: none; }
}

/* Coloured bands: free images, no cards */
.band {
  color: #fff;
  overflow: hidden;
}
.band-inner {
  width: min(1180px, 92%);
  margin: 0 auto;
  display: grid;
  gap: 36px;
  align-items: center;
  padding: 72px 0;
}
@media (min-width: 900px) {
  .band-inner {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    padding: 88px 0;
  }
  .band-inner.reverse { direction: rtl; }
  .band-inner.reverse > * { direction: ltr; }
}
.band h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.band p {
  opacity: 0.92;
  margin-bottom: 26px;
  max-width: 42ch;
  line-height: 1.55;
}
.band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.band-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.band-visual img {
  max-width: 100%;
  max-height: 340px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.28));
  background: transparent;
}
.band-windows { background: linear-gradient(145deg, #0d5bbd, #1a73e8 55%, #4a9eff); }
.band-locks { background: linear-gradient(145deg, #12121a, #1a1a2e 50%, #252540); }
.band-roofs { background: linear-gradient(145deg, #0a3d2e, #0f4c3a 50%, #1a7f5a); }

/* Products rail */
.products-wrap {
  padding: 64px 0 48px;
  background: var(--bg);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section-head a {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}
.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 max(4%, calc((100% - 1180px) / 2 + 4%)) 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.product-card {
  flex: 0 0 250px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: transform 0.3s var(--spring), box-shadow 0.3s;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}
.product-media {
  position: relative;
  aspect-ratio: 1;
  background: #f0f2f5;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}
.stock {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: rgba(255,255,255,0.92);
  padding: 3px 9px;
  border-radius: 980px;
}
.product-info { padding: 14px 16px 18px; }
.product-info .sku {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.product-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.product-info h3 a:hover { color: var(--blue); }
.product-info .btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  width: 100%;
}

/* Reasons */
.reasons {
  padding: 64px 0;
}
.reasons h2 {
  text-align: center;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
}
.reasons-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 700px) { .reasons-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .reasons-grid { grid-template-columns: repeat(4, 1fr); } }
.reason {
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
}
.reason h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.reason p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Testimonials */
.testimonials {
  padding: 0 0 64px;
  background: var(--white);
}
.testimonials h2 {
  text-align: center;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
}
.testi-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 800px) { .testi-grid { grid-template-columns: repeat(3, 1fr); } }
.testi-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
}
.testi-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--ink-soft);
}
.testi-person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testi-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.testi-name { font-weight: 600; font-size: 14px; }
.testi-loc { font-size: 12px; color: var(--muted); }

/* Preorder */
.preorder {
  padding: 0 0 80px;
}
.preorder-box {
  background: linear-gradient(145deg, var(--blue), var(--blue-deep));
  border-radius: var(--radius-lg);
  padding: 52px 36px;
  text-align: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(26,115,232,0.25);
}
.preorder-box h2 {
  font-size: clamp(1.5rem, 2.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.preorder-box p {
  opacity: 0.92;
  max-width: 46ch;
  margin: 0 auto 26px;
  line-height: 1.5;
}
.preorder-box .btn-primary {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: none;
}
.preorder-box .btn-primary:hover { background: #f0f4ff; }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.35s var(--spring);
}
.modal-bg.open .modal { transform: none; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 20px;
  display: grid;
  place-items: center;
}
.modal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  padding-right: 36px;
}
.modal .lead {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--muted);
}
.field input, .field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
}
.calc-result { margin-top: 16px; display: none; }
.calc-result.show { display: block; }
.calc-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue);
}
.calc-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Footer */
footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  gap: 36px;
  margin-bottom: 40px;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}
.footer-brand img {
  height: 34px;
  margin-bottom: 14px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.5;
  max-width: 260px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 12px;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 14px;
  padding: 3px 0;
  color: #aaa;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: #777;
}

/* Call button in header */
.btn-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 980px;
  transition: background 0.2s, transform 0.2s;
}
.btn-call:hover { background: #d0e3f9; }
.btn-call:active { transform: scale(0.97); }
.btn-call svg { flex-shrink: 0; }
@media (max-width: 640px) {
  .btn-call .call-text { display: none; }
  .btn-call { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; }
}
.btn-header-preorder {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
}
@media (max-width: 480px) {
  .btn-header-preorder { display: none; }
}

/* Hero slides: dark stage so product photos without white box look clean */
.hero-slides {
  background: #1c1c1e !important;
}
.hero-slide img {
  object-fit: contain !important;
  object-position: center center;
  padding: 24px 16px 100px;
  background: transparent;
}
/* Prefer cover for wider lifestyle-style shots if they fill the frame */
.hero-slide img[src*="Untitled-design-2025-07-08T115551"],
.hero-slide img[src*="Fire-rated"],
.hero-slide img[src*="Italian-security"] {
  object-fit: cover !important;
  padding: 0 0 0 0;
}

.hero-arrow { display: none !important; }

/* ========== WhatsApp + Call header actions ========== */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #25d366;
  border-radius: 980px;
  transition: background 0.2s, transform 0.2s;
}
.btn-whatsapp:hover { background: #1ebe57; }
.btn-whatsapp:active { transform: scale(0.97); }
.btn-whatsapp svg { flex-shrink: 0; }

.header-actions {
  gap: 8px;
  flex-wrap: nowrap;
}
@media (max-width: 720px) {
  .btn-call .call-text,
  .btn-whatsapp .wa-text { display: none; }
  .btn-call,
  .btn-whatsapp {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .btn-header-preorder { display: none; }
}

/* ========== Hero: product photos without white box feel ========== */
.hero-slides {
  background: linear-gradient(160deg, #2a2a2e 0%, #1a1a1c 50%, #121214 100%) !important;
}
.hero-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-slide img {
  width: auto !important;
  max-width: 92% !important;
  max-height: calc(100% - 120px) !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 32px 20px 110px !important;
  background: transparent !important;
  /* Soften pure white studio backdrops */
  mix-blend-mode: normal;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.35));
}
.hero-slide-info {
  text-align: left;
}

/* ========== Responsive polish & centering ========== */
@media (max-width: 959px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-slides {
    min-height: 420px;
    aspect-ratio: 4 / 3;
  }
  .hero-content {
    text-align: center;
    padding: 40px 24px 48px;
    align-items: center;
  }
  .hero-content .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
    text-align: center;
  }
  .hero-slide-info {
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
  }
  .hero-slide-info p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 14px;
  }
}

@media (max-width: 600px) {
  .hero-slides {
    min-height: 360px;
  }
  .hero-slide img {
    max-height: calc(100% - 130px) !important;
    padding: 20px 12px 120px !important;
  }
  .hero-content h1 {
    font-size: 1.75rem;
  }
  .band-inner {
    text-align: center;
    padding: 56px 0;
  }
  .band p {
    margin-left: auto;
    margin-right: auto;
  }
  .band-actions {
    justify-content: center;
  }
  .band-visual img {
    max-height: 260px;
  }
  .section-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .reasons h2,
  .testimonials h2 {
    padding: 0 16px;
  }
  .preorder-box {
    padding: 40px 24px;
  }
  .header-inner {
    gap: 12px;
  }
  .logo img {
    height: 32px;
  }
}

@media (min-width: 960px) {
  .hero-content {
    text-align: left;
  }
}

/* Footer logo clear */
.footer-logo {
  display: inline-block;
  margin-bottom: 14px;
}
.footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.footer-brand p {
  margin-top: 0;
}

/* Safe areas for notched phones */
.site-header {
  padding-top: env(safe-area-inset-top, 0);
}
@supports (padding: max(0px)) {
  .header-inner {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

/* Page hero (internal pages) */
.page-hero {
  background: var(--bg);
  padding: 56px 0 48px;
  text-align: center;
}
.page-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}
.page-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.page-hero .lead {
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.55;
}
.rail.products-grid,
.products-wrap .rail {
  justify-content: flex-start;
}
@media (min-width: 700px) {
  .products-wrap .rail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    overflow: visible;
    padding-left: max(4%, calc((100% - 1180px) / 2 + 4%));
    padding-right: max(4%, calc((100% - 1180px) / 2 + 4%));
  }
  .products-wrap .product-card {
    flex: none;
    width: 100%;
  }
}

/* ========== Core Web Vitals ========== */

/* CLS: reserve hero space before images paint */
.hero {
  min-height: 560px;
  contain: layout style;
}
@media (min-width: 960px) {
  .hero { min-height: 640px; }
}
.hero-slides {
  aspect-ratio: 4 / 3;
  min-height: 380px;
  contain: layout paint;
}
@media (min-width: 960px) {
  .hero-slides {
    aspect-ratio: auto;
    min-height: 100%;
  }
}

/* CLS: product cards fixed aspect before img loads */
.product-media {
  aspect-ratio: 1 / 1;
  contain: layout paint;
}
.product-media img {
  aspect-ratio: 1 / 1;
}

/* LCP: avoid layout shift on logo */
.logo img {
  width: auto;
  height: 38px;
  aspect-ratio: auto;
}

/* Below-fold sections: browser may skip render work until near viewport */
.band,
.products-wrap,
.reasons,
.testimonials,
.preorder {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

/* Prefer reduced data / motion already handled; ensure no layout thrash */
.hero-slide:not(.active) {
  content-visibility: hidden;
}
.hero-slide.active {
  content-visibility: visible;
}

/* System font stack already used — avoid FOIT; explicit metrics if custom fonts added later */
body {
  font-display: swap;
}

/* ========== Image delivery ========== */
img {
  max-width: 100%;
  height: auto;
  /* Avoid expensive paints on large images during scroll */
  content-visibility: auto;
}
.hero-slide img {
  /* LCP image must paint; do not use content-visibility hidden on active */
  content-visibility: visible;
}
.hero-slide:not(.active) img {
  content-visibility: hidden;
}
/* GPU-friendly compositing for product cards */
.product-media img {
  transform: translateZ(0);
}
/* Prefer crisp downscaling */
img {
  image-rendering: auto;
}

/* Contact row under primary CTAs */
.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-contact .btn-call,
.hero-contact .btn-whatsapp {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
}
@media (max-width: 959px) {
  .hero-contact {
    justify-content: center;
  }
}

/* Hero: white background, black copy */
.hero {
  background: #ffffff !important;
}
.hero-slides {
  background: #ffffff !important;
  background-image: none !important;
}
.hero-slide-info {
  background: linear-gradient(transparent, rgba(255,255,255,0.92) 35%, #fff 100%) !important;
  color: #111 !important;
}
.hero-slide-info .sku {
  color: #666 !important;
  opacity: 1 !important;
}
.hero-slide-info h2 {
  color: #111 !important;
}
.hero-slide-info p {
  color: #333 !important;
  opacity: 1 !important;
}
.hero-slide-info .btn {
  background: var(--blue) !important;
  color: #fff !important;
}
.hero-slide-info .btn:hover {
  background: var(--blue-dark) !important;
}
.hero-content {
  background: #fff;
  color: #111;
}
.hero-content h1 {
  color: #111;
}
.hero-content .lead {
  color: #555;
}
.hero-tag {
  color: var(--blue);
}
.hero-stats b {
  color: var(--blue);
}
.hero-stats span {
  color: #666;
}
.hero-dot {
  background: rgba(0,0,0,0.25) !important;
}
.hero-dot.active {
  background: var(--blue) !important;
}
.hero-progress {
  background: var(--blue) !important;
}
.hero-controls {
  /* dots visible on white */
}

/* ========== Hero images: fit container (authoritative) ========== */
.hero-slides {
  position: relative;
  overflow: hidden;
  background: #fff !important;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-slide img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 16px 16px 96px !important;
  margin: 0 auto !important;
  background: transparent !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  box-sizing: border-box !important;
}
@media (min-width: 960px) {
  .hero-slide img {
    padding: 24px 32px 110px !important;
  }
}
@media (max-width: 600px) {
  .hero-slide img {
    padding: 12px 12px 100px !important;
  }
}

/* ========== Responsive: fit all display sizes ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}
.container {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Header scales cleanly */
.header-inner {
  gap: 12px;
  min-height: 56px;
  height: auto;
  padding: 8px 0;
}
.logo img {
  height: clamp(28px, 5vw, 38px);
  width: auto;
}
.nav-links a {
  font-size: clamp(12px, 1.2vw, 14px);
  padding: 6px 10px;
}
@media (max-width: 899px) {
  .nav-links { display: none !important; }
}
@media (min-width: 900px) {
  .menu-toggle { display: none !important; }
}

/* Hero: fluid on all viewports */
.hero {
  min-height: unset !important;
  display: grid;
  grid-template-columns: 1fr;
}
.hero-slides {
  width: 100%;
  min-height: clamp(280px, 55vw, 520px) !important;
  aspect-ratio: 4 / 3;
  max-height: 70vh;
}
.hero-content {
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) !important;
}
.hero-content h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.75rem) !important;
  line-height: 1.15;
}
.hero-content .lead {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-actions .btn {
  min-height: 44px;
  flex: 1 1 auto;
  min-width: min(100%, 140px);
  justify-content: center;
}
.hero-stats {
  gap: clamp(16px, 4vw, 28px);
}
.hero-stats b {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}
.hero-slide-info {
  padding: 16px clamp(12px, 3vw, 24px) 52px !important;
}
.hero-slide-info h2 {
  font-size: clamp(1rem, 2.5vw, 1.45rem) !important;
}
.hero-slide img {
  padding: 12px 12px clamp(72px, 18vw, 110px) !important;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: min(640px, 85vh) !important;
  }
  .hero-slides {
    aspect-ratio: auto;
    min-height: 100% !important;
    max-height: none;
    height: 100%;
  }
  .hero-actions .btn {
    flex: 0 1 auto;
  }
}

/* Bands */
.band-inner {
  padding: clamp(40px, 8vw, 88px) 0 !important;
  gap: clamp(24px, 4vw, 56px) !important;
}
.band h2 {
  font-size: clamp(1.35rem, 3vw, 2.15rem) !important;
}
.band-visual img {
  max-height: clamp(200px, 40vw, 340px) !important;
  width: auto;
  max-width: 100%;
}

/* Product rail / grid */
.product-card {
  flex: 0 0 min(250px, 75vw);
}
@media (min-width: 700px) {
  .products-wrap .rail {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 16px;
  }
  .products-wrap .product-card {
    flex: none;
    width: 100%;
    max-width: none;
  }
}

/* Page hero */
.page-hero {
  padding: clamp(36px, 6vw, 56px) 0 clamp(32px, 5vw, 48px);
}
.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Preorder box */
.preorder-box {
  padding: clamp(32px, 6vw, 52px) clamp(20px, 4vw, 36px) !important;
  border-radius: clamp(12px, 2vw, 20px);
}
.preorder-box h2 {
  font-size: clamp(1.25rem, 3vw, 1.9rem);
}

/* Footer */
.footer-grid {
  gap: clamp(24px, 4vw, 36px);
}
@media (max-width: 799px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .btn-header-preorder {
    font-size: 13px;
    padding: 0 12px;
    min-height: 36px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

/* Large desktops */
@media (min-width: 1400px) {
  .container {
    width: min(1180px, 90%);
  }
}

/* Hide removed contact styles if any leftover */
.hero-contact { display: none !important; }

/* Hero content panel: soft contrast against white slideshow */
.hero-content {
  background: #f0f4f8 !important;
  color: #111;
}
.hero-content h1 {
  color: #111;
}
.hero-content .lead {
  color: #445;
}
.hero-tag {
  color: var(--blue);
}
.hero-stats b {
  color: var(--blue-dark);
}
.hero-stats span {
  color: #556;
}
@media (max-width: 959px) {
  .hero-content {
    background: #f0f4f8 !important;
    border-top: 1px solid #e2e8f0;
  }
}
@media (min-width: 960px) {
  .hero-content {
    border-left: 1px solid #e2e8f0;
  }
}

/* Full-size hero product images on every viewport */
.hero-slides {
  overflow: hidden;
}
.hero-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-slide img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 12px 12px 88px !important;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
@media (min-width: 600px) {
  .hero-slide img {
    padding: 20px 24px 100px !important;
  }
}
@media (min-width: 960px) {
  .hero-slide img {
    padding: 28px 36px 120px !important;
  }
}
/* Give slideshow enough room so full products read clearly */
.hero-slides {
  min-height: clamp(320px, 70vw, 560px) !important;
}
@media (min-width: 960px) {
  .hero-slides {
    min-height: 100% !important;
  }
  .hero {
    min-height: min(680px, 90vh) !important;
  }
}

/* Revert: images fit slideshow container (previous behaviour) */
.hero-slides {
  background: #fff !important;
  overflow: hidden;
  min-height: clamp(280px, 55vw, 520px) !important;
}
@media (min-width: 960px) {
  .hero-slides {
    min-height: 100% !important;
  }
}
.hero-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-slide img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 24px 16px 100px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.12));
}
@media (min-width: 960px) {
  .hero-slide img {
    padding: 32px 28px 110px !important;
  }
}
@media (max-width: 600px) {
  .hero-slide img {
    padding: 16px 12px 96px !important;
  }
}

/* Previous slide copy fonts (readable on white) */
.hero-slide-info {
  background: linear-gradient(transparent, rgba(255,255,255,0.95) 40%, #fff 100%) !important;
  color: #111 !important;
  text-align: left;
  padding: 28px 24px 56px !important;
}
.hero-slide-info h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  color: #111 !important;
  margin-bottom: 6px !important;
}
.hero-slide-info p {
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: #333 !important;
  opacity: 1 !important;
  margin-bottom: 14px !important;
  max-width: 40ch;
  font-weight: 400 !important;
}
.hero-slide-info .btn {
  min-height: 40px !important;
  padding: 0 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  background: var(--blue) !important;
  color: #fff !important;
  border-radius: 980px !important;
}
@media (max-width: 959px) {
  .hero-slide-info {
    text-align: center;
    padding: 20px 16px 52px !important;
  }
  .hero-slide-info p {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Product rail: object-fit + clean name / in stock (no URLs) */
.product-media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0f2f5;
}
.product-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 12px;
  display: block;
}
.product-info .stock-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--success, #1a7f37);
  margin: 0 0 4px;
}
.product-info .product-name,
.product-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  word-break: normal;
  overflow-wrap: anywhere;
}
.product-info .product-name a,
.product-info h3 a {
  color: #111;
  text-decoration: none;
}
.product-info .product-name a:hover,
.product-info h3 a:hover {
  color: var(--blue);
}
/* Hide any accidental raw URL text */
.product-info a[href]:not(.btn) {
  /* name links only */
}
