/* =============================================
   LEOPLAST — Custom Premium CSS
   ============================================= */


/* ---- CSS Variables ---- */
:root {
  --blue-900: #0c1f3f;
  --blue-800: #0f2a55;
  --blue-700: #1a3a6e;
  --blue-600: #1e4d8c;
  --blue-500: #2563eb;
  --blue-400: #3b7fe8;
  --blue-300: #7eb3f5;
  --blue-100: #dbeafe;
  --red-900: #7f1d1d;
  --red-800: #991b1b;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-300: #fca5a5;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-900: #111827;
}

/* =============================================
   GLOBAL — kill any phantom horizontal scroll on mobile.
   `overflow-x: clip` is the modern way to contain horizontal overflow
   WITHOUT breaking position:fixed descendants (the way overflow:hidden
   does on some mobile browsers). It also doesn't create a scroll
   context, so the page still scrolls vertically as normal.
   Belt + braces on both html and body — the carousel tracks
   (width:max-content with cloned cards) and the hero slider were
   leaking past viewport on mobile.
   ============================================= */
html, body {
  overflow-x: clip;
  max-width: 100%;
}

/* =============================================
   SCROLLBAR — hidden; #scroll-progress under the navbar replaces it
   ============================================= */

/* Firefox */
html {
  scrollbar-width: none;
}

/* WebKit */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner {
  display: none;
}

/* =============================================
   SCROLL-PROGRESS BAR (under the fixed navbar)
   A thin gradient bar that fills left-to-right as the user scrolls
   the page. JS updates the --scroll-progress CSS variable on scroll.
   ============================================= */

#scroll-progress {
  position: fixed;
  left: 0;
  /* top is set in JS to the navbar's actual bottom edge so the bar
     always sits flush, regardless of breakpoint / scroll state */
  top: 0;
  width: 100%;
  height: 3px;
  z-index: 1001;
  pointer-events: none;
  background: rgba(12, 31, 63, 0.05);
  /* Faint at the top of the page (where it sits over the hero) and
     ramps to full opacity once the user scrolls — see the .scrolled rule. */
  opacity: 0.1;
  transition: top 0.25s ease, opacity 0.4s ease;
}

/* Navbar gains .scrolled past 60px; the bar is a later body sibling, so
   lift it to full opacity once the user starts scrolling. */
#navbar.scrolled ~ #scroll-progress {
  opacity: 1;
}

#scroll-progress::before {
  content: '';
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue-500) 0%, var(--blue-300) 50%, var(--red-600) 100%);
  transform-origin: left center;
  transform: scaleX(var(--scroll-progress, 0));
  transition: transform 0.08s linear;
}

/* =============================================
   ANIMATED LOADER
   ============================================= */
#loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0c1f3f 0%, #0f2a55 50%, #1a3a6e 100%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-scene {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circle-lines {
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
}

.circle-lines.out {
  inset: 0;
  border-top-color: var(--blue-600);
  border-bottom-color: var(--blue-400);
  animation: spin 2s linear infinite;
}

.circle-lines.in {
  inset: 20px;
  border-left-color: var(--blue-300);
  border-right-color: var(--blue-500);
  animation: spin-reverse 3s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse {
  0% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.loader-logo {
  width: 140px;
  height: auto;
  object-fit: contain;
  animation: pulseLogo 2s ease-in-out infinite;
}

@keyframes pulseLogo {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.dot-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.dot-loader .dot {
  width: 12px;
  height: 12px;
  background-color: var(--blue-600);
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.dot-loader .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.dot-loader .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounceDot {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* =============================================
   NAVBAR
   ============================================= */
#navbar {
  transition: all 0.3s ease;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#navbar.scrolled .nav-link {
  color: var(--blue-900);
}

#navbar.scrolled .nav-quote {
  background: var(--blue-900);
  color: white;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  width: 22%;
  max-width: 200px;
  min-width: 130px;
}

.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

#navbar.scrolled .logo-light {
  display: none;
}

#navbar.scrolled .logo-dark {
  display: block;
}

.nav-mobile-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  /* Default light for dark hero bg */
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.3s ease;
}

#navbar.scrolled .nav-mobile-btn {
  color: #0c1f3f;
  /* Dark icon for white scrolled bg */
}

.nav-link {
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: white;
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #7eb3f5;
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active-page::after {
  width: 100%;
}

.nav-link.active-page.roofing-active::after,
.nav-link[href$="roofing.html"]:hover::after {
  background: #dc2626;
}

/* ============ MOBILE MENU — modern animated drawer ============ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  box-sizing: border-box;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 5rem 1.85rem clamp(8rem, 18vh, 11rem);
  background:
    radial-gradient(135% 55% at 50% 0%, rgba(37, 99, 235, 0.32), transparent 58%),
    radial-gradient(110% 60% at 100% 100%, rgba(14, 165, 233, 0.16), transparent 55%),
    linear-gradient(160deg, #0a1d3e 0%, #0b1f3f 50%, #07142b 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
          backdrop-filter: blur(18px) saturate(1.15);
  counter-reset: mnav;
  animation: menuFadeIn 0.3s ease;
}
.mobile-menu.active { display: flex; }

.mobile-menu .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: clamp(1.55rem, 7vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: left;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0;                       /* revealed by the staggered animation */
  transform: translateX(-20px);
}
.mobile-menu.active .nav-link {
  animation: mnavItemIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mobile-menu.active .nav-link:nth-child(1) { animation-delay: 0.10s; }
.mobile-menu.active .nav-link:nth-child(2) { animation-delay: 0.17s; }
.mobile-menu.active .nav-link:nth-child(3) { animation-delay: 0.24s; }
.mobile-menu.active .nav-link:nth-child(4) { animation-delay: 0.31s; }
.mobile-menu.active .nav-link:nth-child(5) { animation-delay: 0.38s; }
@keyframes mnavItemIn { to { opacity: 1; transform: translateX(0); } }

/* index number 01..05 */
.mobile-menu .nav-link::before {
  counter-increment: mnav;
  content: counter(mnav, decimal-leading-zero);
  flex: none;
  width: 1.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #7eb3f5;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}
/* trailing arrow (overrides the desktop underline ::after on mobile) */
.mobile-menu .nav-link::after {
  content: "→";
  position: static;
  width: auto;
  height: auto;
  margin-left: auto;
  background: none;
  font-size: 1.05rem;
  color: #7eb3f5;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active-page { color: #7eb3f5; }
.mobile-menu .nav-link:hover::before,
.mobile-menu .nav-link.active-page::before { opacity: 1; }
.mobile-menu .nav-link:hover::after,
.mobile-menu .nav-link.active-page::after { opacity: 1; transform: translateX(0); }
.mobile-menu .nav-link.active-page.roofing-active,
.mobile-menu .nav-link.active-page.roofing-active::before,
.mobile-menu .nav-link.active-page.roofing-active::after { color: #f87171; }

.mobile-menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1.25rem;
}

.mobile-menu .get-quote-mobile {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.95rem 2rem;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: #fff;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
}

@keyframes menuFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =============================================
   HERO SLIDESHOW — "Editorial Photo"
   Text on the left over deep navy; a scene photo bleeds in from the
   right and fades/blends into the navy toward the centre-left.
   Per-slide accent via inline --accent / --accent-soft on each .slide.
   ============================================= */
.hero-slider {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--blue-900);
  counter-reset: slidenum;           /* drives the 01..05 index numbers */
}

/* Crossfade — JS toggles .active; keep the opacity contract */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  display: block;
  counter-increment: slidenum;
  --accent: #6aa7f5;
  --accent-soft: rgba(106, 167, 245, 0.2);
}
.slide.active { opacity: 1; z-index: 1; }
.slide.prev   { opacity: 0; z-index: 0; }

/* Deep navy stage — one gradient for all slides; the accent differentiates them */
.slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1e3c 0%, #0f2a55 55%, #112f66 100%);
}
/* Single subtle drifting accent orb behind the text side (kinetic touch) */
.slide-bg::before {
  content: "";
  position: absolute;
  top: -16%;
  left: -8%;
  width: 52%;
  height: 70%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 75%);
  filter: blur(46px);
  opacity: 0.85;
  pointer-events: none;
  animation: efDrift 16s ease-in-out infinite alternate;
}
/* Accent wash behind the text + soft floor vignette */
.slide-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 70% at 24% 46%, var(--accent-soft), transparent 70%),
    radial-gradient(120% 120% at 50% 122%, rgba(0, 0, 0, 0.4), transparent 60%);
  pointer-events: none;
}
@keyframes efDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4%, 4%, 0) scale(1.08); }
}

