/* ==========================================================================
   QVH Shared UI Layer · qvh-ui.css  v1.0  (2026-11-21)
   --------------------------------------------------------------------------
   Scope
     Cross-site design tokens + component atoms for the QVH outbound platform.
     Opt-in only: add class `qvh-ui` to <html> (or a page wrapper). This file
     never styles bare elements and never overrides a site-private class.

   Usage (minimum)
     <html class="qvh-ui">
       <div class="qvh-wrap"> … .qvh-card / .qvh-mega / .qvh-hscroll … </div>
     </html>
     <link rel="stylesheet" href="/shared/qvh-ui.css?v=20261121u1">

   Order constraint (known pitfall)
     A later-loaded plain `:root{--shell:…}` rule wins over an earlier media-
     query variable of equal weight. Tokens here are therefore declared on
     `:root.qvh-ui` (specificity 0,1,1) so they beat plain `:root` regardless
     of load order. Do NOT move token declarations to bare `:root`.

   Browser baseline
     Chromium (Chrome / Edge) fully supported; WebKit/Safari: every modern
     feature (backdrop-filter, gap, scroll-snap, :has) carries an @supports
     fallback below. No web font, no third-party JS, no image dependency.
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root.qvh-ui {
  /* ---- Brand (teal, aligned with existing shop #0F766E / #134E4A) ---- */
  --qvh-brand-50:  #f0fdfa;
  --qvh-brand-100: #ccfbf1;
  --qvh-brand-200: #99f6e4;
  --qvh-brand-300: #5eead4;
  --qvh-brand-400: #2dd4bf;
  --qvh-brand-500: #14b8a6;
  --qvh-brand-600: #0f766e;
  --qvh-brand-700: #134e4a;
  --qvh-brand-800: #115e59;
  --qvh-brand-900: #103531;

  /* ---- Accent (amber, existing #F59E0B) ---- */
  --qvh-accent-300: #fcd34d;
  --qvh-accent-400: #fbbf24;
  --qvh-accent-500: #f59e0b;
  --qvh-accent-600: #d97706;

  /* ---- Ink / neutrals ---- */
  --qvh-ink-900: #111827;
  --qvh-ink-700: #374151;
  --qvh-ink-500: #6b7280;
  --qvh-ink-400: #9ca3af;
  --qvh-ink-300: #d1d5db;
  --qvh-ink-200: #e5e7eb;
  --qvh-ink-100: #f3f4f6;

  /* ---- Surfaces & lines ---- */
  --qvh-surface-0:   #ffffff;
  --qvh-surface-50: #f8fafc;
  --qvh-surface-100:#f1f5f9;
  --qvh-line:        #e7eaee;
  --qvh-line-strong: #d3d8de;

  /* ---- Semantic ---- */
  --qvh-success:      #16a34a;
  --qvh-success-bg:  #f0fdf4;
  --qvh-warning:     #d97706;
  --qvh-warning-bg:  #fffbeb;
  --qvh-danger:      #dc2626;
  --qvh-danger-bg:    #fef2f2;
  --qvh-info:         #0284c7;
  --qvh-info-bg:      #f0f9ff;

  /* ---- Glass ---- */
  --qvh-glass-bg:     rgba(255, 255, 255, .74);
  --qvh-glass-border: rgba(255, 255, 255, .62);
  --qvh-glass-blur:   12px;

  /* ---- Radius ---- */
  --qvh-r-sm:   6px;
  --qvh-r-md:  10px;
  --qvh-r-lg:  16px;
  --qvh-r-xl:  24px;
  --qvh-r-pill: 999px;

  /* ---- Shadow ---- */
  --qvh-shadow-xs:   0 1px 2px rgba(16, 24, 40, .06);
  --qvh-shadow-sm:   0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --qvh-shadow-md:   0 4px 12px rgba(16, 24, 40, .10);
  --qvh-shadow-lg:   0 12px 28px rgba(16, 24, 40, .14);
  --qvh-shadow-pop:  0 18px 44px rgba(16, 24, 40, .18);   /* floating layer */
  --qvh-shadow-hover:0 10px 24px rgba(15, 118, 110, .16);  /* raised card    */

  /* ---- Spacing scale (4 / 8 / 12 / 16 / 24 / 32 / 48 / 64) ---- */
  --qvh-sp-1:  4px;
  --qvh-sp-2:  8px;
  --qvh-sp-3: 12px;
  --qvh-sp-4: 16px;
  --qvh-sp-5: 24px;
  --qvh-sp-6: 32px;
  --qvh-sp-7: 48px;
  --qvh-sp-8: 64px;

  /* ---- Type scale (body >= 15px for readability) ---- */
  --qvh-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --qvh-fs-display: 40px;  --qvh-lh-display: 1.15; --qvh-fw-display: 700;
  --qvh-fs-h1:      30px;  --qvh-lh-h1:      1.2;  --qvh-fw-h1:      700;
  --qvh-fs-h2:      24px;  --qvh-lh-h2:      1.25; --qvh-fw-h2:      700;
  --qvh-fs-h3:      18px;  --qvh-lh-h3:      1.35; --qvh-fw-h3:      600;
  --qvh-fs-body:    15px;  --qvh-lh-body:     1.6;  --qvh-fw-body:    400;
  --qvh-fs-body-sm: 13.5px;--qvh-lh-body-sm: 1.55; --qvh-fw-body-sm:  400;
  --qvh-fs-caption: 12px;  --qvh-lh-caption:  1.5;  --qvh-fw-caption:  500;

  /* ---- Motion ---- */
  --qvh-ease-out-quint: cubic-bezier(.22, 1, .36, 1);
  --qvh-ease-spring:     cubic-bezier(.34, 1.56, .64, 1);
  --qvh-dur-1: 150ms;
  --qvh-dur-2: 220ms;
  --qvh-dur-3: 320ms;

  /* ---- Layout ---- */
  --qvh-wrap: min(1320px, calc(100% - 32px));
  --qvh-cols-product: 2;
  --qvh-cols-case:    1;
  --qvh-sticky-h: 64px;

  /* ---- Z-index ladder ---- */
  --qvh-z-base:   1;
  --qvh-z-hscroll:20;
  --qvh-z-sticky: 800;
  --qvh-z-mega:   900;
  --qvh-z-panel:  900;
  --qvh-z-mask:  1000;
  --qvh-z-drawer:1010;
}

