/* =========================================================
   Components — nav, buttons, tiles, badges, footer
   ========================================================= */

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-height);
  display: flex; align-items: center;
  background: var(--bg-nav);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--bg-nav-border);
  transition: background-color var(--dur-normal) var(--ease-standard),
              border-color var(--dur-normal) var(--ease-standard);
}
.nav__inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: var(--space-6);
  position: relative; /* anchor for the absolutely-centred nav title */
}

/* ---------- Nav centre title (mobile only) ----------
   Absolutely centred so it never pushes the brand or action buttons.
   Fades in via JS once the page heading scrolls behind the sticky bar. */
.nav__title {
  display: none; /* desktop: nav links already provide context */
}
@media (max-width: 820px) {
  .nav__title {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--type-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 44vw;           /* won't overlap logo or action buttons */
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-normal) var(--ease-standard);
  }
  .nav.title-visible .nav__title {
    opacity: 1;
  }
}
.nav__brand {
  display: inline-flex; align-items: center;
  color: var(--text-primary);
  /* Explicit height + overflow:hidden is required — the PNG has its own navy
     background and must be clipped to the border-radius cleanly. Without a
     definite height on the container the logo overflows to its natural size. */
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform var(--dur-fast) var(--ease-spring);
  flex-shrink: 0;
}
.nav__brand:hover { transform: translateY(-1px); }
.nav__brand-logo {
  display: block;
  height: 100%; /* fills the brand container — container height is the single source of truth */
  width: auto;
}

.nav__links {
  display: flex; align-items: center; gap: var(--space-1);
  margin-left: var(--space-6);
}
.nav__link {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--type-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.nav__link:hover {
  background: var(--bg-tinted);
  color: var(--text-primary);
}
.nav__link--active { color: var(--text-primary); background: var(--bg-tinted); }

.nav__spacer { flex: 1; }

.nav__actions { display: flex; align-items: center; gap: var(--space-2); }

/* ---------- Mobile menu toggle (hamburger) ---------- */
.nav__menu-toggle {
  display: none; /* shown via media query below */
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--bg-tinted);
  color: var(--text-primary);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.nav__menu-toggle:hover { background: var(--bg-tinted-strong); }
.nav__menu-toggle svg { width: 20px; height: 20px; }
.nav__menu-toggle .icon-close { display: none; }
.nav.is-open .nav__menu-toggle .icon-open { display: none; }
.nav.is-open .nav__menu-toggle .icon-close { display: block; }

/* ---------- Mobile nav panel ---------- */
@media (max-width: 820px) {
  .nav__inner { gap: var(--space-3); }

  /* Compact the logo a touch on mobile */
  .nav__brand { height: 32px; border-radius: 8px; }
  .nav__brand-logo { height: 100%; }

  /* Move primary links into a slide-down panel */
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: var(--space-4) var(--gutter) var(--space-6);
    margin: 0;
    /* Solid surface so the hero behind doesn't bleed through */
    background: var(--bg-canvas);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    border-bottom: 1px solid var(--stroke-subtle);
    box-shadow: 0 16px 40px rgba(0,0,0,0.30);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: var(--type-base);
    text-align: left;
  }

  /* Show hamburger, hide "Shop the gear" CTA text on tight viewports */
  .nav__menu-toggle { display: inline-flex; }
  .nav__actions .btn--primary { display: none; }
}

@media (max-width: 380px) {
  .nav__inner { padding-inline: 16px; }
  .nav__brand { height: 26px; }
  .nav__brand-logo { height: 100%; }
}

.theme-toggle {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--bg-tinted);
  color: var(--text-primary);
  transition: background-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-spring);
}
.theme-toggle:hover { background: var(--bg-tinted-strong); transform: scale(1.05); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Cart icon ---------- */
.nav__cart {
  position: relative;
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--bg-tinted);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-spring);
}
.nav__cart:hover { background: var(--bg-tinted-strong); transform: scale(1.05); }
.nav__cart svg { width: 18px; height: 18px; }
.nav__cart-badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  display: none;
  align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
  border: 2px solid var(--bg-canvas);
}
.nav__cart-badge--visible { display: flex; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--type-base);
  letter-spacing: var(--tracking-tight);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring),
              background-color var(--dur-normal) var(--ease-standard),
              color var(--dur-normal) var(--ease-standard),
              box-shadow var(--dur-normal) var(--ease-standard);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 6px 24px -6px rgba(245, 81, 57, 0.55);
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 32px -6px rgba(245, 81, 57, 0.7); color: var(--text-on-accent); }

