/* ==========================================================================
   Vivid layer — colour, life and a clear two-model purchase path.
   Loaded after connected.css / inner.css / product.css on every page.
   One restrained accent family per feature meaning (AA on both themes).
   ========================================================================== */

/* ---- Tone palette: one hue per meaning (video / connectivity / location / protection / alerts) ---- */
:root {
  --t-teal: #07737f;  --t-teal-s: #d9f2f0;
  --t-blue: #0369a1;  --t-blue-s: #dcf0fc;
  --t-green: #1d7a46; --t-green-s: #dff4e6;
  --t-amber: #a35a00; --t-amber-s: #fdeed3;
  --t-coral: #b4402a; --t-coral-s: #fde4df;
  --brand-grad: linear-gradient(120deg, #07737f 0%, #0369a1 100%);
}
html[data-theme="dark"] {
  --t-teal: #61d0d3;  --t-teal-s: rgba(97, 208, 211, 0.16);
  --t-blue: #5cc2f5;  --t-blue-s: rgba(92, 194, 245, 0.16);
  --t-green: #6fd39a; --t-green-s: rgba(111, 211, 154, 0.16);
  --t-amber: #f2b14c; --t-amber-s: rgba(242, 177, 76, 0.16);
  --t-coral: #ff9a85; --t-coral-s: rgba(255, 154, 133, 0.16);
  --brand-grad: linear-gradient(120deg, #61d0d3 0%, #5cc2f5 100%);
}

/* ---- Shared "breathing" icon tile (tone chosen by data-tone in the markup) ---- */
[data-tone] { --tone: var(--t-teal); --tone-soft: var(--t-teal-s); }
html[data-theme] body [data-tone="video"][data-tone]   { --tone: var(--t-teal);  --tone-soft: var(--t-teal-s); }
html[data-theme] body [data-tone="connect"][data-tone] { --tone: var(--t-blue);  --tone-soft: var(--t-blue-s); }
html[data-theme] body [data-tone="place"][data-tone]   { --tone: var(--t-green); --tone-soft: var(--t-green-s); }
html[data-theme] body [data-tone="guard"][data-tone]   { --tone: var(--t-amber); --tone-soft: var(--t-amber-s); }
html[data-theme] body [data-tone="alert"][data-tone]   { --tone: var(--t-coral); --tone-soft: var(--t-coral-s); }

@keyframes vv-breathe {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.32); opacity: 0; }
}
@keyframes vv-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Product-page highlight cards */
.pdp-features li {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
}
.pdp-features li::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -30% auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--tone-soft), transparent);
  transition: transform 0.5s;
}
.pdp-features .vv-ico,
.icon-strip .is-ico {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--tone);
  background: linear-gradient(145deg, var(--tone-soft), color-mix(in srgb, var(--tone-soft) 55%, var(--surface)));
  border: 0;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tone) 20%, transparent),
    0 10px 20px -12px var(--tone);
}
.pdp-features .vv-ico {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
}
.pdp-features .vv-ico svg {
  width: 26px;
  height: 26px;
  margin: 0;
  stroke: currentColor;
  stroke-width: 1.8;
}
.pdp-features .vv-ico::after,
.icon-strip .is-ico::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 45%, transparent);
  animation: vv-breathe 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.45s);
  pointer-events: none;
}
.pdp-features .vv-ico svg,
.icon-strip .is-ico svg {
  animation: vv-float 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.45s);
}
@media (hover: hover) {
  .pdp-features li:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--tone) 35%, var(--line));
    box-shadow: 0 22px 40px -24px color-mix(in srgb, var(--tone) 70%, transparent);
  }
  .pdp-features li:hover::before { transform: scale(1.3); }
  .pdp-features li:hover .vv-ico { transform: translateY(-2px); transition: transform 0.4s; }
}
.icon-strip .is-ico svg { color: var(--tone); }

/* Home feature grid: same breathing ring, calmer hover */
@media (hover: hover) {
  html .benefit-grid article:hover .benefit-icon { transform: translateY(-2px); }
}
.benefit-grid .benefit-icon { position: relative; }
.benefit-grid .benefit-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 40%, transparent);
  animation: vv-breathe 4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.5s);
  pointer-events: none;
}