/* Wide tiers — shop side: 1400 / 1560 / 1720 (sp side keeps its existing
   1320 / 1560 / 1720 tiers; do not fork a second scale here). */
@media (min-width: 1440px) {
  :root.qvh-ui { --qvh-wrap: 1400px; --qvh-cols-product: 4; }
}
@media (min-width: 1680px) {
  :root.qvh-ui { --qvh-wrap: 1560px; --qvh-cols-product: 4; --qvh-cols-case: 4; }
}
@media (min-width: 1880px) {
  :root.qvh-ui { --qvh-wrap: 1720px; }
}
@media (min-width: 1920px) {
  :root.qvh-ui { --qvh-cols-product: 5; }
}
@media (max-width: 1279px) {
  :root.qvh-ui { --qvh-cols-case: 3; }
}
@media (max-width: 1023px) {
  :root.qvh-ui { --qvh-cols-product: 3; --qvh-cols-case: 2; }
}
@media (max-width: 767px) {
  :root.qvh-ui { --qvh-cols-product: 2; --qvh-cols-case: 1; }
}

/* ==========================================================================
   2. BASE (opt-in scope only — no bare element selectors)
   ========================================================================== */

.qvh-ui {
  font-family: var(--qvh-font-sans);
  font-size: var(--qvh-fs-body);
  line-height: var(--qvh-lh-body);
  color: var(--qvh-ink-900);
  background: var(--qvh-surface-50);
  -webkit-text-size-adjust: 100%;
}

.qvh-wrap {
  width: var(--qvh-wrap);
  max-width: 100%;
  margin-inline: auto;
}

.qvh-ui h1, .qvh-ui h2, .qvh-ui h3 { margin: 0; }
.qvh-ui p  { margin: 0; }
.qvh-ui a  { color: inherit; }