/* ---- Scene photo bleeding in from the right, blended into the navy ---- */
.slide-photo {
  position: absolute;
  inset: 0;
  z-index: 1;                 /* above .slide-bg (0), below .slide-content (2) */
  overflow: hidden;
  pointer-events: none;
}
.slide-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  filter: saturate(0.96) brightness(0.92);
  /* fade the left edge to transparent so the photo melts into the navy —
     keep more navy on the left so the text always has a clean backdrop */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 24%, #000 60%, #000 100%);
          mask-image: linear-gradient(to right, transparent 0%, transparent 24%, #000 60%, #000 100%);
}
/* navy tint that unifies the photo with the brand palette + protects the nav/text */
.slide-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, #0a1a34 0%, rgba(10, 26, 52, 0.72) 32%, rgba(10, 26, 52, 0.2) 60%, rgba(10, 26, 52, 0) 100%),
    linear-gradient(to bottom, rgba(8, 20, 40, 0.5) 0%, transparent 16%),
    linear-gradient(to top, rgba(8, 20, 40, 0.55), transparent 42%);
  pointer-events: none;
}

/* ---- Text column (left) ---- */
.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 7.5rem 4rem 5.5rem;
  display: flex;
  align-items: center;
}
.slide-text { max-width: 560px; }

/* Giant faint index watermark behind the text */
.slide-content::before {
  content: counter(slidenum, decimal-leading-zero);
  position: absolute;
  top: 4.5rem;
  left: 2.5rem;
  font-size: clamp(8rem, 18vw, 16rem);
  font-weight: 800;
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: -0.04em;
  z-index: -1;
  pointer-events: none;
}

/* Staggered entrance, replays each time a slide becomes active */
.slide.active .slide-photo  { animation: efPhoto 1s 0.05s ease both; }
.slide.active .slide-eyebrow { animation: efRise 0.7s 0.10s ease both; }
.slide.active .slide-title   { animation: efRise 0.7s 0.18s ease both; }
.slide.active .slide-subtitle{ animation: efRise 0.7s 0.26s ease both; }
.slide.active .slide-actions { animation: efRise 0.7s 0.34s ease both; }

@keyframes efRise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes efPhoto {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.6rem;
}
.slide-index {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.slide-index::before { content: counter(slidenum, decimal-leading-zero); }
.slide-index::after  { content: " / 05"; color: rgba(255, 255, 255, 0.4); }
.slide-rule {
  flex: 0 0 auto;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.slide-badge {
  display: inline-block;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: rgba(219, 234, 254, 0.9);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.slide-title {
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
.slide-title span {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}
/* Luminous gradient fill on the highlighted phrase */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .slide-title span {
    background: linear-gradient(92deg, var(--accent), #eaf3ff 85%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
  }
}
.slide-title span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.12em;
  width: 2.4em;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.7;
}

.slide-subtitle {
  font-size: 1.06rem;
  color: rgba(219, 234, 254, 0.85);
  line-height: 1.7;
  margin: 0 0 2.4rem;
  max-width: 46ch;
  text-shadow: 0 1px 12px rgba(6, 16, 34, 0.45);
}
.slide-subtitle br { display: none; }

.slide-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.9rem;
  border-radius: 9999px;
  background: #fff;
  color: #0c1f3f;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary::after {
  content: "\2192";
  font-size: 1.05em;
  transition: transform 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}
.btn-primary:hover::after { transform: translateX(3px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.7rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---- Controls ---- */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-50%) scale(1.08);
}
.slider-prev { left: 1.75rem; }
.slider-next { right: 1.75rem; }

.slider-nav {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.3s ease;
}
.slider-dot.active {
  width: 30px;
  background: #fff;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.25rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---- Responsive ---- */
/* Tablet / phone — VERTICAL SPLIT: photo showcased across the top, dissolving
   downward into the navy; text + CTAs sit in the navy below. Mirrors the
   desktop "showcase + blend", rotated 90deg. */
@media (max-width: 980px) {
  .slide-content {
    flex-direction: column;
    justify-content: flex-end;     /* push the text block into the lower navy zone */
    align-items: center;
    text-align: center;
    padding: 6rem 1.5rem 4.5rem;
  }
  .slide-text { max-width: 600px; }
  .slide-eyebrow { justify-content: center; }
  .slide-subtitle { margin-left: auto; margin-right: auto; }
  .slide-actions { justify-content: center; }
  .slide-content::before { display: none; }   /* drop the big index watermark on mobile */

  /* Photo lives on the top half and fades down into the navy */
  .slide-photo img {
    object-position: center top;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 56%, transparent 86%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 56%, transparent 86%);
  }
  .slide-photo::after {
    background:
      linear-gradient(to top, rgba(8, 18, 38, 0.88) 4%, rgba(8, 18, 38, 0.42) 30%, transparent 62%),
      linear-gradient(to bottom, rgba(8, 20, 40, 0.45) 0%, transparent 14%);
  }
}

/* Phones */
@media (max-width: 768px) {
  .slide-content { padding: 6rem 1.25rem 5rem; }
  .slide-title { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  .slide-subtitle { font-size: 0.95rem; }
  .slider-arrow { width: 38px; height: 38px; }
  .slider-prev { left: 0.5rem; }
  .slider-next { right: 0.5rem; }
  .scroll-indicator { display: none; }
}

/* Small phones */
@media (max-width: 480px) {
  .slide-content { padding: 5.5rem 1rem 4.5rem; }
  .slide-title { font-size: clamp(1.75rem, 9vw, 2.2rem); }
  .slide-badge { font-size: 0.66rem; letter-spacing: 0.14em; }
  .slide-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 300px; margin-inline: auto; }
  .btn-primary, .btn-ghost { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .slide-bg::before { animation: none; }
  .slide.active .slide-photo,
  .slide.active .slide-eyebrow,
  .slide.active .slide-title,
  .slide.active .slide-subtitle,
  .slide.active .slide-actions { animation: none; }
}



/* =============================================
   MOVE TO TOP BUTTON
   ============================================= */
.move-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.move-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.move-to-top-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #1e4d8c, #0c1f3f);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
  animation: scrollLine 1.5s ease-in-out infinite;
}

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }

  50% {
    transform: scaleY(1);
    transform-origin: top;
  }

  51% {
    transform: scaleY(1);
    transform-origin: bottom;
  }

  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* =============================================
   STATS SECTION
   ============================================= */
.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.1);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--blue-600);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* =============================================
   WHY LEOPLAST SECTION
   ============================================= */