/* ---- Brand gradient accents ---- */
.pdp-4k {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pdp-new,
.model-tag {
  background: var(--brand-grad);
  color: #fff;
}
html[data-theme="dark"] .pdp-new,
html[data-theme="dark"] .model-tag { color: #0b1d22; }

/* Hero: soft colour wash behind the product so pages are not flat grey */
.page-hero.pdp-hero {
  position: relative;
  isolation: isolate;
}
.page-hero.pdp-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(60% 70% at 18% 40%, color-mix(in srgb, var(--t-blue) 14%, transparent), transparent 70%),
    radial-gradient(40% 50% at 8% 85%, color-mix(in srgb, var(--t-teal) 10%, transparent), transparent 70%);
  pointer-events: none;
}

/* ---- Model switcher (top of both product pages) ---- */
.model-switch {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.model-switch a {
  display: grid;
  gap: 1px;
  padding: 9px 18px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  transition: background 0.25s, color 0.25s;
}
.model-switch b {
  font-size: 15px;
  color: var(--ink);
}
.model-switch span { font-size: 12px; }
.model-switch a[aria-current="page"] {
  background: var(--brand-grad);
  color: #ffffffd9;
}
.model-switch a[aria-current="page"] b { color: #fff; }
html[data-theme="dark"] .model-switch a[aria-current="page"],
html[data-theme="dark"] .model-switch a[aria-current="page"] b { color: #0b1d22; }
.model-switch a:not([aria-current]):hover { background: var(--soft); }

/* ---- Home: model chooser ---- */
.model-chooser { scroll-margin-top: 96px; }
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 36px;
}
.model-card {
  --tone: var(--t-teal);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s, border-color 0.4s;
}
.model-card + .model-card { --tone: var(--t-blue); }
.model-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 62%;
  background: radial-gradient(70% 80% at 50% 30%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 75%);
}
.model-card .model-tag {
  position: absolute;
  top: 22px;
  inset-inline-start: 22px;
  padding: 3px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.model-card figure {
  margin: 0;
  display: grid;
  place-items: center;
  height: 230px;
}
.model-card figure img {
  width: 88%;
  height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 26px 30px #0b1a1f38);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.model-card h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.model-card .model-for {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.model-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 15px;
}
.model-points li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.model-points li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 18%, transparent);
  transform: translateY(-1px);
}
.model-price {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.model-price span { color: var(--muted); font-size: 14px; }
.model-price strong { font-size: 34px; letter-spacing: -0.5px; line-height: 1; }
.model-price small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.model-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.model-actions .button { flex: 1 1 auto; justify-content: center; }
.model-actions .text-link { font-weight: 600; color: var(--tone); }
@media (hover: hover) {
  .model-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--tone) 40%, var(--line));
    box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--tone) 70%, transparent);
  }
  .model-card:hover figure img { transform: translateY(-6px) scale(1.03); }
}

/* Comparison table */
.model-compare {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  overflow: hidden;
}
.model-compare summary {
  cursor: pointer;
  padding: 18px 24px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.model-compare summary::-webkit-details-marker { display: none; }
.model-compare summary::after {
  content: "+";
  font-size: 22px;
  color: var(--tech);
  transition: transform 0.3s;
}
.model-compare[open] summary::after { transform: rotate(45deg); }
.model-compare table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.model-compare th,
.model-compare td {
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  text-align: start;
}
.model-compare thead th { font-size: 14px; color: var(--muted); background: var(--soft); }
.model-compare tbody th { font-weight: 500; color: var(--muted); width: 34%; }
.model-compare td { font-weight: 600; }

/* ---- Order configurator: livelier selection ---- */
.pdp-step legend b,
.pdp-next b {
  background: var(--brand-grad);
  color: #fff;
}
html[data-theme="dark"] .pdp-step legend b,
html[data-theme="dark"] .pdp-next b { color: #0b1d22; }
.pdp-option-body {
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, transform 0.25s;
}
.pdp-option input:checked + .pdp-option-body {
  background: color-mix(in srgb, var(--tech) 7%, var(--surface));
}
.pdp-option input:checked + .pdp-option-body::after {
  content: "✓";
  position: absolute;
  top: -10px;
  inset-inline-end: -8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tech);
  color: var(--surface);
  font-size: 14px;
  font-weight: 800;
  animation: vv-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes vv-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (hover: hover) {
  .pdp-option:hover .pdp-option-body { transform: translateY(-2px); }
}
.pdp-seg span { transition: background 0.25s, color 0.25s, box-shadow 0.25s; }
.pdp-summary {
  position: relative;
  overflow: hidden;
}
.pdp-summary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--brand-grad);
}
.pdp-total dd { transition: color 0.3s; }
.pdp-total dd.is-bump { animation: vv-bump 0.45s ease; }
@keyframes vv-bump {
  40% { transform: scale(1.08); color: var(--tech); }
}

/* Primary CTA: subtle sheen on hover */
.button.primary {
  position: relative;
  overflow: hidden;
}
.button.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #ffffff66 50%, transparent 70%);
  transform: translateX(120%);
  pointer-events: none;
}
@media (hover: hover) {
  .button.primary:hover::after {
    transform: translateX(-120%);
    transition: transform 0.8s ease;
  }
}