/* ---- Typography helpers ---- */
.qvh-text-display { font-size: var(--qvh-fs-display); line-height: var(--qvh-lh-display); font-weight: var(--qvh-fw-display); }
.qvh-text-h1      { font-size: var(--qvh-fs-h1);      line-height: var(--qvh-lh-h1);      font-weight: var(--qvh-fw-h1); }
.qvh-text-h2      { font-size: var(--qvh-fs-h2);      line-height: var(--qvh-lh-h2);      font-weight: var(--qvh-fw-h2); }
.qvh-text-h3      { font-size: var(--qvh-fs-h3);      line-height: var(--qvh-lh-h3);      font-weight: var(--qvh-fw-h3); }
.qvh-text-body-sm { font-size: var(--qvh-fs-body-sm); line-height: var(--qvh-lh-body-sm); }
.qvh-text-caption { font-size: var(--qvh-fs-caption); line-height: var(--qvh-lh-caption); font-weight: var(--qvh-fw-caption); }
.qvh-ink-500 { color: var(--qvh-ink-500); }
.qvh-brand-600 { color: var(--qvh-brand-600); }

/* ==========================================================================
   3. BUTTONS / CONTROLS
   ========================================================================== */

/*
   Usage:
     <button class="qvh-btn qvh-btn--primary">Add to cart</button>
     <button class="qvh-btn qvh-btn--outline">Preview</button>
     <button class="qvh-btn qvh-btn--ghost">Similar</button>
   Modifiers: --sm / --block ; disabled via [disabled] or .is-disabled
*/
.qvh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--qvh-sp-2);
  min-height: 44px; padding: 0 var(--qvh-sp-4);
  border: 1px solid transparent; border-radius: var(--qvh-r-pill);
  font: inherit; font-weight: 600; font-size: var(--qvh-fs-body-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--qvh-dur-1) var(--qvh-ease-out-quint),
              border-color var(--qvh-dur-1) var(--qvh-ease-out-quint),
              color var(--qvh-dur-1) var(--qvh-ease-out-quint),
              transform var(--qvh-dur-1) var(--qvh-ease-out-quint);
}
.qvh-btn--primary { background: var(--qvh-brand-600); color: #fff; }
.qvh-btn--primary:hover { background: var(--qvh-brand-700); }
.qvh-btn--outline { background: var(--qvh-surface-0); color: var(--qvh-brand-700); border-color: var(--qvh-line-strong); }
.qvh-btn--outline:hover { border-color: var(--qvh-brand-600); color: var(--qvh-brand-600); }
.qvh-btn--ghost { background: transparent; color: var(--qvh-ink-700); }
.qvh-btn--ghost:hover { background: var(--qvh-ink-100); }
.qvh-btn--sm { min-height: 44px; padding: 0 var(--qvh-sp-3); font-size: var(--qvh-fs-body-sm); }
.qvh-btn--block { display: flex; width: 100%; }
.qvh-btn[disabled], .qvh-btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Check / radio row */
.qvh-check { display: inline-flex; align-items: center; gap: var(--qvh-sp-2); font-size: var(--qvh-fs-body-sm); color: var(--qvh-ink-700); cursor: pointer; }
.qvh-check input { width: 18px; height: 18px; accent-color: var(--qvh-brand-600); }

/* ==========================================================================
   4. COMPONENT: qvh-sticky  (sticky header, does not cover following content)
   --------------------------------------------------------------------------
   Usage:
     <header class="qvh-sticky"> …logo / nav / actions… </header>
   Notes: sticky keeps its original layout slot, so it never hides the block
   below. Anchored targets need `scroll-margin-top`; the header sets the
   CSS var --qvh-sticky-h for that purpose.
   ========================================================================== */

.qvh-sticky {
  position: sticky; top: 0; z-index: var(--qvh-z-sticky);
  background: var(--qvh-glass-bg);
  border-bottom: 1px solid var(--qvh-line);
  scroll-margin-top: var(--qvh-sticky-h);
}
@supports (backdrop-filter: blur(1px)) {
  .qvh-sticky { backdrop-filter: blur(var(--qvh-glass-blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--qvh-glass-blur)) saturate(1.4); }
}

/* ==========================================================================
   5. COMPONENT: qvh-mega  (hover category panel; 150ms open; ESC / outside
      click closes; keyboard reachable; mobile = full-screen drawer)
   --------------------------------------------------------------------------
   Usage:
     <nav class="qvh-mega" data-mega>
       <button class="qvh-mega__trigger" aria-expanded="false" aria-haspopup="true">All Categories</button>
       <div class="qvh-mega__panel" role="menu" aria-label="Categories">
         <div class="qvh-mega__cols">
           <div class="qvh-mega__group"><h4>Group</h4><a role="menuitem">…</a></div>
         </div>
       </div>
     </nav>
   State hooks (wired by a tiny site script): .is-open on .qvh-mega;
   ESC closes, pointer-down outside closes, focus-within keeps open.
   ========================================================================== */

.qvh-mega { position: relative; }

.qvh-mega__trigger {
  display: inline-flex; align-items: center; gap: var(--qvh-sp-2);
  min-height: 44px; padding: 0 var(--qvh-sp-3);
  background: transparent; border: 0; border-radius: var(--qvh-r-md);
  font: inherit; font-weight: 600; color: var(--qvh-ink-700); cursor: pointer;
}
.qvh-mega__trigger:hover, .qvh-mega__trigger[aria-expanded="true"] { color: var(--qvh-brand-700); background: var(--qvh-brand-50); }

.qvh-mega__panel {
  position: absolute; top: calc(100% + var(--qvh-sp-2)); left: 0;
  min-width: 340px; max-width: min(560px, calc(100vw - 32px));
  background: var(--qvh-surface-0); border: 1px solid var(--qvh-line);
  border-radius: var(--qvh-r-lg); box-shadow: var(--qvh-shadow-pop);
  padding: var(--qvh-sp-4); z-index: var(--qvh-z-mega);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--qvh-dur-1) var(--qvh-ease-out-quint),
              transform var(--qvh-dur-1) var(--qvh-ease-out-quint),
              visibility 0s linear var(--qvh-dur-1);
}
.qvh-mega:hover .qvh-mega__panel,
.qvh-mega:focus-within .qvh-mega__panel,
.qvh-mega.is-open .qvh-mega__panel {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--qvh-dur-1) var(--qvh-ease-out-quint),
              transform var(--qvh-dur-1) var(--qvh-ease-out-quint),
              visibility 0s;
}