.why-section {
  background: linear-gradient(135deg, #f8faff 0%, #eef4ff 50%, #f0f7ff 100%);
  position: relative;
  overflow: hidden;
}

.why-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06), transparent 70%);
}

.why-feature-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(37, 99, 235, 0.08);
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.why-feature-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.why-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

/* Video Container */
.video-container {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(12, 31, 63, 0.25);
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0c1f3f, #1a3a6e);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.video-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  cursor: pointer;
  border: none;
  color: var(--blue-600);
  font-size: 1.5rem;
}

.video-play-btn:hover {
  transform: scale(1.1);
}

.video-play-btn::before {
  content: '▶';
  margin-left: 4px;
}

.video-iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: none;
  object-fit: contain;
  background: #000;
}

.video-iframe.active {
  display: block;
}

.video-thumbnail.hidden {
  display: none;
}

/* =============================================
   PRODUCTS SECTION
   ============================================= */
.product-card {
  background: white;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 175, 0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.3s ease;
}

/* Cursor-following spotlight glow (uses --mx/--my CSS vars set by JS) */
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(37, 99, 235, 0.14),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.product-card-img,
.product-card-body {
  position: relative;
  z-index: 1;
}

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 36px rgba(30, 64, 175, 0.10),
                0 4px 10px rgba(30, 64, 175, 0.06);
    border-color: rgba(37, 99, 235, 0.35);
  }

  .product-card:hover::before {
    opacity: 1;
  }

  /* Image lifts and scales softly */
  .product-card-img img {
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
                filter 0.4s ease;
  }
  .product-card:hover .product-card-img img {
    transform: translateY(-8px) scale(1.06);
    filter: drop-shadow(0 14px 18px rgba(12, 31, 63, 0.18));
  }

  /* Title nudges up + colour shift */
  .product-card-title {
    transition: transform 0.35s ease, color 0.3s ease;
  }
  .product-card:hover .product-card-title {
    transform: translateY(-2px);
    color: #1e3a8a;
  }

  /* Link arrow gap widens, link emphasised */
  .product-card-link {
    transition: gap 0.3s ease, color 0.3s ease, letter-spacing 0.3s ease;
  }
  .product-card:hover .product-card-link {
    gap: 0.65rem;
    letter-spacing: 0.02em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card::before,
  .product-card-img img,
  .product-card-title,
  .product-card-link {
    transition: none !important;
  }
  .product-card:hover .product-card-img img {
    transform: none !important;
  }
}

/* =============================================
   PRODUCT CAROUSEL — auto-sliding marquee with prev/next arrows
   ============================================= */
.product-carousel {
  position: relative;
}

.carousel-viewport {
  /* Clip horizontally only — cards translated past the bounds vanish,
     but vertical hover lift + shadow flow freely into the surrounding
     page (no hard cut-off line below/above the cards). */
  clip-path: inset(-60px 0);
  -webkit-clip-path: inset(-60px 0);
  padding: 1.25rem 0 1.5rem;
}

.carousel-track {
  display: flex;
  gap: 1.75rem;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-track .product-card {
  flex: 0 0 calc((100% - 3.5rem) / 3);   /* 3 visible · 2 gaps of 1.75rem */
}

@media (max-width: 900px) {
  .carousel-track .product-card {
    flex: 0 0 calc((100% - 1.75rem) / 2); /* 2 visible · 1 gap */
  }
}

@media (max-width: 600px) {
  .carousel-track .product-card {
    flex: 0 0 100%;                       /* 1 visible */
  }
  .carousel-track { gap: 1rem; }
}

.carousel-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: white;
  border: 1px solid rgba(12, 31, 63, 0.08);
  color: #0c1f3f;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(12, 31, 63, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease,
              box-shadow 0.25s ease, transform 0.25s ease,
              border-color 0.25s ease;
  padding: 0;
}

.carousel-arrow:hover {
  background: linear-gradient(135deg, #1e4d8c, #0c1f3f);
  color: white;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 14px 30px rgba(12, 31, 63, 0.28);
  border-color: transparent;
}

.carousel-arrow:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.carousel-arrow svg { display: block; }

.carousel-prev { left: -24px; }
.carousel-next { right: -24px; }

@media (max-width: 1280px) {
  .carousel-prev { left: 6px; }
  .carousel-next { right: 6px; }
}

@media (max-width: 600px) {
  .carousel-arrow { width: 42px; height: 42px; }
  .carousel-prev { left: 4px; }
  .carousel-next { right: 4px; }
}

.product-card-img {
  height: 360px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.product-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(12, 31, 63, 0.04));
  pointer-events: none;
}