.btn--ghost {
  background: var(--bg-tinted);
  color: var(--text-primary);
}
.btn--ghost:hover { background: var(--bg-tinted-strong); color: var(--text-primary); }

.btn--text {
  padding: 8px 0;
  color: var(--text-primary);
  font-weight: 600;
}
.btn--text::after {
  content: "→";
  margin-left: 4px;
  transition: transform var(--dur-normal) var(--ease-spring);
}
.btn--text:hover { color: var(--accent); }
.btn--text:hover::after { transform: translateX(4px); }

.btn--sm { padding: 10px 18px; font-size: var(--type-sm); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(60px, 9vw, 120px);
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--hero-glow);
  z-index: -1;
  pointer-events: none;
}
.hero__eyebrow { margin-bottom: var(--space-5); }
.hero__title {
  max-width: 18ch;
  margin: 0 auto var(--space-6);
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  max-width: 36ch;
  margin: 0 auto var(--space-10);
}
.hero__actions {
  display: inline-flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center;
}

/* ---------- Ecosystem badges (Apple Home / Matter / etc.) ---------- */
.ecosystem-strip {
  padding-block: var(--space-12);
  border-top: 1px solid var(--stroke-subtle);
  border-bottom: 1px solid var(--stroke-subtle);
}
.ecosystem-strip__label {
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--type-sm);
  font-weight: 500;
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
/* Marquee wrapper — clips the scrolling track and fades the edges */
.ecosystem-strip__row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}
/* Scrolling track — 5 original items + 5 duplicates for a seamless loop */
.ecosystem-strip__track {
  display: flex;
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
  width: max-content;
  animation: eco-marquee 30s linear infinite;
}
.ecosystem-strip__track:hover { animation-play-state: paused; }
@keyframes eco-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ecosystem-strip__item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--type-sm);
  opacity: 0.75;
  transition: opacity var(--dur-normal) var(--ease-standard);
}
.ecosystem-strip__item:hover { opacity: 1; }
/* Light mode: darker logos need higher opacity to stay readable */
:root[data-theme="light"] .ecosystem-strip__item,
:root:not([data-theme]) .ecosystem-strip__item {
  opacity: 0.95;
}
:root[data-theme="light"] .ecosystem-strip__item:hover,
:root:not([data-theme]) .ecosystem-strip__item:hover {
  opacity: 1;
}
.ecosystem-strip__item img {
  display: block;
  height: 30px;   /* Matter, Thread — bold heavy wordmarks */
  width: auto;
  max-width: 150px;
  object-fit: contain;
}
/* Alexa wordmark — match the house icon height so all three feel equally weighted.
   Selector includes parent to beat the specificity of .ecosystem-strip__item img (0,1,1). */
.ecosystem-strip__item .eco-logo--alexa {
  height: 72px;
  width: auto;
  max-width: none;
}
/* Square icon-only logos (Apple Home, Google Home).
   Using parent selector (0,2,0) beats (0,1,1). */
.ecosystem-strip__item .eco-logo--icon {
  height: 72px;
  width: auto;
  max-width: none;
}
/* Dark-fill SVGs (Thread, Matter): invert to white ONLY in dark mode.
   In light mode their dark fills are already readable on the light canvas. */
.eco-logo--light { filter: none; }
:root[data-theme="dark"] .eco-logo--light { filter: brightness(0) invert(1); }
/* Also handle OS-level dark preference when no explicit theme is stored yet */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eco-logo--light { filter: brightness(0) invert(1); }
}
/* SmartThings PNG: JS swaps src to white-text version in dark mode (no filter needed) */
.ecosystem-strip__item .eco-logo--smartthings {
  height: 72px;
  width: auto;
  max-width: none;
}
/* Mobile: smaller logos, marquee keeps running */
@media (max-width: 680px) {
  .ecosystem-strip__item img {
    height: 20px;
    max-width: 90px;
  }
  .ecosystem-strip__item .eco-logo--alexa {
    height: 44px;
    width: auto;
    max-width: none;
  }
  .ecosystem-strip__item .eco-logo--icon {
    height: 44px;
    width: auto;
    max-width: none;
  }
  .ecosystem-strip__item .eco-logo--smartthings {
    height: 44px;
    width: auto;
    max-width: none;
  }
}