.qvh-mega__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--qvh-sp-4); }
.qvh-mega__group h4 { font-size: var(--qvh-fs-caption); color: var(--qvh-ink-500); margin-bottom: var(--qvh-sp-2); text-transform: uppercase; letter-spacing: .04em; }
.qvh-mega__group a {
  display: block; padding: var(--qvh-sp-2) var(--qvh-sp-2); border-radius: var(--qvh-r-sm);
  font-size: var(--qvh-fs-body-sm); color: var(--qvh-ink-700); text-decoration: none;
}
.qvh-mega__group a:hover { background: var(--qvh-brand-50); color: var(--qvh-brand-700); }

/* Mobile: full-screen drawer */
@media (max-width: 767px) {
  .qvh-mega__panel {
    position: fixed; inset: 0; top: 0; left: 0; right: 0; min-width: 0; max-width: none;
    border: 0; border-radius: 0; padding: var(--qvh-sp-5);
    overflow-y: auto;
  }
  .qvh-mega__cols { grid-template-columns: 1fr; }
}

/* ==========================================================================
   6. COMPONENT: qvh-filter  (desktop collapsible left rail; mobile drawer)
   --------------------------------------------------------------------------
   Usage:
     <aside class="qvh-filter" data-filter>
       <header class="qvh-filter__head">
         <span class="qvh-text-h3">Filters</span>
         <button class="qvh-filter__toggle" aria-expanded="true" data-filter-toggle>Collapse</button>
       </header>
       <div class="qvh-filter__body">
         <div class="qvh-collapse"> …filter group… </div>
       </div>
     </aside>
   ========================================================================== */

.qvh-filter {
  background: var(--qvh-surface-0); border: 1px solid var(--qvh-line);
  border-radius: var(--qvh-r-lg); overflow: hidden; min-width: 0;
}
.qvh-filter__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--qvh-sp-3); padding: var(--qvh-sp-4);
  border-bottom: 1px solid var(--qvh-line);
}
.qvh-filter__toggle {
  background: transparent; border: 0; color: var(--qvh-brand-600);
  font: inherit; font-size: var(--qvh-fs-body-sm); font-weight: 600; cursor: pointer;
}
.qvh-filter__body { padding: var(--qvh-sp-4); display: flex; flex-direction: column; gap: var(--qvh-sp-4); }

/* Collapsed rail (desktop) */
.qvh-filter.is-collapsed .qvh-filter__body { display: none; }
.qvh-filter.is-collapsed { border-radius: var(--qvh-r-lg); }