.product-card-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.product-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 0.4rem;
}

.product-card-desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1rem;
}

.product-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: none;
  transition: gap 0.2s;
}

.product-card-link:hover {
  gap: 0.6rem;
}

/* =============================================
   PRODUCT DETAIL PAGES
   ============================================= */
.page-hero {
  --hero-bg-image: url('assets/all-products.webp');
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 60%, #1a3a6e 100%);
  padding: 8rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Variant: page-hero with a right-side product image (used on
   products.html). Background stays full-width; only the inner flex
   container (.page-hero-inner) is constrained. */
.page-hero--with-image {
  /* Override the default .page-hero padding so the image can hug the
     bottom edge — inner handles top padding for navbar clearance */
  padding: 0;
  text-align: left;
}
.page-hero-inner {
  display: flex;
  align-items: end;            /* image bottom hugs the hero bottom */
  justify-content: space-between;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 7rem 1.5rem 0;      /* top clears the fixed navbar; no bottom pad */
  position: relative;
  z-index: 2;
}
.page-hero--with-image .page-hero-text {
  flex: 1 1 45%;
  max-width: 560px;
  padding-bottom: 3rem;        /* breathing room under the text */
  align-self: center;          /* text vertically centred */
}
.page-hero--with-image .page-hero-title {
  text-align: left;
}
.page-hero-product-image {
  flex: 0 1 55%;
  width: 55%;
  max-width: 720px;
  height: auto;
  display: block;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.4));
}

@media (max-width: 900px) {
  .page-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 6rem 1.25rem 2.5rem;
  }
  .page-hero--with-image .page-hero-text {
    flex: 1 1 auto;
    max-width: 100%;
    padding-bottom: 0;
    align-self: auto;
  }
  .page-hero--with-image .page-hero-text p {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .page-hero--with-image .page-hero-title {
    text-align: center;
  }
  .page-hero-product-image { display: none; }
}

/* Layer 1: faint dot grid (industrial-grade texture) + the original
   radial bloom kept on top. */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.07) 1.5px, transparent 1.6px),
    radial-gradient(ellipse at 60% 50%, rgba(37, 99, 235, 0.18), transparent 70%);
  background-size: 32px 32px, 100% 100%;
  background-position: 0 0, 0 0;
  pointer-events: none;
  z-index: 0;
  animation: page-hero-grid-drift 24s linear infinite;
}

/* Layer 2: a product photo, faded into the right side of the hero so it
   reads as ambient product visual without competing with the title.
   Defaults to the all-products group shot; individual product pages override
   --hero-bg-image with their own product image. Masked to the right ~75%
   so it never blocks the text. */
.page-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  background: var(--hero-bg-image) center right / contain no-repeat;
  opacity: 0.17;
  filter: saturate(1.1);
  -webkit-mask-image: linear-gradient(to left, black 25%, transparent 95%);
          mask-image: linear-gradient(to left, black 25%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}

/* products.html already renders the product group as a real foreground
   image, so suppress the faded backdrop there to avoid the double. */
.page-hero--with-image::after { display: none; }

/* Roofing page is a full-screen image hero (home.webp covers everything)
   — the dot grid + faded all-products would clash with the photo. */
.page-hero.roofing-hero::before,
.page-hero.roofing-hero::after {
  display: none;
}

@keyframes page-hero-grid-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px 32px, 0 0; }
}

.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

/* Animated gradient underline accent — draws in on page load,
   gives the title focus without being heavy. */
.page-hero-title::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  margin: 0.9rem auto 0;
  background: linear-gradient(90deg, transparent, var(--blue-300), #ffffff, var(--blue-300), transparent);
  border-radius: 9999px;
  animation: page-hero-line 1.4s cubic-bezier(0.2, 0.9, 0.3, 1.1) 0.2s forwards;
}

.page-hero--with-image .page-hero-title::after {
  margin-left: 0;
  margin-right: auto;
  background: linear-gradient(90deg, var(--blue-300), #ffffff, var(--blue-300), transparent);
}

@keyframes page-hero-line {
  0%   { width: 0;    opacity: 0; }
  60%  {              opacity: 1; }
  100% { width: 92px; opacity: 1; }
}

@media (max-width: 600px) {
  .page-hero::after {
    width: 80%;
    opacity: 0.12;
    background-size: 70% auto;
  }
  .page-hero-title::after {
    height: 2px;
    margin-top: 0.6rem;
  }
  @keyframes page-hero-line {
    0%   { width: 0;    opacity: 0; }
    60%  {              opacity: 1; }
    100% { width: 64px; opacity: 1; }
  }
}

.page-hero-title span {
  background: linear-gradient(90deg, #7eb3f5, white);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(219, 234, 254, 0.7);
  position: relative;
}

.breadcrumb a {
  color: rgba(219, 234, 254, 0.7);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: white;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: white;
  border-radius: 1rem;
  padding: 1.75rem;
  border: 1px solid rgba(12, 31, 63, 0.06);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.08);
  transform: translateY(-3px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: white;
}

.feature-icon.red {
  background: linear-gradient(135deg, var(--red-600), var(--red-900));
}

/* SVG icons inside feature-icon / why-icon containers render in white */
.feature-icon svg,
.why-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  color: white;
}

.app-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--blue-700);
  font-size: 0.85rem;
  font-weight: 500;
}

/* =============================================
   ROOFING PAGE — RED THEME
   ============================================= */
.roofing-hero {
  background: linear-gradient(135deg, var(--red-900) 0%, var(--red-800) 60%, #5c1010 100%);
}

.roofing-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.roofing-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

/* =============================================
   CONTACT PAGE
   ============================================= */
.contact-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid rgba(12, 31, 63, 0.1);
  border-radius: 0.75rem;
  background: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--gray-900);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.contact-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

textarea.contact-input {
  resize: vertical;
  min-height: 120px;
}

.btn-primary {
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: white;
  border: none;
  border-radius: 9999px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.contact-info-card {
  background: white;
  border-radius: 1.25rem;
  padding: 2rem;
  border: 1px solid rgba(12, 31, 63, 0.06);
  box-shadow: 0 4px 20px rgba(12, 31, 63, 0.06);
}

.contact-info-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(12, 31, 63, 0.06);
}

