/* ============================================================
   Shopno Rong — gadget & home-automation skin
   Layered on top of jadideshop/css/style.css (loaded after it).

   Colour comes from Admin → Site settings (primary / accent /
   background / text). The layout injects those into :root as
   --sr-primary … --sr-text; everything below derives from them,
   so recolouring the store never needs a CSS edit.
   Defaults (when a setting is empty) are the tech palette:
   midnight #0b1224 + electric cyan #00a8e8.
   ============================================================ */

:root {
  --sr-primary: #0b1224;
  --sr-accent:  #00a8e8;
  --sr-bg:      #f6f8fc;
  --sr-text:    #101828;

  /* ---- remap the jadideshop design tokens ---- */
  --jp:        var(--sr-primary);
  --jp-dark:   color-mix(in srgb, var(--sr-primary) 78%, #000);
  --jp-soft:   color-mix(in srgb, var(--sr-primary) 8%,  #fff);

  --accent:      var(--sr-accent);
  --accent-dark: color-mix(in srgb, var(--sr-accent) 74%, #000);
  --accent-soft: color-mix(in srgb, var(--sr-accent) 10%, #fff);
  --accent-line: color-mix(in srgb, var(--sr-accent) 32%, #fff);

  --ink:    var(--sr-text);
  --bg:     var(--sr-bg);
  --line:   color-mix(in srgb, var(--sr-text) 9%,  #fff);
  --line-2: color-mix(in srgb, var(--sr-text) 15%, #fff);
  --dark-1: color-mix(in srgb, var(--sr-primary) 92%, #000);

  --bs-primary: var(--sr-primary);
  --bs-body-bg: var(--sr-bg);
  --bs-body-color: var(--sr-text);
  --bs-link-color: var(--sr-primary);

  /* gadget-skin extras */
  --sr-glow: 0 10px 30px -12px color-mix(in srgb, var(--sr-accent) 65%, transparent);
  --sr-grid: color-mix(in srgb, var(--sr-accent) 18%, transparent);
}

/* Fallback for browsers without color-mix(): plain tokens still apply. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  :root { --jp-dark: #060b16; --jp-soft: #eef2f8; --accent-dark: #0079a8; --accent-soft: #e6f6fd; --accent-line: #b3e4f8; }
}

/* ============ CTA CONTRAST ============ */
/* A bright accent (cyan) fails contrast behind white label text, so solid
   filled buttons use a darkened mix while chips/badges keep the bright tone. */
:root { --sr-cta: color-mix(in srgb, var(--sr-accent) 68%, #000); }
.btn-brand { background: var(--sr-cta); border-color: var(--sr-cta); }
.btn-brand:hover, .btn-brand:focus {
  background: color-mix(in srgb, var(--sr-accent) 55%, #000);
  border-color: color-mix(in srgb, var(--sr-accent) 55%, #000);
}
.btn-outline-brand { border-color: var(--sr-cta); color: var(--sr-cta); }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--sr-cta); border-color: var(--sr-cta); color: #fff; }
.price-now, .product-brand, .sr-need-link, .sr-kicker { color: var(--sr-cta); }

/* ============ TECH TEXTURE ============ */
/* Faint circuit grid used behind dark bands (hero, flash, automation). */
.sr-grid-bg {
  background-image:
    linear-gradient(var(--sr-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sr-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
}

/* ============ HERO ============ */
.hero { border: 1px solid color-mix(in srgb, var(--sr-accent) 18%, transparent); }
/* Sits close under the dark header so the two dark blocks read as one unit,
   with just enough gap to keep the hero reading as a card. */
.sr-hero-wrap { margin-top: .5rem; }
.hero-scrim {
  background:
    linear-gradient(100deg,
      color-mix(in srgb, var(--sr-primary) 92%, transparent) 0%,
      color-mix(in srgb, var(--sr-primary) 62%, transparent) 48%,
      color-mix(in srgb, var(--sr-primary) 8%,  transparent) 82%);
}
.hero-kicker {
  padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--sr-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sr-accent) 42%, transparent);
  color: color-mix(in srgb, var(--sr-accent) 72%, #fff);
}
.hero .btn-brand { box-shadow: var(--sr-glow); }

/* ============ USP STRIP (under the hero) ============ */
.sr-usp {
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sr-usp-item {
  display: flex; align-items: center; gap: 11px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; min-width: 0;
  transition: border-color .2s, box-shadow .2s;
}
.sr-usp-item:hover { border-color: var(--accent-line); box-shadow: 0 12px 26px -18px rgba(16,24,40,.5); }
.sr-usp-ico {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.sr-usp-item b { display: block; font-size: 13px; line-height: 1.25; }
.sr-usp-item span { font-size: 11.5px; color: var(--muted); }
@media (max-width: 991.98px) { .sr-usp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============ SHOP BY NEED (automation use-cases) ============ */
.sr-need {
  position: relative; display: block; overflow: hidden;
  border-radius: 18px; padding: 22px 18px; height: 100%;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.sr-need::after {
  content: ''; position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sr-accent) 20%, transparent), transparent 70%);
  transition: transform .3s;
}
.sr-need:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: 0 20px 40px -22px rgba(16,24,40,.45); color: var(--ink); }
.sr-need:hover::after { transform: scale(1.35); }
.sr-need-ico {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--jp-soft); color: var(--jp);
}
.sr-need h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.sr-need p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.sr-need-link { font-size: 12px; font-weight: 700; color: var(--accent-dark); margin-top: 10px; display: inline-block; }

/* ============ AUTOMATION SHOWCASE BAND ============ */
.sr-auto {
  background: linear-gradient(120deg, var(--jp-dark), var(--jp));
  color: #fff; position: relative; overflow: hidden;
}
.sr-auto::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(var(--sr-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sr-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 70% 50%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 70% 50%, #000, transparent 72%);
}
.sr-auto > * { position: relative; }
.sr-auto h2 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; letter-spacing: -.02em; }
.sr-auto p { color: #c3ccdd; }
.sr-step {
  display: flex; gap: 13px; align-items: flex-start;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 16px; height: 100%;
}
.sr-step-num {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  background: var(--accent); color: #fff;
}
.sr-step b { display: block; font-size: 14px; margin-bottom: 3px; }
.sr-step span { font-size: 12.5px; color: #aab5c9; line-height: 1.5; }

/* ============ SPEC / TRUST CHIPS ============ */
.sr-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
  border: 1px solid var(--accent-line);
}
.sr-chip.dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #dbe4f2; }

/* ============ BRAND RAIL ============ */
.sr-brand-rail { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.sr-brand-rail::-webkit-scrollbar { display: none; }
.sr-brand-tile {
  flex: 0 0 auto; width: 140px; height: 76px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 12px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-decoration: none; transition: all .2s;
}
.sr-brand-tile:hover { border-color: var(--accent-line); color: var(--jp); box-shadow: 0 12px 26px -18px rgba(16,24,40,.5); }
.sr-brand-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ============ PRODUCT CARD — gadget tweaks ============ */
.product-media {
  background: linear-gradient(150deg, color-mix(in srgb, var(--sr-primary) 5%, #fff), color-mix(in srgb, var(--sr-accent) 7%, #fff));
}
.product-card:hover { border-color: var(--accent-line); }
.product-brand { color: var(--accent-dark); }
.badge-disc { background: var(--accent-dark); }

/* ============ SECTION HEADINGS ============ */
.section-title { position: relative; }
.sr-kicker {
  display: inline-block; font-size: 11.5px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 6px;
}

/* ============ FEATURE CARDS (why-shop band) ============ */
.sr-why { background: linear-gradient(180deg, color-mix(in srgb, var(--sr-primary) 4%, #fff), var(--bg)); }
.feature-ico { background: var(--accent-soft); color: var(--accent-dark); }

/* ============ DARK UNIFIED HEADER ============ */
/* Announce + header + category rail read as one dark block, so the sticky
   chrome matches the dark hero / automation band / footer instead of
   flipping light→dark→light. Every colour derives from --sr-primary. */
:root {
  --sr-head-bg:     color-mix(in srgb, var(--sr-primary) 96%, #000);
  --sr-head-line:   color-mix(in srgb, #fff 12%, transparent);
  --sr-head-text:   color-mix(in srgb, #fff 88%, var(--sr-primary));
  --sr-head-muted:  color-mix(in srgb, #fff 62%, var(--sr-primary));
  --sr-head-hover:  color-mix(in srgb, #fff 10%, transparent);
}

.announce {
  background: color-mix(in srgb, var(--sr-primary) 88%, #000);
  color: var(--sr-head-muted);
  border-bottom: 1px solid var(--sr-head-line);
}
.announce a { color: var(--sr-accent); }

.site-header {
  background: color-mix(in srgb, var(--sr-head-bg) 94%, transparent);
  border-bottom: 1px solid var(--sr-head-line);
  color: var(--sr-head-text);
}

/* Logos are usually dark-on-white artwork; a white plate keeps any uploaded
   logo legible on the dark bar without asking the client for a new file. */
.brand-logo { background: #fff; padding: 4px 8px; }

/* search — the primary action in a gadget store, so it gets the accent focus ring */
.search-pill {
  background: color-mix(in srgb, #fff 8%, transparent);
  border-color: var(--sr-head-line);
}
.search-pill:focus-within {
  background: color-mix(in srgb, #fff 12%, transparent);
  border-color: var(--sr-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sr-accent) 22%, transparent);
}
.search-pill input { color: #fff; }
.search-pill input::placeholder { color: var(--sr-head-muted); }
.search-clear { color: var(--sr-head-muted); }
.search-clear:hover { color: #fff; }

.icon-link { color: var(--sr-head-text); }
.icon-link:hover { background: var(--sr-head-hover); color: #fff; }

/* category rail sits inside the same dark block — no separate grey band */
.mega-nav { background: transparent; border-top: 1px solid var(--sr-head-line); }
.mega-nav a, .mega-nav button { color: var(--sr-head-muted); padding-top: 9px; padding-bottom: 9px; }
.mega-nav a:hover, .mega-nav button:hover { color: #fff; }
.mega-nav a.active { color: #fff; border-bottom: 2px solid var(--sr-accent); }
.mega-nav .all-cats { color: var(--sr-accent); }
.site-header.is-compact .mega-nav a,
.site-header.is-compact .mega-nav button { padding-top: 6px; padding-bottom: 6px; }

/* rail edge fades + arrows follow the dark bar */
.mega-wrap::before { background: linear-gradient(90deg,  var(--sr-head-bg) 30%, transparent); }
.mega-wrap::after  { background: linear-gradient(270deg, var(--sr-head-bg) 30%, transparent); }
.mega-arrow {
  background: color-mix(in srgb, #fff 12%, transparent);
  border-color: var(--sr-head-line);
  color: #fff;
}
.mega-arrow:hover { background: color-mix(in srgb, #fff 20%, transparent); }

/* hotline — trust signal for a high-consideration gadget purchase */
.sr-hotline {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px;
  border-radius: 12px; text-decoration: none; color: var(--sr-head-text);
  border: 1px solid var(--sr-head-line); transition: background .2s;
}
.sr-hotline:hover { background: var(--sr-head-hover); color: #fff; }
.sr-hotline small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--sr-head-muted); line-height: 1.3; }
.sr-hotline b { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; }

/* secondary action: cart owns the filled accent, sign-in stays a ghost */
.sr-ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; font-size: 13px; font-weight: 700; text-decoration: none;
  color: var(--sr-head-text); border: 1px solid var(--sr-head-line);
  background: transparent; transition: background .2s, border-color .2s;
}
.sr-ghost-btn:hover { background: var(--sr-head-hover); border-color: color-mix(in srgb, #fff 26%, transparent); color: #fff; }

/* cart button keeps its badge pinned to the pill, not the icon */
#jp-cart-toggle .icon-badge { top: -5px; right: -4px; }

/* ---- desktop sub-category panels ---- */
.sr-nav-item { position: relative; display: inline-flex; }
.sr-caret { font-size: 9px; opacity: .7; }
.sr-nav-panel {
  display: none; position: absolute; top: 100%; left: 0; z-index: 1200;
  min-width: 210px; padding: 8px; border-radius: 0 0 14px 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 36px -18px rgba(0,0,0,.35);
}
.sr-nav-panel a {
  display: block; padding: 8px 12px; border-radius: 9px;
  font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.sr-nav-panel a:hover { background: var(--jp-soft); color: var(--sr-cta); }
.sr-nav-panel .sr-nav-all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; color: var(--sr-cta); font-weight: 700; }
@media (min-width: 992px) {
  /* the rail only needs to scroll on narrow screens; letting it overflow here
     is what allows the dropdown panels to escape the rail box */
  .mega-scroll { overflow: visible; }
  .sr-nav-item:hover .sr-nav-panel,
  .sr-nav-item:focus-within .sr-nav-panel { display: block; }
}
@media (max-width: 991.98px) { .sr-caret { display: none; } }

/* ---- mobile drawer accordion ---- */
.sr-acc-btn { cursor: pointer; }
.sr-acc-caret { transition: transform .2s; }
.sr-acc-btn[aria-expanded="true"] { background: var(--jp-soft); }
.sr-acc-btn[aria-expanded="true"] .sr-acc-caret { transform: rotate(180deg); }
.sr-acc-body { display: none; padding: 2px 0 6px 50px; }
.sr-acc-body.is-open { display: block; }
.sr-acc-body a {
  display: block; padding: 8px 10px; border-radius: 9px;
  font-size: 13px; color: var(--muted); text-decoration: none;
}
.sr-acc-body a:hover { background: var(--jp-soft); color: var(--sr-cta); }

/* typeahead popover stays a light surface, but tokenised */
.jp-sug:hover, .jp-sug.is-active { background: var(--jp-soft); }
.jp-sug-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jp-sug-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-sug-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; line-height: 1; }
.jp-sug-line b { color: var(--sr-cta); font-size: 13px; }
.jp-sug-line s { color: var(--muted-2); }
.jp-sug-line em { font-style: normal; color: var(--muted); }
.jp-sug-line i { font-style: normal; font-weight: 700; }
.jp-sug-line i.ok  { color: var(--ok); }
.jp-sug-line i.out { color: var(--danger); }

/* focus ring must be visible against the dark bar */
.site-header a:focus-visible,
.site-header button:focus-visible,
.site-header input:focus-visible { outline-color: var(--sr-accent); }

/* ============ ANNOUNCE / FOOTER ============ */
/* Rotator: one message visible at a time, swapped by a small script in the layout. */
.sr-announce-rotator { display: inline-block; }
.sr-announce-item { display: none; }
.sr-announce-item.is-on { display: inline; }
.site-footer { background: var(--jp-dark); }