/* ---------- Section headings ---------- */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: var(--space-6); flex-wrap: wrap;
  margin-bottom: var(--space-12);
}
.section-head__title { letter-spacing: var(--tracking-display); max-width: 22ch; }
.section-head__sub { color: var(--text-secondary); max-width: 44ch; margin-top: var(--space-3); }

/* ---------- Tile (Apple-Home style) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}
.tile-grid--featured {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}
/* Mobile: horizontal scroll shelf with snap */
@media (max-width: 680px) {
  .tile-grid--featured {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    padding-bottom: var(--space-3);
    scrollbar-width: none;
    gap: var(--space-4);
    overflow-y: hidden;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }
  .tile-grid--featured::-webkit-scrollbar { display: none; }
  .tile-grid--featured .tile {
    flex: 0 0 78vw;
    max-width: 320px;
    scroll-snap-align: start;
  }
}

.tile {
  position: relative;
  display: flex; flex-direction: column;
  padding: var(--space-6);
  min-height: 280px;
  background: var(--tile-bg);
  border: 1px solid var(--stroke-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--tile-shadow);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-normal) var(--ease-out-soft),
              box-shadow var(--dur-normal) var(--ease-out-soft),
              border-color var(--dur-normal) var(--ease-standard);
}
.tile::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--tile-glow);
  pointer-events: none;
  z-index: -1;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--tile-shadow-hover);
  border-color: var(--stroke-strong);
}

.tile__media {
  /* position: relative so the absolutely-positioned img has a real
     containing block with a definite pixel height — avoids the Safari mobile
     bug where max-height:100% fails inside an implicit grid track. */
  position: relative;
  height: 200px;
  margin: -8px -8px var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--media-bg);
  border: 1px solid var(--media-stroke);
  overflow: hidden;
}
.tile__media img {
  position: absolute;
  top: 20px; right: 20px; bottom: 20px; left: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform var(--dur-slow) var(--ease-out-soft);
}
.tile:hover .tile__media img { transform: scale(1.06); }

.tile__cat {
  font-size: var(--type-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.tile__title {
  font-size: var(--type-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}
.tile__brand { color: var(--text-secondary); font-size: var(--type-sm); }
.tile__row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--space-4); }
.tile__price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--type-lg);
  letter-spacing: var(--tracking-tight);
  font-feature-settings: "tnum";
}
.tile__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.tile__cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--type-sm); font-weight: 600;
  color: var(--accent);
  position: relative;
  z-index: 2;
}
.tile__cta::after { content: "→"; transition: transform var(--dur-normal) var(--ease-spring); }
.tile:hover .tile__cta::after { transform: translateX(3px); }

/* ---------- Category chip-tiles ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-5);
  min-height: 160px;
  border-radius: var(--radius-xl);
  background: var(--tile-bg);
  border: 1px solid var(--stroke-subtle);
  box-shadow: var(--tile-shadow);
  transition: transform var(--dur-normal) var(--ease-out-soft),
              box-shadow var(--dur-normal) var(--ease-out-soft),
              border-color var(--dur-normal) var(--ease-standard);
}
.cat-tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--tile-shadow-hover), 0 8px 32px -8px rgba(245,81,57,0.22);
  color: var(--text-primary);
}
.cat-tile__icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-soft-bg);
  color: var(--accent);
  transition: transform var(--dur-normal) var(--ease-spring);
}
.cat-tile:hover .cat-tile__icon { transform: scale(1.12); }
.cat-tile__icon svg { width: 24px; height: 24px; }
.cat-tile__name {
  font-size: var(--type-base);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.cat-tile__count { font-size: var(--type-xs); color: var(--text-tertiary); margin-top: auto; }

/* ---------- Story / about block ---------- */
.story {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}
@media (min-width: 880px) {
  .story { grid-template-columns: 1.1fr 0.9fr; gap: var(--space-16); }
}
.story__visual {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-3xl);
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--bg-canvas) 100%);
  border: 1px solid var(--stroke-subtle);
  position: relative;
  overflow: hidden;
}
.story__visual::after {
  content: "";
  position: absolute; inset: -20%;
  background: radial-gradient(40% 40% at 30% 30%, rgba(245,81,57,0.18), transparent 60%),
              radial-gradient(50% 50% at 70% 80%, rgba(81,129,158,0.20), transparent 60%);
  filter: blur(20px);
}