.contact-info-row:last-child {
  border-bottom: none;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: white;
}

/* =============================================
   FOOTER
   ============================================= */
.footer-link {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.footer-link:hover {
  color: #7eb3f5;
}

/* Mobile footer layout — applies to every page that uses the
   2fr 1fr 1fr 1fr footer grid:
     Row 1: branding (col 1) — spans both
     Row 2: Products | More Products
     Row 3: Contact (col 4) — spans both
   The index page had this inline; lifting it here so every page picks
   it up uniformly. */
@media (max-width: 768px) {
  footer > div > div[style*="grid-template-columns:2fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }
  footer > div > div[style*="grid-template-columns:2fr"] > div:nth-child(1),
  footer > div > div[style*="grid-template-columns:2fr"] > div:nth-child(4) {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 480px) {
  footer > div > div[style*="grid-template-columns:2fr"] {
    gap: 1.5rem !important;
  }
  /* The "|" between Copyright and "Designed by" looks orphaned when
     the two lines wrap on a narrow screen — hide it. */
  .footer-divider { display: none !important; }
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

.reveal-delay-5 {
  transition-delay: 0.5s;
}

.reveal-delay-6 {
  transition-delay: 0.6s;
}

/* =============================================
   GLASS CARD
   ============================================= */
.glass-dark {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* =============================================
   SECTION TITLE
   ============================================= */
.section-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--blue-600);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-badge.red {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.15);
  color: var(--red-700);
}

.gradient-text-blue {
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-red {
  background: linear-gradient(90deg, var(--red-600), var(--red-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   PRODUCT LISTING PAGE — FILTER TABS
   ============================================= */
.tab-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid rgba(12, 31, 63, 0.12);
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: white;
}

/* =============================================
   CTA STRIP
   ============================================= */
.cta-strip {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-strip::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
}

.cta-strip::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
}

/* =============================================
   RESPONSIVE — Comprehensive
   ============================================= */

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile & Tablet (≤768px) */
@media (max-width: 768px) {

  /* Navbar — inline padding on the <nav> needs !important to override */
  .desktop-nav {
    display: none !important;
  }

  #menu-btn,
  .nav-mobile-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white;
    z-index: 1001;
  }

  #navbar {
    padding: 0.85rem 1.25rem !important;
  }

  .nav-logo {
    width: 130px;
    min-width: unset;
    max-width: unset;
  }

  /* Hero — slide & arrow sizing handled in the HERO SLIDESHOW block's own media queries */
  .hero-slider {
    min-height: 100svh;
  }

  /* Page hero */
  .page-hero {
    padding: 6rem 1rem 3rem !important;
  }

  .page-hero-title {
    font-size: 2rem;
  }

  /* Feature & product grids */
  .feature-grid {
    grid-template-columns: 1fr;
  }

  /* 2-col grids → 1 col */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Products grid */
  [style*="grid-template-columns:repeat(auto-fill,minmax(260px"],
  [style*="grid-template-columns:repeat(auto-fit"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Sections padding */
  section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* CTA strip */
  .cta-strip {
    padding: 3rem 1rem;
  }

  .cta-strip h2 {
    font-size: 1.5rem;
  }

  /* Stats */
  .stat-number {
    font-size: 2.25rem;
  }

  /* Why section grid */
  .why-feature-grid {
    grid-template-columns: 1fr !important;
  }

  /* Breadcrumb */
  .breadcrumb {
    flex-wrap: wrap;
  }

  /* Form */
  [style*="grid-template-columns:1fr 1fr"] input {
    grid-column: unset;
  }

  /* Footer */
  footer [style*="gap:2rem"] {
    gap: 1rem !important;
  }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
  .page-hero-title {
    font-size: 1.6rem;
  }

  [style*="grid-template-columns:repeat(auto-fill,minmax(260px"],
  [style*="grid-template-columns:repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }

  .section-badge {
    font-size: 0.7rem;
  }

  /* Roofing hero CTA buttons */
  .page-hero [style*="display:flex;gap:1rem"] {
    flex-direction: column;
    align-items: center;
  }
}

/* =============================================
   RESPONSIVE UTILITIES
   ============================================= */
@media (max-width: 768px) {
  .stack-mobile {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  .hide-mobile {
    display: none !important;
  }
  .text-center-mobile {
    text-align: center !important;
  }
  .p-0-mobile {
    padding: 0 !important;
  }
  .m-0-mobile {
    margin: 0 !important;
  }
  .full-width-mobile {
      width: 100% !important;
      max-width: 100% !important;
  }
}

@media (max-width: 1024px) {
    .container-fluid {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* =============================================
   TYPOGRAPHIC SCALE
   Use semantic classes (.t-display, .t-h1, .t-h2…) when adding new
   content — gives consistent rhythm without inline font-size.
   Existing inline font-size declarations override these by specificity,
   so this is non-breaking.
   ============================================= */
:root {
  --font-display: clamp(2.5rem, 5.5vw, 3.75rem);
  --font-h1:      clamp(2rem,   4vw,   3rem);
  --font-h2:      clamp(1.5rem, 2.6vw, 2.1rem);
  --font-h3:      clamp(1.15rem, 1.8vw, 1.35rem);
  --font-h4:      1.05rem;
  --font-body:    1rem;
  --font-small:   0.875rem;
  --font-eyebrow: 0.75rem;

  --leading-display: 1.05;
  --leading-h:       1.2;
  --leading-body:    1.7;

  --weight-display: 800;
  --weight-h:       700;
  --weight-body:    400;

  --color-ink:     #0c1f3f;
  --color-body:    #4b5563;
  --color-muted:   #6b7280;
  --color-accent:  #2563eb;
}

.t-eyebrow {
  display: inline-block;
  font-size: var(--font-eyebrow);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.t-display {
  font-size: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: -0.02em;
  color: var(--color-ink);
}
.t-h1 {
  font-size: var(--font-h1);
  font-weight: var(--weight-display);
  line-height: var(--leading-h);
  color: var(--color-ink);
}
.t-h2 {
  font-size: var(--font-h2);
  font-weight: var(--weight-h);
  line-height: var(--leading-h);
  color: var(--color-ink);
}
.t-h3 {
  font-size: var(--font-h3);
  font-weight: var(--weight-h);
  line-height: 1.3;
  color: var(--color-ink);
}
.t-h4 {
  font-size: var(--font-h4);
  font-weight: var(--weight-h);
  line-height: 1.35;
  color: var(--color-ink);
}
.t-lead {
  font-size: 1.05rem;
  line-height: var(--leading-body);
  color: var(--color-body);
}
.t-body {
  font-size: var(--font-body);
  line-height: var(--leading-body);
  color: var(--color-body);
}
.t-small {
  font-size: var(--font-small);
  line-height: 1.5;
  color: var(--color-muted);
}

/* Default headings only get this scale when no inline style is set —
   `:not([style*="font-size"])` keeps existing pages intact. */
h1:not([style*="font-size"]):not(.slide-title):not(.page-hero-title) {
  font-size: var(--font-h1);
  font-weight: var(--weight-display);
  line-height: var(--leading-h);
  color: var(--color-ink);
}
h2:not([style*="font-size"]) {
  font-size: var(--font-h2);
  font-weight: var(--weight-h);
  line-height: var(--leading-h);
  color: var(--color-ink);
}
h3:not([style*="font-size"]):not(.product-card-title) {
  font-size: var(--font-h3);
  font-weight: var(--weight-h);
  line-height: 1.3;
  color: var(--color-ink);
}

/* =============================================
   FOOTER (shared 4-col layout)
   ============================================= */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }
}
@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* =============================================
   RESPONSIVE FIXES (audit pass)
   ============================================= */

/* Catch grids the earlier rules missed */
@media (max-width: 768px) {
  /* repeat(N, 1fr) and 1fr 1.2fr layouts collapse to 1-col on tablet/mobile */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:1fr 1.2fr"],
  [style*="grid-template-columns:1.2fr 1fr"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Tables — shrink cell padding so 2-col layouts don't overflow */
  section table td,
  section table th {
    padding: 0.85rem 0.85rem !important;
    font-size: 0.9rem !important;
  }

  /* Contact map shouldn't dominate the viewport */
  .map-container {
    height: 380px !important;
  }
}

@media (max-width: 480px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:1fr 1.2fr"],
  [style*="grid-template-columns:1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Roofing advantage rows: stack circle + text */
  .roofing-advantage,
  [data-stack-mobile] {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 1rem !important;
  }

  /* About-page timeline: collapse year column under card */
  .timeline-row,
  [data-timeline-row] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  .timeline-row > *:first-child,
  [data-timeline-row] > *:first-child {
    width: auto !important;
    padding-right: 0 !important;
  }
}

/* =============================================
   MOBILE TIGHTENING — sitewide & roofing-page
   Targets inline styles via attribute selectors so the existing
   inline-style markup stays untouched.
   ============================================= */

@media (max-width: 600px) {
  /* Sections: shrink vertical padding everywhere (was 6rem on most
     roofing.html sections, never overridden) */
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  /* Inline heading sizes — clamp common fixed-rem inline values down */
  [style*="font-size:2.5rem"]   { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  [style*="font-size:2.25rem"]  { font-size: clamp(1.4rem, 5.5vw, 1.85rem) !important; }
  [style*="font-size:2rem"]     { font-size: clamp(1.3rem, 5vw, 1.7rem) !important; }
  [style*="font-size:1.75rem"]  { font-size: clamp(1.2rem, 4.5vw, 1.55rem) !important; }
  [style*="font-size:1.5rem"]   { font-size: clamp(1.1rem, 4vw, 1.4rem) !important; }
  [style*="font-size:1.35rem"]  { font-size: 1.15rem !important; }
  [style*="font-size:1.25rem"]  { font-size: 1.1rem !important; }
  [style*="font-size:1.1rem"]   { font-size: 1rem !important; }
  [style*="font-size:1.05rem"]  { font-size: 0.95rem !important; }

  /* Inline padding shrinks — uniform pads on inline divs */
  [style*="padding:6rem 2rem"]  { padding: 3rem 1.25rem !important; }
  [style*="padding:6rem 1.5rem"]{ padding: 3rem 1.25rem !important; }
  [style*="padding:5rem 2rem"]  { padding: 2.5rem 1.25rem !important; }
  [style*="padding:5rem 1.5rem"]{ padding: 2.5rem 1.25rem !important; }
  [style*="padding:4rem 2rem 2rem"] { padding: 2.5rem 1.25rem 1.5rem !important; }
  [style*="padding:4rem 1.5rem"]{ padding: 2rem 1rem !important; }
  [style*="padding:4rem 1.25rem"]{ padding: 2rem 1rem !important; }
  [style*="padding:4rem;"]      { padding: 1.75rem !important; }
  [style*="padding:3rem 2rem"]  { padding: 1.75rem 1.25rem !important; }
  [style*="padding:3rem;"]      { padding: 1.5rem !important; }
  [style*="padding:2.5rem 2rem"]{ padding: 1.5rem 1.25rem !important; }
  [style*="padding:2.5rem;"]    { padding: 1.5rem !important; }
  [style*="padding:2rem 2.5rem"]{ padding: 1.25rem 1.25rem !important; }

  /* Generous gaps -> compact on phones */
  [style*="gap:4rem"]    { gap: 1.5rem !important; }
  [style*="gap:3rem"]    { gap: 1.5rem !important; }
  [style*="gap:2.5rem"]  { gap: 1.25rem !important; }
  [style*="gap:2rem"]    { gap: 1rem !important; }

  /* Margin-top:6rem (CTA strips) -> 2.5rem */
  [style*="margin-top:6rem"] { margin-top: 2.5rem !important; }
  [style*="margin-top:5rem"] { margin-top: 2.5rem !important; }
  [style*="margin-top:4rem"] { margin-top: 2rem !important; }
  [style*="margin-top:3rem"] { margin-top: 1.5rem !important; }

  /* Roofing tables — give each cell more breathing room when stacked */
  section table td,
  section table th {
    padding: 0.6rem 0.55rem !important;
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 480px) {
  /* Even tighter on the smallest phones */
  [style*="font-size:2.5rem"]   { font-size: 1.4rem !important; }
  [style*="font-size:2.25rem"]  { font-size: 1.3rem !important; }
  [style*="font-size:2rem"]     { font-size: 1.25rem !important; }
  [style*="font-size:1.75rem"]  { font-size: 1.15rem !important; }

  [style*="padding:6rem 2rem"]  { padding: 2.5rem 1rem !important; }
  [style*="padding:5rem 2rem"]  { padding: 2.25rem 1rem !important; }

  /* Roofing advantage circles — shrink so the stacked card doesn't tower */
  .roofing-advantage > div:first-child {
    width: 72px !important;
    height: 72px !important;
    font-size: 0.7rem !important;
    border-width: 3px !important;
    box-shadow: 0 6px 12px rgba(153, 27, 27, 0.25) !important;
  }
  .roofing-advantage > div:nth-child(2) {
    padding: 1rem 1.1rem !important;
  }

  /* Hero feature pills around the arch — make labels readable not 7px */
  .hero-feat span {
    font-size: 0.55rem !important;
    letter-spacing: 0 !important;
  }
  .hero-feat i,
  .hero-feat svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* Push the arch title up a touch so it doesn't overlap the bottom feat-pills */
  .arch-container h1 {
    bottom: 4% !important;
  }

  /* Roofing intro image — drop the overflow transform so it fits the card */
  #intro img[src*="hero_stack_premium"] {
    transform: none !important;
    width: 100% !important;
  }

  /* Tables — scale down further */
  section table td,
  section table th {
    padding: 0.5rem 0.4rem !important;
    font-size: 0.72rem !important;
  }

  /* Application icon tiles on roofing page — let them flex naturally
     (scoped to <div> so the footer logo's <img style="width:140px"> is
     not affected) */
  div[style*="width:140px"] {
    width: auto !important;
    min-width: 100px !important;
  }

  /* Footer logo — keep it sensibly small on phones */
  footer img[style*="width:140px"] {
    width: 110px !important;
    margin-bottom: 0.75rem !important;
  }

  /* Disable justified text on narrow viewports — justify creates ugly
     word-spacing rivers when each line only fits 4-6 words. Fall back
     to left-align for body paragraphs on phones. */
  p[style*="text-align:justify"] {
    text-align: left !important;
  }
}

/* =============================================
   MASCOT — sitewide floating brand character
   "Leo" the tank superhero peeks in from the bottom-right after the
   page settles, gives a friendly wave, and offers a quick CTA.
   ============================================= */

.mascot-widget {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 998;       /* below the move-to-top button (z-1000) */
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none; /* children re-enable */
  transform: translate(-120%, 20%);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              opacity 0.4s ease;
}
.mascot-widget.is-shown {
  transform: translate(0, 0);
  opacity: 1;
}

.mascot-bubble {
  pointer-events: auto;
  background: white;
  color: #0c1f3f;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.7rem 1.05rem;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 12px 28px rgba(12, 31, 63, 0.18),
              0 0 0 1px rgba(12, 31, 63, 0.05);
  max-width: 220px;
  margin-bottom: 1.25rem;
  position: relative;
  white-space: normal;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.35s ease 0.7s, transform 0.35s ease 0.7s;
}
.mascot-widget.is-shown .mascot-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mascot-bubble a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 800;
}
.mascot-bubble a:hover { text-decoration: underline; }

.mascot-bubble-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0c1f3f;
  color: white;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.mascot-bubble-close:hover { background: #1e3a8a; }

.mascot-button {
  pointer-events: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 110px;
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(12, 31, 63, 0.30));
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.mascot-button:hover {
  transform: translateY(-6px) rotate(-3deg);
}
.mascot-button img {
  display: block;
  width: 100%;
  height: auto;
  animation: mascot-idle 4.5s ease-in-out infinite;
  transform-origin: 60% 90%;
}

@keyframes mascot-idle {
  0%, 100% { transform: rotate(-1deg) translateY(0); }
  50%      { transform: rotate(2deg) translateY(-4px); }
}

@keyframes mascot-wave {
  0%   { transform: rotate(-1deg) translateY(0); }
  20%  { transform: rotate(-6deg) translateY(-6px); }
  40%  { transform: rotate( 4deg) translateY(-3px); }
  60%  { transform: rotate(-3deg) translateY(-5px); }
  80%  { transform: rotate( 2deg) translateY(-2px); }
}
.mascot-button.is-waving img {
  animation: mascot-wave 1s ease-out 1, mascot-idle 4.5s ease-in-out infinite 1s;
}

@media (max-width: 600px) {
  .mascot-widget {
    left: 0.6rem;
    bottom: 0.6rem;
    gap: 0.3rem;
  }
  .mascot-bubble {
    font-size: 0.68rem;
    max-width: none;
    width: max-content;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
    white-space: nowrap;
  }
  .mascot-button { width: 60px; }
}

@media (max-width: 380px) {
  .mascot-bubble {
    font-size: 0.62rem;
    padding: 0.3rem 0.55rem;
  }
  .mascot-button { width: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-widget,
  .mascot-button img {
    animation: none !important;
    transition: opacity 0.2s !important;
    transform: none !important;
  }
  .mascot-widget.is-shown { opacity: 1; transform: none; }
}

/* =============================================
   MASCOT — inline (decorative use inside sections)
   ============================================= */
.mascot-inline {
  display: block;
  width: 100%;
  height: auto;
  max-width: 280px;
  filter: drop-shadow(0 18px 30px rgba(12, 31, 63, 0.18));
  animation: mascot-idle 5s ease-in-out infinite;
  transform-origin: 60% 90%;
}

/* =============================================================
   RESPONSIVE HARDENING  (site-wide audit, 2026-06)
   Appended last so these win on ties. Targets phones/tablets/
   small laptops without regressing desktop.
   ============================================================= */

/* ---- Tablets / small laptops (<= 980px) ---- */
@media (max-width: 980px) {
  .product-card-img { height: 280px; }
}

/* Keep the 4-up product grids at 3 columns on small laptops (769–980px) */
@media (min-width: 769px) and (max-width: 980px) {
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ---- Collapsed 2-col hero / split layouts (<= 900px) ---- */
@media (max-width: 900px) {
  .reveal[style*="justify-self:end"] { justify-self: center !important; }
}

/* ---- Tablets & large phones (<= 768px) ---- */
@media (max-width: 768px) {
  /* *** HERO OVERFLOW FIX *** the accent phrase must wrap on tablets & phones
     (the base rule sets white-space:nowrap for the desktop look) */
  .slide-title span { white-space: normal; }
  .slide-title { overflow-wrap: anywhere; word-break: break-word; }
  /* Drop the decorative accent underline on small screens (it wraps awkwardly) */
  .slide-title span::after { display: none; }

  /* Media never wider than its column */
  img, svg, video, canvas { max-width: 100%; height: auto; }
  img[width] { height: auto; }

  /* Tame oversized mobile section padding (inline 5rem/6rem etc.) */
  section { padding-top: 3rem !important; padding-bottom: 3rem !important; }

  /* Collapse 3- and 4-column inline grids (spaced + non-spaced forms) to 2 */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* auto-fill product grids the existing rules missed */
  [style*="grid-template-columns:repeat(auto-fill,minmax(250px"],
  [style*="grid-template-columns:repeat(auto-fill,minmax(240px"],
  [style*="grid-template-columns:repeat(auto-fill,minmax(220px"],
  [style*="grid-template-columns:repeat(auto-fill,minmax(200px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Product image boxes scale with the narrower cards */
  .product-card-img { height: 240px; }
  .product-card-img[style*="height:190px"] { height: 150px !important; }
  .product-card-img[style*="height:240px"] { height: 170px !important; }

  /* Touch targets: hero CTAs and slider dots */
  .slide-actions .btn-primary,
  .slide-actions .btn-ghost { min-height: 44px; }
  /* keep the dots small (base 8px); expand only the invisible tap area */
  .slider-dot { min-width: 0; min-height: 0; position: relative; }
  .slider-dot.active { min-width: 0; }
  .slider-dot::before { content: ""; position: absolute; inset: -12px; }

  /* Don't leave a hover-lifted feature card stuck after a tap */
  .feature-grid > .feature-card:hover { transform: none; }

  /* Product-style hero with image: stack and centre the image */
  .page-hero-inner { flex-direction: column; }
  .page-hero--with-image .page-hero-product-image { width: 100%; max-width: 320px; margin: 0 auto; }

  /* roofing.html intro logo not oversized when stacked */
  .intro-card-text .roofing-intro-logo { width: 40% !important; max-width: 130px !important; }

  /* roofing.html infrastructure carousel arrows inside the viewport */
  .infra-carousel { overflow: hidden; }
  .infra-prev { left: 6px; }
  .infra-next { right: 6px; }
}

/* ---- Phones (<= 600px) ---- */
@media (max-width: 600px) {
  .product-card-img { height: 200px; font-size: 2.25rem; }

  #stats-section { padding-left: 1rem !important; padding-right: 1rem !important; }

  /* Keep the 4 "Why Leoplast" cards 2-up rather than a long 1-col stack */
  .why-section > div > div[style*="grid-template-columns:1fr 1fr"][style*="gap:1rem"] {
    grid-template-columns: 1fr 1fr !important; gap: 0.75rem !important;
  }

  /* auto-fit minmax(300px) product grids -> single column */
  section [style*="grid-template-columns:repeat(auto-fit,minmax(300px,1fr))"] {
    grid-template-columns: 1fr !important; gap: 1.5rem !important;
  }

  /* Hero subtitle paragraphs never exceed the viewport */
  .page-hero p { font-size: 0.95rem !important; max-width: 100% !important; padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* ---- Small phones (<= 480px) ---- */
@media (max-width: 480px) {
  /* *** THE HERO OVERFLOW FIX *** allow the accent phrase to wrap */
  .slide-title span { white-space: normal; }
  .slide-title { overflow-wrap: anywhere; word-break: break-word; }
  .slide-title span::after { width: min(2.4em, 60%); }

  /* keep the 4-col gallery a tidy 2-up (not a tall 1-col stack) */
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Smaller corner FAB so it doesn't crowd CTAs */
  .move-to-top-btn { bottom: 1rem; right: 1rem; width: 44px; height: 44px; }

  /* Breadcrumbs wrap instead of overflowing */
  .breadcrumb { flex-wrap: wrap; row-gap: 0.25rem; font-size: 0.8rem; }

  /* roofing 3-layer step circles a touch smaller */
  #layer-container [style*="width:40px"][style*="height:40px"] { width: 34px !important; height: 34px !important; }

  /* Partner CTA heading scales down */
  .cta-strip h3 { font-size: 1.4rem !important; line-height: 1.25; }

  /* contact map header lighter padding */
  .contact-map-header { padding: 1rem 1.25rem !important; gap: 1rem !important; }

  /* product-title parenthetical sub-labels smaller */
  .product-card-title[style*="font-size:0.95rem"] span,
  .product-card-title[style*="font-size:1.02rem"] span { font-size: 0.75rem !important; }
}

/* ---- Narrow phones (<= 420px): single-column the remaining minmax grids ---- */
@media (max-width: 420px) {
  [style*="minmax(300px"],
  [style*="minmax(280px"],
  [style*="minmax(250px"],
  [style*="minmax(220px"],
  [style*="minmax(200px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Very small phones (<= 400px) ---- */
@media (max-width: 400px) {
  .stat-card p { white-space: normal !important; font-size: 0.72rem !important; }
}

/* ---- Smallest phones (<= 360px, e.g. 320px Fold / SE) ---- */
@media (max-width: 360px) {
  .slide-title { font-size: clamp(1.5rem, 8.5vw, 1.9rem); }
  .rh-donut { width: 99% !important; }
  .rh-feat-1 { left: 14% !important; }
  .rh-feat-5 { left: 87% !important; }
  .contact-phone-cc { width: 96px !important; min-width: 96px; }
  .water-404 { width: clamp(240px, 78vw, 300px) !important; }
}

/* Core Products carousel: square image box so 1:1 product images fit at every width (no crop) */
.carousel-track .product-card-img { aspect-ratio: 1 / 1; height: auto; }

/* "Why Leoplast" 2-col (text+cards | video) stays 2-up until 768px, which
   crams the feature cards into the left half on tablets/small laptops.
   Collapse it earlier so the cards get full width. */
@media (max-width: 1100px) {
  .why-section > div > div[style*="grid-template-columns:1fr 1fr"][style*="gap:4rem"] {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

/* ---- mobile menu: active accent bar + bottom action strip ---- */
.mobile-menu .nav-link.active-page {
  background: linear-gradient(90deg, rgba(126, 179, 245, 0.12), transparent 55%);
  box-shadow: inset 3px 0 0 #7eb3f5;
}
.mobile-menu .nav-link.active-page.roofing-active {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.12), transparent 55%);
  box-shadow: inset 3px 0 0 #f87171;
}
.mobile-menu-foot {
  position: absolute;
  left: 1.85rem;
  right: 1.85rem;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  opacity: 0;
}
.mobile-menu.active .mobile-menu-foot { animation: mnavItemIn 0.6s 0.5s both; }
.mobile-menu .get-quote-mobile {
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.mobile-menu-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: rgba(219, 234, 254, 0.82);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

/* mobile menu: no index numbers / no trailing arrow (keep the active bar) */
.mobile-menu .nav-link::before,
.mobile-menu .nav-link::after { display: none; }

/* rotating pipes CTA label */
.cta-rot { display: inline-block; transition: opacity 0.3s ease; }