@media (max-width: 767px) {
  .qvh-filter { position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 88vw); z-index: var(--qvh-z-drawer);
    border: 0; border-radius: 0; opacity: 0; visibility: hidden; transform: translateX(-105%);
    transition: transform var(--qvh-dur-3) var(--qvh-ease-out-quint), opacity var(--qvh-dur-2) var(--qvh-ease-out-quint), visibility 0s linear var(--qvh-dur-3); }
  .qvh-filter.is-open { opacity: 1; visibility: visible; transform: none; }
}

/* ==========================================================================
   7. COMPONENT: qvh-drawer / qvh-cart / qvh-sheet
   --------------------------------------------------------------------------
   qvh-cart usage:
     <div class="qvh-mask" data-mask hidden></div>
     <aside class="qvh-drawer qvh-cart" role="dialog" aria-modal="true" aria-label="Cart" data-cart>
       <header class="qvh-drawer__head"><span>Cart</span><button data-close aria-label="Close">×</button></header>
       <div class="qvh-drawer__body"> …line items… </div>
       <footer class="qvh-drawer__foot"> …summary / CTA… </footer>
     </aside>
   State: .is-open on drawer + mask; focus trap and ESC wired by site script.

   qvh-sheet usage (bottom sheet, mobile):
     <section class="qvh-sheet" role="dialog" aria-modal="true" data-sheet> … </section>
   ========================================================================== */

.qvh-mask {
  position: fixed; inset: 0; z-index: var(--qvh-z-mask);
  background: rgba(17, 24, 39, .42);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--qvh-dur-2) var(--qvh-ease-out-quint), visibility 0s linear var(--qvh-dur-2);
}
.qvh-mask.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--qvh-dur-2) var(--qvh-ease-out-quint), visibility 0s; }

.qvh-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--qvh-z-drawer);
  width: min(420px, 100vw); background: var(--qvh-surface-0);
  display: none; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(105%);
  transition: transform var(--qvh-dur-3) var(--qvh-ease-out-quint),
              opacity var(--qvh-dur-2) var(--qvh-ease-out-quint),
              visibility 0s linear var(--qvh-dur-3);
  box-shadow: var(--qvh-shadow-pop);
}
.qvh-drawer.is-open { display: flex; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: transform var(--qvh-dur-3) var(--qvh-ease-out-quint),
              opacity var(--qvh-dur-2) var(--qvh-ease-out-quint), visibility 0s;
}
.qvh-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--qvh-sp-4) var(--qvh-sp-5); border-bottom: 1px solid var(--qvh-line);
}
.qvh-drawer__head button { background: transparent; border: 0; font-size: 22px; line-height: 1; color: var(--qvh-ink-500); cursor: pointer; }
.qvh-drawer__body { flex: 1; overflow-y: auto; padding: var(--qvh-sp-5); }
.qvh-drawer__foot { padding: var(--qvh-sp-4) var(--qvh-sp-5); border-top: 1px solid var(--qvh-line); }

.qvh-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--qvh-z-drawer);
  background: var(--qvh-surface-0); border-radius: var(--qvh-r-xl) var(--qvh-r-xl) 0 0;
  padding: var(--qvh-sp-4) var(--qvh-sp-5) var(--qvh-sp-5);
  display: none; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(105%);
  transition: transform var(--qvh-dur-3) var(--qvh-ease-out-quint),
              opacity var(--qvh-dur-2) var(--qvh-ease-out-quint),
              visibility 0s linear var(--qvh-dur-3);
  box-shadow: var(--qvh-shadow-pop); max-height: 82vh; overflow-y: auto;
}
.qvh-sheet.is-open { display: block; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: transform var(--qvh-dur-3) var(--qvh-ease-out-quint),
              opacity var(--qvh-dur-2) var(--qvh-ease-out-quint), visibility 0s;
}
.qvh-sheet__grip { width: 40px; height: 4px; border-radius: var(--qvh-r-pill); background: var(--qvh-ink-300); margin: 0 auto var(--qvh-sp-3); }

/* ==========================================================================
   8. COMPONENT: qvh-panel  (language / currency popover, compact column)
   --------------------------------------------------------------------------
   Usage:
     <div class="qvh-panel-wrap" data-panel>
       <button class="qvh-panel__trigger" aria-expanded="false" aria-haspopup="true">EN · USD</button>
       <div class="qvh-panel" role="menu">
         <button class="qvh-panel__item is-active" role="menuitemradio">English</button>
       </div>
     </div>
   ========================================================================== */