/* ---------- Scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease-out-soft), transform 0.65s var(--ease-out-soft);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.08s; }
.reveal--delay-2 { transition-delay: 0.16s; }
.reveal--delay-3 { transition-delay: 0.24s; }
.reveal--delay-4 { transition-delay: 0.32s; }
.reveal--delay-5 { transition-delay: 0.40s; }
.reveal--delay-6 { transition-delay: 0.48s; }

/* ---------- Statement interstitial ---------- */
.statement {
  padding-block: clamp(80px, 12vw, 140px);
  background: var(--brand-navy);
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.statement::before {
  content: "";
  position: absolute; inset: -50%;
  background:
    radial-gradient(50% 50% at 20% 50%, rgba(245,81,57,0.15), transparent 70%),
    radial-gradient(50% 50% at 80% 50%, rgba(81,129,158,0.12), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}
.statement__inner {
  max-width: 820px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.statement__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-display);
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--space-6);
}
.statement__sub {
  font-size: var(--type-lg);
  color: rgba(255,255,255,0.50);
  max-width: 48ch;
  margin: 0 auto;
  line-height: 1.65;
}
.statement__stats {
  display: flex;
  justify-content: center;
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  flex-wrap: wrap;
  margin-top: var(--space-12);
}
.statement__stat { text-align: center; }
.statement__stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  background: linear-gradient(180deg, #fff 0%, rgba(245,81,57,0.85) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  display: block;
  min-width: 3ch;
}
.statement__stat-label {
  font-size: var(--type-sm);
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-top: var(--space-2);
  display: block;
}

/* ---------- Reading progress bar ---------- */
#shl-progress {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(245,81,57,0.55));
  z-index: 49;
  pointer-events: none;
  transition: width 80ms linear;
}