/* ---- Mobile sticky buy bar with product + price ---- */
.mobile-action .ma-price {
  display: grid;
  line-height: 1.2;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.mobile-action .ma-price b { font-size: 17px; color: var(--ink); }

/* ---- Scroll reveal (class set by connected-ui.js; visible without JS) ---- */
.js-reveal .vv-reveal {
  opacity: 0;
  transform: translateY(14px);
}
.js-reveal .vv-reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.4s ease,
    transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.35s,
    border-color 0.35s;
  transition-delay: calc(var(--i, 0) * 50ms);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .model-grid { gap: 16px; }
  .model-card { padding: 24px; }
  .model-card figure,
  .model-card figure img { height: 190px; }
  .model-card h3 { font-size: 26px; }
}
@media (max-width: 760px) {
  .model-grid { grid-template-columns: 1fr; }
  .model-switch { display: grid; width: 100%; }
  .model-switch a { padding: 8px 12px; }
  .model-compare th,
  .model-compare td { padding: 11px 14px; font-size: 14px; }
  .pdp-features .vv-ico { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 8px; }
  .pdp-features .vv-ico svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-features .vv-ico::after,
  .icon-strip .is-ico::after,
  .benefit-grid .benefit-icon::after,
  .pdp-features .vv-ico svg,
  .icon-strip .is-ico svg { animation: none; }
  .js-reveal .vv-reveal { opacity: 1; transform: none; }
  .button.primary::after { display: none; }
}

/* ---- Home hero: second route to the model chooser ---- */
.hero-models {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 7px 14px 7px 8px;
  border: 1px solid color-mix(in srgb, var(--tech) 30%, var(--line));
  border-radius: 99px;
  background: var(--glass);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, transform 0.25s;
}
.hero-models .pdp-new { margin: 0; }
.hero-models:hover { border-color: var(--tech); transform: translateY(-1px); }

/* ---- Fixes from device QA ---- */
.pdp-seg span {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  padding-block: 6px;
}
.model-switch span { white-space: nowrap; }
@media (max-width: 600px) {
  .pdp-features li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .model-switch b { font-size: 14px; }
  .model-switch span { font-size: 11px; }
}
.hero-models .pdp-new { color: #fff; padding: 1px 9px; }
html[data-theme="dark"] .hero-models .pdp-new { color: #0b1d22; }
@media (max-width: 600px) {
  .hero-models { font-size: 13px; padding: 6px 12px 6px 6px; border-radius: 14px; }
  .hero-models .hm-extra { display: none; }
}

/* ---- Round 2: review fixes ---- */
/* Product hero on phones/tablets: switcher, then the product, then the copy */
@media (max-width: 980px) {
  .pdp-hero .wrap { gap: 0; }
  .pdp-hero .wrap > div:first-child { display: contents; }
  .pdp-hero .model-switch { order: -2; }
  .pdp-hero .pdp-stage { order: -1; margin: 0 0 20px; }
  .pdp-hero .pdp-stage img { width: auto; max-width: 100%; max-height: 220px; margin-inline: auto; }
  .pdp-hero .pdp-stage figcaption { margin-top: 6px; text-align: center; }
}
@media (max-width: 600px) {
  .pdp-hero .pdp-stage img { max-height: 190px; }
}

/* Optional add-ons: collapsible */
.pdp-optional { font-size: 12px; font-weight: 500; color: var(--muted); }
.pdp-more { clear: both; }
.pdp-more summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px dashed color-mix(in srgb, var(--tech) 45%, var(--line));
  border-radius: 14px;
  color: var(--tech);
  font-size: 15px;
  font-weight: 600;
}
.pdp-more summary::-webkit-details-marker { display: none; }
.pdp-more summary span { font-size: 20px; transition: transform 0.3s; }
.pdp-more[open] summary { margin-bottom: 16px; }
.pdp-more[open] summary span { transform: rotate(45deg); }

/* Sticky total while filling the order form (phones/tablets only) */
.pdp-dock { display: none; }
@media (max-width: 980px) {
  .pdp-dock {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--glass);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(110%);
    transition: transform 0.3s ease;
  }
  .pdp-dock.is-visible { transform: none; }
  .pdp-dock > span { display: grid; font-size: 12px; color: var(--muted); line-height: 1.2; }
  .pdp-dock b { font-size: 20px; color: var(--ink); }
  .pdp-dock .button { flex: 0 1 auto; min-height: 48px; }
}

/* ---- Round 3: grouped spec sheet ---- */
.spec-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.spec-group {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.spec-group::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -60px -60px auto auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--tone-soft), transparent);
}
.spec-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
  font-size: 18px;
}
.spec-group .vv-ico {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--tone);
  background: linear-gradient(145deg, var(--tone-soft), color-mix(in srgb, var(--tone-soft) 55%, var(--surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 20%, transparent);
}
.spec-group .vv-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spec-group .spec-sheet {
  margin: 0;
  grid-template-columns: 1fr;
}
.spec-group .spec-sheet > div {
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 13px 0;
}
.spec-group .spec-sheet > div:last-child { border-bottom: 0; }
.spec-group .spec-sheet dd { font-size: 15px; }
@media (max-width: 1100px) {
  .spec-groups { grid-template-columns: 1fr 1fr; }
  .spec-group:last-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .spec-groups { grid-template-columns: 1fr; }
  .spec-group { padding: 20px; }
}

/* ---- Inline field errors in the order form ---- */
.pdp-fields input[aria-invalid="true"],
.pdp-fields textarea[aria-invalid="true"] {
  border-color: var(--t-coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-coral) 16%, transparent);
}
.pdp-fields .field-err {
  color: var(--t-coral);
  font-size: 13px;
  font-weight: 600;
}
.pdp-fields .field-err[hidden] { display: none; }