.qvh-panel-wrap { position: relative; }
.qvh-panel__trigger {
  display: inline-flex; align-items: center; gap: var(--qvh-sp-2); min-height: 44px;
  padding: 0 var(--qvh-sp-3); background: transparent; border: 1px solid var(--qvh-line);
  border-radius: var(--qvh-r-pill); font: inherit; font-size: var(--qvh-fs-body-sm);
  color: var(--qvh-ink-700); cursor: pointer;
}
.qvh-panel {
  position: absolute; top: calc(100% + var(--qvh-sp-2)); right: 0;
  min-width: 180px; max-width: min(260px, calc(100vw - 32px));
  background: var(--qvh-surface-0); border: 1px solid var(--qvh-line);
  border-radius: var(--qvh-r-lg); box-shadow: var(--qvh-shadow-md);
  padding: var(--qvh-sp-1); z-index: var(--qvh-z-panel);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--qvh-dur-1) var(--qvh-ease-out-quint),
              transform var(--qvh-dur-1) var(--qvh-ease-out-quint),
              visibility 0s linear var(--qvh-dur-1);
}
.qvh-panel-wrap:hover .qvh-panel,
.qvh-panel-wrap:focus-within .qvh-panel,
.qvh-panel-wrap.is-open .qvh-panel {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--qvh-dur-1) var(--qvh-ease-out-quint),
              transform var(--qvh-dur-1) var(--qvh-ease-out-quint), visibility 0s;
}
.qvh-panel__item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--qvh-sp-3);
  width: 100%; padding: var(--qvh-sp-2) var(--qvh-sp-3); background: transparent; border: 0;
  border-radius: var(--qvh-r-sm); font: inherit; font-size: var(--qvh-fs-body-sm);
  color: var(--qvh-ink-700); text-align: left; cursor: pointer;
}
.qvh-panel__item:hover { background: var(--qvh-brand-50); }
.qvh-panel__item.is-active { color: var(--qvh-brand-700); font-weight: 600; }

/* ==========================================================================
   9. COMPONENT: qvh-card  (product card; hover reveals actions; mobile tap
      enters detail)
   --------------------------------------------------------------------------
   Usage:
     <article class="qvh-card">
       <a class="qvh-card__media" href="/product/1"><span class="qvh-card__badge">New</span></a>
       <div class="qvh-card__body">
         <h3 class="qvh-card__title"><a href="/product/1">Product name</a></h3>
         <p class="qvh-card__meta">Shop · SPU-808</p>
         <div class="qvh-card__price">$12.00</div>
         <div class="qvh-card__actions">
           <button class="qvh-btn qvh-btn--primary qvh-btn--sm">Add</button>
           <button class="qvh-btn qvh-btn--ghost qvh-btn--sm">Preview</button>
           <button class="qvh-btn qvh-btn--ghost qvh-btn--sm">Similar</button>
         </div>
       </div>
     </article>
   Grid wrappers: .qvh-grid--products / .qvh-grid--cases
   ========================================================================== */

.qvh-grid--products { display: grid; grid-template-columns: repeat(var(--qvh-cols-product), minmax(0, 1fr)); gap: var(--qvh-sp-4); }
.qvh-grid--cases    { display: grid; grid-template-columns: repeat(var(--qvh-cols-case), minmax(0, 1fr));    gap: var(--qvh-sp-5); }
.qvh-grid--products > *, .qvh-grid--cases > * { min-width: 0; }
@media (max-width: 767px) {
  .qvh-grid--products { gap: var(--qvh-sp-3); }
}