/* ---------- Skeleton shimmer ---------- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-card {
  height: var(--sk-h, 340px);
  border-radius: var(--radius-2xl);
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0px,
    var(--bg-tinted-strong) 200px,
    var(--bg-elevated) 400px
  );
  background-size: 1200px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.skeleton-card--sm { --sk-h: 160px; border-radius: var(--radius-xl); }

/* ---------- Ecosystem pills on tiles ---------- */
.tile__ecosystems {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-2);
}
.eco-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}
.eco-pill--apple        { background: rgba(81,150,220,0.14);  color: #4a9fd4; }
.eco-pill--google       { background: rgba(66,133,244,0.12);  color: #4285f4; }
.eco-pill--alexa        { background: rgba(0,168,232,0.12);   color: #00a8e8; }
.eco-pill--matter       { background: rgba(245,81,57,0.12);   color: var(--accent); }
.eco-pill--thread       { background: rgba(76,175,80,0.12);   color: #4caf50; }
.eco-pill--smartthings  { background: rgba(20,121,200,0.12);  color: #1479c8; }

/* ---------- Price tier chips ---------- */
.price-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.6;
  margin-top: 4px;
}
.price-tier--budget  { background: rgba(76,175,80,0.12);  color: #4caf50; }
.price-tier--mid     { background: rgba(255,152,0,0.14);  color: #f59700; }
.price-tier--premium { background: rgba(156,39,176,0.12); color: #ab47bc; }

/* ---------- Tile last-updated ---------- */
.tile__updated {
  font-size: var(--type-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

/* ---------- Compare button on tiles — labeled pill ---------- */
.tile__compare-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-strong);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
  transition: opacity var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-spring);
}
.tile__compare-btn svg { width: 11px; height: 11px; flex-shrink: 0; pointer-events: none; }
.tile:hover .tile__compare-btn,
.tile__compare-btn.is-comparing { opacity: 1; }
.tile__compare-btn:hover { background: var(--bg-tinted-strong); color: var(--text-primary); transform: scale(1.04); }
.tile__compare-btn.is-comparing { background: var(--accent); color: #fff; }
/* Always visible on touch devices — they can't hover */
@media (hover: none) {
  .tile__compare-btn { opacity: 0.75; }
}

/* ---------- Sticky filter summary bar ---------- */
.filter-summary {
  position: sticky;
  top: var(--nav-height);
  z-index: 40;
  display: none;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 8px var(--gutter);
  background: var(--bg-canvas);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--stroke-subtle);
  font-size: var(--type-sm);
}
.filter-summary.is-active { display: flex; }
.filter-summary__label {
  color: var(--text-tertiary);
  font-size: var(--type-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  flex-shrink: 0;
}
.filter-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft-bg);
  color: var(--accent);
  font-size: var(--type-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.filter-tag:hover { background: rgba(245,81,57,0.22); }
.filter-tag__x { opacity: 0.65; font-size: 13px; line-height: 1; }
.filter-summary__spacer { flex: 1; min-width: var(--space-4); }
.filter-summary__copy {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-tinted);
  color: var(--text-secondary);
  font-size: var(--type-xs);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}
.filter-summary__copy:hover { background: var(--bg-tinted-strong); color: var(--text-primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--brand-navy);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: var(--type-sm);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.30);
  transition: opacity var(--dur-normal) var(--ease-standard),
              transform var(--dur-normal) var(--ease-spring);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Compare drawer ---------- */
.compare-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-elevated);
  border-top: 1px solid var(--stroke-subtle);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
  transform: translateY(100%);
  transition: transform var(--dur-normal) var(--ease-spring);
  max-height: 80vh;
  overflow-y: auto;
}
.compare-drawer.is-open { transform: translateY(0); }
.compare-drawer__bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: 12px var(--gutter);
  min-height: 64px;
  border-bottom: 1px solid var(--stroke-subtle);
}
.compare-drawer__label {
  font-weight: 600;
  font-size: var(--type-sm);
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-drawer__thumbs {
  display: flex;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.compare-thumb {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 10px;
  background: var(--bg-tinted);
  border-radius: var(--radius-md);
  font-size: var(--type-xs);
  font-weight: 500;
  max-width: 180px;
}
.compare-thumb img { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; flex-shrink: 0; background: var(--media-bg); }
.compare-thumb__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.compare-thumb__x {
  margin-left: var(--space-2);
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-standard);
}
.compare-thumb__x:hover { color: var(--text-primary); }
.compare-drawer__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* Mobile: 2-row layout — thumbs full-width on top, label + actions below */
@media (max-width: 600px) {
  .compare-drawer__bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-2) var(--space-3);
    padding: 10px var(--gutter);
    min-height: auto;
    align-items: center;
  }
  .compare-drawer__thumbs {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .compare-drawer__thumbs::-webkit-scrollbar { display: none; }
  .compare-drawer__label {
    grid-column: 1;
    grid-row: 2;
    font-size: var(--type-xs);
  }
  .compare-drawer__actions {
    grid-column: 2;
    grid-row: 2;
    gap: var(--space-2);
  }
  /* Tighten the action buttons on mobile */
  .compare-drawer__actions .btn--sm {
    padding: 8px 14px;
    font-size: var(--type-xs);
  }
}

/* Compare table panel */
.compare-panel { display: none; padding: var(--space-6) var(--gutter); overflow-x: auto; }
.compare-panel.is-open { display: block; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 420px; }
.compare-table th,
.compare-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--stroke-subtle);
}
.compare-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  white-space: nowrap;
  width: 90px;
  min-width: 90px;
}
.compare-table td { font-size: var(--type-sm); }
.compare-table__img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-md); background: var(--media-bg); display: block; }
.compare-table__name { font-weight: 600; font-size: var(--type-base); line-height: var(--leading-snug); }

/* ---------- Footer ---------- */
.footer {
  padding-block: var(--space-16) var(--space-12);
  border-top: 1px solid var(--stroke-subtle);
  color: var(--text-secondary);
  font-size: var(--type-sm);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}
@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr; }
}
.footer__col h6 {
  font-size: var(--type-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: var(--space-2); }
/* Ecosystem list — consistent gap regardless of icon height */
.footer__eco-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer__eco-list li { margin-bottom: 0; }
/* Ecosystem links with inline icon */
.footer__eco-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer__eco-icon {
  height: 22px;
  width: 34px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}
/* Wide wordmark logos (Alexa) shown smaller so they don't dominate */
.footer__eco-icon--wide {
  height: 13px;
}
/* SmartThings app icon: slightly taller than base to visually match SVG house icons */
.footer__eco-icon--lg {
  height: 28px;
}
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between; align-items: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--stroke-subtle);
  font-size: var(--type-xs);
  color: var(--text-tertiary);
}
.footer__disclosure { max-width: 64ch; }

/* ---------- Affiliate disclosure (product pages) ---------- */
.affiliate-disclosure {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-tinted);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}
.affiliate-disclosure svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-tertiary);
}
.affiliate-disclosure p {
  font-size: var(--type-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}
.affiliate-disclosure strong { color: var(--text-primary); }
.affiliate-disclosure a {
  color: var(--accent);
  text-decoration: none;
}
.affiliate-disclosure a:hover { text-decoration: underline; }