.qvh-card {
  display: flex; flex-direction: column; background: var(--qvh-surface-0);
  border: 1px solid var(--qvh-line); border-radius: var(--qvh-r-lg);
  overflow: hidden; transition: transform var(--qvh-dur-2) var(--qvh-ease-out-quint),
              box-shadow var(--qvh-dur-2) var(--qvh-ease-out-quint),
              border-color var(--qvh-dur-2) var(--qvh-ease-out-quint);
}
.qvh-card:hover, .qvh-card:focus-within {
  transform: translateY(-3px); border-color: var(--qvh-brand-200);
  box-shadow: var(--qvh-shadow-hover);
}
.qvh-card__media {
  position: relative; display: block; aspect-ratio: 4 / 3; background: var(--qvh-surface-100);
  text-decoration: none;
}
.qvh-card__badge {
  position: absolute; top: var(--qvh-sp-2); left: var(--qvh-sp-2);
  padding: 2px var(--qvh-sp-2); border-radius: var(--qvh-r-pill);
  background: var(--qvh-brand-700); color: #fff; font-size: var(--qvh-fs-caption); font-weight: 600;
}
.qvh-card__body { display: flex; flex-direction: column; gap: var(--qvh-sp-2); padding: var(--qvh-sp-4); flex: 1; }
.qvh-card__title { font-size: var(--qvh-fs-body); font-weight: 600; line-height: var(--qvh-lh-body); }
.qvh-card__title a { text-decoration: none; }
.qvh-card__title a:hover { color: var(--qvh-brand-600); }
.qvh-card__meta { font-size: var(--qvh-fs-body-sm); color: var(--qvh-ink-500); }
.qvh-card__price { font-size: var(--qvh-fs-h3); font-weight: 700; color: var(--qvh-brand-700); }
.qvh-card__actions {
  display: flex; align-items: center; gap: var(--qvh-sp-2); margin-top: var(--qvh-sp-2);
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--qvh-dur-1) var(--qvh-ease-out-quint), transform var(--qvh-dur-1) var(--qvh-ease-out-quint);
}
.qvh-card:hover .qvh-card__actions,
.qvh-card:focus-within .qvh-card__actions { opacity: 1; transform: none; }

/* Coarse pointers (touch): keep actions visible, compact */
@media (hover: none) {
  .qvh-card__actions { opacity: 1; transform: none; }
}

/* ==========================================================================
   10. COMPONENT: qvh-collapse  (details / filter groups / table rows)
   --------------------------------------------------------------------------
   Native details:
     <details class="qvh-collapse">
       <summary class="qvh-collapse__summary">Title <span class="qvh-collapse__chevron" aria-hidden="true"></span></summary>
       <div class="qvh-collapse__body"> … </div>
     </details>
   Div variant (JS toggles [hidden] + .is-open, aria-expanded):
     <div class="qvh-collapse">
       <button class="qvh-collapse__summary" aria-expanded="false">Title <span class="qvh-collapse__chevron"></span></button>
       <div class="qvh-collapse__body" hidden> … </div>
     </div>
   ========================================================================== */

.qvh-collapse { border-bottom: 1px solid var(--qvh-line); }
.qvh-collapse:last-child { border-bottom: 0; }
.qvh-collapse__summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--qvh-sp-3);
  width: 100%; padding: var(--qvh-sp-3) 0; background: transparent; border: 0;
  font: inherit; font-weight: 600; color: var(--qvh-ink-900); cursor: pointer; list-style: none;
}
.qvh-collapse__summary::-webkit-details-marker { display: none; }
.qvh-collapse__chevron {
  flex: 0 0 auto; width: 18px; height: 18px; position: relative;
  transition: transform var(--qvh-dur-2) var(--qvh-ease-out-quint);
}
.qvh-collapse__chevron::before, .qvh-collapse__chevron::after {
  content: ""; position: absolute; top: 50%; left: 50%; background: currentColor; border-radius: 2px;
}
.qvh-collapse__chevron::before { width: 10px; height: 2px; transform: translate(-50%, -50%); }
.qvh-collapse__chevron::after  { width: 2px; height: 10px; transform: translate(-50%, -50%); transition: transform var(--qvh-dur-2) var(--qvh-ease-out-quint); }
.qvh-collapse[open] .qvh-collapse__chevron,
.qvh-collapse.is-open .qvh-collapse__chevron { transform: rotate(180deg); }
.qvh-collapse[open] .qvh-collapse__chevron::after,
.qvh-collapse.is-open .qvh-collapse__chevron::after { transform: translate(-50%, -50%) rotate(90deg); }
.qvh-collapse__body { padding: 0 0 var(--qvh-sp-4); color: var(--qvh-ink-700); }

/* ==========================================================================
   11. COMPONENT: qvh-hscroll  (horizontal strip; arrows + scroll-snap)
   --------------------------------------------------------------------------
   Usage:
     <div class="qvh-hscroll" data-hscroll>
       <button class="qvh-hscroll__arrow qvh-hscroll__arrow--prev" aria-label="Previous"></button>
       <div class="qvh-hscroll__track">
         <article class="qvh-card">…</article> ×N
       </div>
       <button class="qvh-hscroll__arrow qvh-hscroll__arrow--next" aria-label="Next"></button>
     </div>
   Arrows toggle .is-disabled at scroll ends (site script); track keeps
   keyboard / wheel scroll even when the visual scrollbar is hidden.
   ========================================================================== */

.qvh-hscroll { position: relative; }
.qvh-hscroll__track {
  display: flex; gap: var(--qvh-sp-4); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: var(--qvh-sp-2) var(--qvh-sp-1) var(--qvh-sp-4);
  scrollbar-width: none; -ms-overflow-style: none;
}
.qvh-hscroll__track::-webkit-scrollbar { display: none; }
.qvh-hscroll__track > * { flex: 0 0 auto; width: min(280px, 80vw); scroll-snap-align: start; }
@supports not (scroll-snap-type: x mandatory) {
  .qvh-hscroll__track { scroll-snap-type: none; }
}
.qvh-hscroll__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: var(--qvh-z-hscroll);
  width: 40px; height: 40px; border-radius: var(--qvh-r-pill);
  background: var(--qvh-surface-0); border: 1px solid var(--qvh-line);
  box-shadow: var(--qvh-shadow-sm); color: var(--qvh-ink-700); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--qvh-dur-1) var(--qvh-ease-out-quint), opacity var(--qvh-dur-1);
}
.qvh-hscroll__arrow:hover { background: var(--qvh-brand-50); color: var(--qvh-brand-700); }
.qvh-hscroll__arrow--prev { left: calc(var(--qvh-sp-1) * -1); }
.qvh-hscroll__arrow--next { right: calc(var(--qvh-sp-1) * -1); }
.qvh-hscroll__arrow.is-disabled { opacity: 0; pointer-events: none; }
@media (max-width: 767px) {
  .qvh-hscroll__arrow { display: none; }
}

/* ==========================================================================
   12. COMPONENT: qvh-table  (order / logistics / SKU; collapsible rows)
   --------------------------------------------------------------------------
   Usage:
     <div class="qvh-table">
       <table>
         <thead><tr><th>Order</th><th>Status</th><th>Total</th></tr></thead>
         <tbody>
           <tr class="qvh-table__row">
             <td>#1001</td><td>Shipped</td><td>$120.00</td>
           </tr>
         </tbody>
       </table>
     </div>
   Collapsible detail per row: nest a <details class="qvh-collapse"> in the
   row's last cell, or expand the row via .qvh-table__row.is-open.
   Small screens: horizontal scroll inside the wrapper; no fixed 1140 shell.
   ========================================================================== */

.qvh-table {
  background: var(--qvh-surface-0); border: 1px solid var(--qvh-line);
  border-radius: var(--qvh-r-lg); overflow-x: auto; min-width: 0; max-width: 100%;
}
.qvh-table table { width: 100%; border-collapse: collapse; min-width: 560px; }
.qvh-table thead th {
  text-align: left; font-size: var(--qvh-fs-caption); font-weight: 600;
  color: var(--qvh-ink-500); padding: var(--qvh-sp-3) var(--qvh-sp-4);
  border-bottom: 1px solid var(--qvh-line); white-space: nowrap;
}
.qvh-table tbody td { padding: var(--qvh-sp-4); border-bottom: 1px solid var(--qvh-line); font-size: var(--qvh-fs-body-sm); }
.qvh-table tbody tr:last-child td { border-bottom: 0; }
.qvh-table tbody tr:hover { background: var(--qvh-surface-50); }
.qvh-table__row.is-open { background: var(--qvh-brand-50); }

/* ==========================================================================
   13. FALLBACKS & REDUCED MOTION
   ========================================================================== */

/* gap fallback: older WebKit/Flex without gap → child margins */
@supports not (gap: 1px) {
  .qvh-card__body > * + * { margin-top: var(--qvh-sp-2); }
  .qvh-filter__body > * + * { margin-top: var(--qvh-sp-4); }
  .qvh-hscroll__track > * + * { margin-left: var(--qvh-sp-4); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .qvh-ui *, .qvh-ui *::before, .qvh-ui *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}
