:root {
    --brand: #1a56db;
    --brand-600: #1341b0;
    --brand-50: #e8f0fd;
    --accent: #0ea5e9;
    --success: #059669;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --page-bg: #f1f5f9;
    --line: #e2e8f0;
    --border-strong: #cbd5e1;
    --ink: #0f172a;
    --ink-soft: #475569;
    --ink-mute: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    /* Storefront polish tokens */
    --store-page-bg: #f6f7f9;
    --store-shimmer-base: #eef1f5;
    --store-shimmer-peak: #f6f7f9;
    --fs-h3: 18px;

    /* Z-index scale */
    --z-sticky: 100;
    --z-overlay: 200;
    --z-drawer: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-loading: 9999;

    /* Typography scale */
    --fs-xs: 11px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 16px;
    --fs-lg: 20px;
    --fs-xl: 28px;
    --fs-icon: 48px;   /* empty-state / hero icons */

    /* Font stacks */
    --font-mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;

    /* Font weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Spacing scale */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 12px;
    --sp-lg: 16px;
    --sp-xl: 24px;

    /* Transition scale */
    --dur-fast: 150ms;
    --dur-normal: 250ms;
    --dur-slow: 400ms;

    /* Badge tokens */
    --badge-success-bg: #dcfce7;
    --badge-success-text: #166534;
    --badge-warning-bg: #fef3c7;
    --badge-warning-text: #92400e;
    --badge-error-bg: #fee2e2;
    --badge-error-text: #b91c1c;
    --badge-info-bg: #dbeafe;
    --badge-info-text: #1d4ed8;
    --badge-neutral-bg: #f1f5f9;
    --badge-neutral-text: #475569;

    /* Gradient tokens */
    --gradient-toolbar: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    --gradient-card-img: linear-gradient(135deg, #f0f4ff 0%, #e8f4fe 100%);

    /* Color tokens */
    --color-danger: #ef4444;
    --color-price: #2f4368;

    /* ─────────────────────────────────────────────────────────────
       Legacy aliases (old names → new canonical tokens)
       Preserved so JS code and any stragglers using old names keep
       working. New code SHOULD use the canonical names above.
       See ux-audit/style-tokens.md
       ───────────────────────────────────────────────────────────── */
    --primary: var(--brand);
    --primary-dark: var(--brand-600);
    --primary-light: var(--brand-50);
    --text-1: var(--ink);
    --text-2: var(--ink-soft);
    --text-3: var(--ink-mute);
    --ink-faint: var(--border-strong);
    --border: var(--line);
    --line-soft: var(--page-bg);
    --surface-2: var(--surface-alt);
    --surface-3: var(--page-bg);

    /* Semantic state tokens (alias to badge tokens) */
    --ok: var(--badge-success-bg);
    --ok-text: var(--badge-success-text);
    --warn: var(--badge-warning-bg);
    --warn-text: var(--badge-warning-text);
    --err: var(--badge-error-bg);
    --err-text: var(--badge-error-text);
    --info: var(--badge-info-bg);
    --info-text: var(--badge-info-text);

    /* Missing scale slots */
    --radius-lg: 16px;
    --shadow: var(--shadow-md);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Numeric spacing aliases (--space-N in addition to --sp-*) */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Focus ring (WCAG AA, UX-020) */
    --focus-ring: 2px solid var(--brand);
    --focus-ring-offset: 2px;
  }

  /* ─────────────────────────────────────────────────────────────
     Global visible focus (UX-020). WCAG AA a11y floor.
     !important is intentional: many components use outline:none to
     replace with a box-shadow ring, which works for mouse (:focus)
     but leaves keyboard-only users unseen. This universal rule
     guarantees every keyboard-focused element shows a visible ring.
     Mouse focus is unaffected (uses :focus, not :focus-visible).
     ───────────────────────────────────────────────────────────── */
  *:focus-visible {
    outline: var(--focus-ring) !important;
    outline-offset: var(--focus-ring-offset) !important;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { background: #ffffff; }
  body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--surface-alt); color: var(--ink); min-height: 100vh; line-height: 1.5; }
  /* HEADER */
  header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: var(--z-sticky); box-shadow: var(--shadow-sm); }
  .header-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
  .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
  .logo-icon { width: 36px; height: 36px; background: transparent; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .logo-icon svg { width: 20px; height: 20px; fill: white; }
  .logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: var(--radius); }
  .logo-text { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
  .logo-sub { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-mute); letter-spacing: 0.5px; text-transform: uppercase; }
  .header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
  .header-overflow { position: relative; display: flex; align-items: center; }
  .header-menu-toggle { display: none; }
  .header-menu-panel { display: flex; align-items: center; gap: 12px; }
  .header-search-slot { flex: 1; max-width: 520px; display: flex; }
  .search-wrap { flex: 1; max-width: 520px; position: relative; }
  .search-wrap input { width: 100%; height: 40px; padding: 0 40px 0 42px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); font-size: 14px; color: var(--ink); background: var(--page-bg); outline: none; transition: all .2s; -webkit-text-size-adjust: 100%; }
  .search-wrap input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
  .search-wrap input::placeholder { color: var(--ink-mute); }
  .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-mute); pointer-events: none; }
  .search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--ink-mute); display: none; border: none; background: none; font-size: var(--fs-base); }
  .header-action-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); background: white; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: all .2s; flex-shrink: 0; text-decoration: none; }
  .header-action-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .header-action-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
  .cart-btn { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: var(--brand); color: white; border: none; border-radius: var(--radius-pill); font-size: var(--fs-base); font-weight: 600; cursor: pointer; transition: background .2s; flex-shrink: 0; }
  .cart-btn:hover { background: var(--brand-600); }
  .account-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: var(--fs-base); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, color .2s; flex-shrink: 0; white-space: nowrap; }
  .account-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .account-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .admin-mode .account-btn { display: none; }
  .cart-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; background: var(--color-danger); color: white; border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 700; display: none; align-items: center; justify-content: center; border: 2px solid white; }

  /* LAYOUT */
  .layout { max-width: 1400px; margin: 0 auto; padding: 24px 24px 60px; display: grid; grid-template-columns: 260px 1fr; gap: 24px; }

  /* SIDEBAR */
  .sidebar { display: flex; flex-direction: column; gap: 16px; align-self: start; position: sticky; top: 88px; }
  .filter-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .filter-title { padding: 12px 16px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-mute); border-bottom: 1px solid var(--line); background: var(--page-bg); }
  .cat-list { padding: 6px; }
  .cat-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 500; gap: 8px; user-select: none; }
  .cat-item:hover { background: var(--brand-50); color: var(--brand); }
  .cat-item.active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
  .cat-item .cat-count { font-size: var(--fs-xs); font-weight: 600; background: var(--page-bg); color: var(--ink-mute); padding: 2px 7px; border-radius: var(--radius); flex-shrink: 0; }
  .cat-item.active .cat-count { background: rgba(26,86,219,.12); color: var(--brand); }
  /* Phase 49f: caret for parent categories with subcategories. Tapping
     the parent toggles the expansion without committing a filter. */
  .cat-item-right { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .cat-caret { font-size: 10px; color: var(--ink-mute); transition: transform .18s ease; display: inline-block; }
  .cat-item.is-expanded .cat-caret { transform: rotate(180deg); color: var(--brand); }
  .cat-item.has-subs:hover .cat-caret { color: var(--brand); }
  .subcat-item--all { font-weight: 600; }
  .subcat-item--all:not(.active) { color: var(--ink); }

  /* SUBCATEGORIES */
  .subcat-list { padding: 4px 6px 6px 20px; display: flex; flex-direction: column; gap: 1px; }
  .subcat-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--ink-soft); transition: all .15s; gap: 6px; }
  .subcat-item:hover { background: var(--brand-50); color: var(--brand); }
  .subcat-item.active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
  .subcat-item .subcat-count { font-size: var(--fs-xs); color: var(--ink-mute); background: var(--page-bg); padding: 1px 5px; border-radius: var(--radius-sm); flex-shrink: 0; }
  .subcat-item.active .subcat-count { background: rgba(26,86,219,.1); color: var(--brand); }

  .brand-grid { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
  .brand-chip { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
  .brand-chip:hover { background: var(--page-bg); }
  .brand-chip input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
  .brand-chip .brand-name { font-size: var(--fs-sm); color: var(--ink-soft); cursor: pointer; flex: 1; font-weight: 500; }
  .brand-chip .brand-count { font-size: var(--fs-xs); color: var(--ink-mute); }
  .brand-empty { padding: 12px 10px; font-size: var(--fs-sm); color: var(--ink-mute); }
  .reset-btn { margin: 4px 10px 10px; padding: 8px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all .15s; text-align: center; width: calc(100% - 20px); }
  .reset-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

  /* ── Brand multi-select: inline expand panel ── */
  .brand-multi { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
  .brand-multi-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-1); color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all .15s; width: 100%; text-align: left; }
  .brand-multi-trigger:hover { border-color: var(--brand); color: var(--brand); }
  .brand-multi-trigger.has-selection { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .brand-multi-trigger .brand-multi-trigger-meta { display: flex; align-items: center; gap: 6px; }
  .brand-multi-trigger .brand-multi-badge { background: var(--brand); color: white; font-size: var(--fs-xs); font-weight: 700; padding: 2px 6px; border-radius: var(--radius); min-width: 16px; text-align: center; }
  .brand-multi-trigger .brand-multi-caret { font-size: var(--fs-xs); color: var(--ink-mute); flex-shrink: 0; transition: transform .15s; }
  .brand-multi.is-open .brand-multi-trigger .brand-multi-caret { transform: rotate(180deg); }

  .brand-multi-panel { display: none; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-1); box-shadow: 0 2px 8px rgba(0,0,0,.04); max-height: 360px; overflow: hidden; }
  .brand-multi.is-open .brand-multi-panel { display: flex; }

  .brand-multi-search { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: var(--fs-sm); box-sizing: border-box; }
  .brand-multi-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26,86,219,.15); }

  .brand-multi-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: var(--fs-xs); color: var(--ink-mute); }
  .brand-multi-clear { background: transparent; border: none; color: var(--ink-mute); font-size: var(--fs-xs); cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); font-weight: 600; }
  .brand-multi-clear:hover { color: var(--error); background: rgba(220,38,38,.08); }
  .brand-multi-clear:disabled { opacity: .35; cursor: not-allowed; }

  .brand-multi-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; min-height: 0; padding: 2px; margin: 0 -2px; }
  .brand-multi-list .brand-multi-section-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); padding: 6px 8px 2px; font-weight: 700; }
  .brand-multi-list .brand-multi-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; border: 1px solid transparent; }
  .brand-multi-list .brand-multi-row:hover { background: var(--page-bg); }
  .brand-multi-list .brand-multi-row.is-selected { background: var(--brand-50); border-color: rgba(26,86,219,.18); }
  .brand-multi-list .brand-multi-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; pointer-events: none; }
  .brand-multi-list .brand-multi-row .brand-multi-row-name { flex: 1; font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 500; }
  .brand-multi-list .brand-multi-row.is-selected .brand-multi-row-name { color: var(--brand); font-weight: 700; }
  .brand-multi-list .brand-multi-row .brand-multi-row-count { font-size: var(--fs-xs); color: var(--ink-mute); }
  .brand-multi-list .brand-multi-row.is-selected .brand-multi-row-count { color: var(--brand); }
  .brand-multi-list .brand-multi-empty { padding: 16px 8px; text-align: center; font-size: var(--fs-sm); color: var(--ink-mute); }

  /* ── Pagination component (shared across public/admin/supplier) ── */
  .pagination-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 8px; flex-wrap: wrap; }
  .pagination-info { font-size: var(--fs-sm); color: var(--ink-mute); margin-right: 12px; }
  .pagination-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-1); color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; justify-content: center; }
  .pagination-btn:hover:not(:disabled):not(.active) { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
  .pagination-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
  .pagination-btn.ellipsis { border: none; background: transparent; cursor: default; color: var(--ink-mute); }
  .pagination-page-input { width: 60px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: var(--fs-sm); text-align: center; }

  /* MAIN */
  .main { min-width: 0; }
  .admin-toolbar { display: none; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 14px 16px; background: var(--gradient-toolbar); border: 1px solid rgba(26,86,219,.15); border-radius: var(--radius); }
  .admin-toolbar-info { display: flex; flex-direction: column; gap: 4px; }
  .admin-toolbar-title { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); }
  .admin-toolbar-text { font-size: var(--fs-sm); color: var(--ink-soft); }
  .admin-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .admin-mode .admin-toolbar { display: flex; }
  .results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
  .results-count { font-size: var(--fs-base); color: var(--ink-soft); }
  .results-count strong { color: var(--ink); font-weight: 700; }
  .active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .filter-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--brand-50); color: var(--brand); border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 600; }
  .filter-clear-btn { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); background: white; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: all .15s; }
  .filter-clear-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .admin-image-mode { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
  .admin-image-mode-btn {
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
  }
  .admin-image-mode-btn:hover { border-color: var(--brand); color: var(--brand); }
  .admin-image-mode-btn.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
  .admin-image-variant-picker { display: none; margin-top: 10px; }
  .admin-image-variant-picker.visible { display: block; }
  .admin-image-variant-picker label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--ink-soft);
  }
  .admin-image-variant-picker select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    color: var(--ink);
    background: var(--surface);
    outline: none;
  }
  .admin-image-variant-picker select:focus { border-color: var(--brand); }

  /* PRODUCT GRID */
  .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; scroll-margin-top: 96px; }

  /* CARD FLIP */
  .card-wrapper { perspective: 1000px; height: 480px; }
  .card-inner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.4,0,.2,1); transform-style: preserve-3d; }
  .card-wrapper.flipped .card-inner { transform: rotateY(180deg); }
  .card-front, .card-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
  .card-front { transform: rotateY(0deg) translateZ(1px); }
  .card-back { transform: rotateY(180deg) translateZ(1px); }
  .card-wrapper:hover .card-front { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

  /* CARD FRONT */
  .card-img { height: 150px; background: var(--gradient-card-img); display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; overflow: hidden; }
  .card-img-media { width: 100%; height: 100%; }
  .card-img-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .flip-btn { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: all .15s; color: var(--ink-mute); font-size: var(--fs-sm); }
  .flip-btn:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand); }
  .admin-edit-btn { position: absolute; top: 10px; right: 44px; width: 28px; height: 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius-sm); display: none; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: all .15s; color: var(--ink-mute); font-size: var(--fs-sm); }
  .admin-edit-btn:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand); }
  .admin-mode .admin-edit-btn { display: flex; }

  .card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
  .card-category { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; }
  /* UX-097 (phase 66): 13.5px half-pixel → var(--fs-base) (14px, canonical).
     Half-pixels render inconsistently across devices (DPR rounding). */
  .card-name { font-size: var(--fs-base); font-weight: 700; color: var(--ink); line-height: 1.3; }
  .card-supplier { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
  .card-supplier span { font-weight: 600; color: var(--ink-soft); }
  .card-pack { font-size: var(--fs-xs); color: var(--ink-mute); }

  /* PRICE */
  .price-block { margin-top: 6px; }
  .price-kicker { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; }
  .price-line { margin-top: 4px; font-size: var(--fs-lg); line-height: 1.15; font-weight: 900; color: var(--color-price); letter-spacing: -0.3px; }
  .price-line .price-vat-inline { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }
  /* Phase 79b (Cezar 2026-04-26): root cause — generated class names use
     diacritics-fold („În stoc" → „in-stoc", fără k), dar CSS-ul vechi avea
     `.availability-in-stock`. Mismatch → fallback la transparent/negru.
     Acum: fundal alb opac default + culori per status, mapped pe clasele
     REAL generate de getAvailabilityClass() (vezi marketplace-v2.js:531).
     Inventory-* clases (modul Automat) folosesc același sistem. */
  .availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .2px;
    width: fit-content;
    background: white;
    color: var(--ink-soft);
    border: 1px solid var(--line);
  }
  .availability-badge::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }
  .card-stock-badge { position: absolute; top: 10px; left: 10px; z-index: 2; box-shadow: var(--shadow-sm); }

  /* Status palette — fundal alb, culoare pe text + bullet. WCAG AA pe alb:
     verde #15803d (4.78:1), portocaliu #b45309 (4.55:1),
     albastru #1d4ed8 (8.25:1), roșu #b91c1c (5.94:1), gri #475569 (8.41:1). */
  .inventory-ok,
  .availability-in-stoc { color: #15803d; border-color: #bbf7d0; }
  .inventory-low,
  .availability-stoc-limitat { color: #b45309; border-color: #fed7aa; }
  .inventory-empty,
  .availability-epuizat,
  .availability-indisponibil,
  .availability-stoc-epuizat { color: #b91c1c; border-color: #fecaca; }
  .availability-in-stoc-furnizor,
  .availability-stock-furnizor { color: #1d4ed8; border-color: #bfdbfe; }
  .availability-automat { color: #475569; border-color: #cbd5e1; }

  /* VARIANTS */
  .variants-section { margin-top: 4px; }
  .variants-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
  .brand-selector { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
  .brand-opt { padding: 3px 9px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-lg); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-soft); cursor: pointer; transition: all .15s; background: transparent; }
  .brand-opt:hover { border-color: var(--brand); color: var(--brand); }
  .brand-opt.active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
  .brand-opt.single { cursor: default; }
  .brand-opt.single:hover { border-color: var(--brand); color: var(--brand); }
  .variant-pills { display: flex; flex-wrap: wrap; gap: 4px; }
  .variant-pill { padding: 3px 8px; border: 1.5px solid var(--line); border-radius: 5px; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: all .15s; background: transparent; white-space: nowrap; }
  /* UX-022: hover uses --brand (5.17:1) not --accent (2.77:1 FAIL on white) */
  .variant-pill:hover { border-color: var(--brand); color: var(--brand); }
  .variant-pill.active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); font-weight: 700; }
  .variant-pill.single { cursor: default; }
  .variant-pill.single:hover { border-color: var(--brand); color: var(--brand); }

  /* CARD FOOTER */
  .card-footer { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .qty-ctrl { display: flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
  .qty-btn { width: 28px; height: 28px; border: none; background: var(--page-bg); color: var(--ink-soft); font-size: var(--fs-md); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; font-weight: 600; }
  .qty-btn:hover { background: var(--line); }
  .qty-input { width: 32px; height: 28px; border: none; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); text-align: center; font-size: 12px; font-weight: 700; color: var(--ink); background: white; outline: none; -webkit-text-size-adjust: 100%; }
  .qty-input { appearance: textfield; -moz-appearance: textfield; }
  .qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .add-btn { flex: 1; padding: 7px 10px; background: var(--brand); color: white; border: none; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 5px; }
  .add-btn:hover { background: var(--brand-600); }
  .add-btn:active { transform: scale(.96); }
  .add-btn--disabled, .add-btn[disabled] { background: var(--line); color: var(--ink-soft); cursor: not-allowed; opacity: .75; }
  .add-btn--disabled:hover, .add-btn[disabled]:hover { background: var(--line); }
  .variant-pill.unavailable { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

  /* CARD BACK */
  .card-back-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
  .card-back-title { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); }
  .flip-back-btn { background: var(--page-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all .15s; }
  .flip-back-btn:hover { border-color: var(--brand); color: var(--brand); }
  .card-back-body { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
  .card-back-body.empty { padding: 0; background: white; }
  .card-back-body.filled { padding: 18px; background: white; }
  .detail-content { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.7; white-space: pre-wrap; }
  .detail-group { display: flex; flex-direction: column; gap: 4px; }
  .detail-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); }
  .detail-info { display: flex; gap: 8px; flex-wrap: wrap; }
  .detail-tag { font-size: var(--fs-xs); background: var(--brand-50); color: var(--brand); border-radius: var(--radius-sm); padding: 2px 7px; font-weight: 600; }
  .detail-summary { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.6; }
  .detail-list { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
  .detail-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .detail-row:last-child { border-bottom: none; padding-bottom: 0; }
  .detail-key { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; }
  .detail-value { font-size: var(--fs-sm); color: var(--ink); text-align: right; }

  /* EMPTY */
  .empty-state { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--ink-mute); }
  .empty-state svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: .3; }
  .empty-state h3 { font-size: var(--fs-lg); color: var(--ink-soft); margin-bottom: 6px; }

  /* CART DRAWER */
  .overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: var(--z-overlay); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .overlay.open { opacity: 1; pointer-events: all; }
  .cart-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 440px; background: var(--surface); box-shadow: var(--shadow-lg); z-index: var(--z-drawer); transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; overflow: hidden; }
  .cart-drawer.open { transform: translateX(0); }
  .drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
  .drawer-title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
  /* UX-086 (phase 66): 44×44 tap target (WCAG 2.5.5). */
  .drawer-close { min-width: 44px; min-height: 44px; border: none; background: var(--page-bg); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: var(--fs-md); transition: background .15s; }
  .drawer-close:hover { background: var(--line); }
  /* Phase 77 (Cezar 2026-04-26): cart-auth banner — discret deasupra
     drawer-items. Loggedin = albastru subtil; Guest = galben cu CTA mai
     vizibil. Layout flex pentru text + link inline. */
  .cart-auth-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); flex-shrink: 0; }
  .cart-auth-banner--loggedin { background: var(--brand-50, var(--page-bg)); color: var(--ink-soft); }
  .cart-auth-banner--guest { background: var(--warn-bg); color: var(--ink); }
  .cart-auth-banner-text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
  .cart-auth-banner-link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; flex-shrink: 0; }
  .cart-auth-banner-link:hover { color: var(--brand-700, var(--brand)); }
  .drawer-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; }
  /* Children of the scrolling flex column MUST NOT shrink — without this
     `.cart-supplier-group` defaults to `flex-shrink:1` and flex compresses
     10+ items into the visible space instead of triggering overflow scroll.
     This was the real reason scroll never worked: scrollHeight === clientHeight. */
  .drawer-items > * { flex: 0 0 auto; }
  .drawer-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-mute); gap: 10px; text-align: center; }
  .drawer-empty svg { width: 48px; height: 48px; opacity: .25; }
  .drawer-empty p { font-size: var(--fs-sm); }
  /* UX-098 (phase 66): helper note shown above multi-supplier split. */
  .cart-multi-supplier-note {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.45;
  }
  .cart-supplier-group { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
  .cart-supplier-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 14px 14px 10px; background: var(--page-bg); border-bottom: 1px solid var(--line); }
  .cart-supplier-label { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); }
  .cart-supplier-name { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); margin-top: 2px; }
  .cart-supplier-meta { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
  .cart-supplier-total { font-size: var(--fs-sm); font-weight: 800; color: var(--brand); white-space: nowrap; }

  /* Phase 80 — Shipping progress („Adaugă X RON de la <Furnizor> pentru
     transport gratuit"). Compact 2 rânduri (mesaj + bar). Font normal
     --fs-sm (13px) ca să fie citibil fără să devină voluminos. */
  .cart-shipping-slot:empty { display: none; }
  .cart-shipping-progress {
    margin: 8px 14px 4px;
    padding: 8px 12px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
  }
  .cart-shipping-progress--free {
    background: var(--success-50);
    color: var(--success-700);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
  }
  .cart-shipping-icon { flex-shrink: 0; }
  .cart-shipping-message { color: var(--ink); line-height: 1.4; }
  /* Phase 80f: semibold (600) în loc de bold (700) — mai elegant, mai puțin
     agresiv vizual când se folosește pentru un singur cuvânt-cheie. */
  .cart-shipping-message strong {
    color: var(--brand);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .cart-shipping-bar {
    margin-top: 4px;
    height: 4px;
    background: var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .cart-shipping-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
    border-radius: var(--radius-sm);
    transition: width 400ms ease;
  }

  .cart-item { background: var(--page-bg); border-radius: var(--radius-sm); padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
  .cart-supplier-group .cart-item { background: transparent; border-radius: 0; }
  .cart-supplier-group .cart-item + .cart-item { border-top: 1px solid var(--line); }
  .cart-item-num { flex-shrink: 0; min-width: 22px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-mute); line-height: 1.3; padding-top: 1px; font-variant-numeric: tabular-nums; }
  .cart-item-info { flex: 1; min-width: 0; }
  .cart-item-name { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
  .cart-item-meta { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
  .cart-item-price { font-size: var(--fs-xs); color: var(--brand); font-weight: 700; margin-top: 2px; }
  .cart-item-qty { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
  .cart-qty-btn { width: 22px; height: 22px; border: 1.5px solid var(--border-strong); border-radius: 5px; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-soft); transition: all .15s; }
  .cart-qty-btn:hover { border-color: var(--brand); color: var(--brand); }
  .cart-qty-val { font-size: var(--fs-sm); font-weight: 700; min-width: 18px; text-align: center; }
  .cart-item-remove { background: none; border: none; cursor: pointer; color: var(--ink-mute); font-size: var(--fs-md); padding: 2px; transition: color .15s; margin-top: 1px; }
  .cart-item-remove:hover { color: #ef4444; }

  /* CART TOTAL */
  .cart-total-row { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--page-bg); flex-shrink: 0; }
  .total-line { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 4px; }
  .total-line.main { font-size: var(--fs-md); font-weight: 800; color: var(--ink); margin-bottom: 0; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
  .total-line span:last-child { font-weight: 700; }
  .total-note { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 4px; }
  .total-note.strong { font-size: 10.5px; color: var(--ink-soft); }

  /* DRAWER FOOTER */
  .drawer-footer { padding: 16px 20px; border-top: 1px solid var(--line); flex-shrink: 0; }
  .order-btn { width: 100%; padding: 13px; background: var(--brand); color: white; border: none; border-radius: var(--radius); font-size: var(--fs-base); font-weight: 800; cursor: pointer; transition: background .2s; letter-spacing: 0.2px; }
  .order-btn:hover { background: var(--brand-600); }
  .order-btn:disabled,
  .order-btn[aria-disabled="true"] { background: var(--border-strong); color: var(--ink-mute); cursor: not-allowed; pointer-events: none; }
  .cart-empty-hint { display: none; font-size: var(--fs-xs); color: var(--ink-mute); text-align: center; margin-top: var(--space-2); }
  .cart-empty-hint.is-visible { display: block; }

  /* ORDER MODAL */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; padding: 20px; }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
  .modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; border-radius: var(--radius-lg) 16px 0 0; }
  .modal-title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
  .modal-close { width: 32px; height: 32px; border: none; background: var(--page-bg); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-md); color: var(--ink-soft); transition: background .15s; }
  .modal-close:hover { background: var(--line); }
  .modal-body { padding: 20px 24px; }
  .form-section { margin-bottom: 20px; }
  .form-section-title { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .form-row { display: grid; gap: 12px; margin-bottom: 12px; }
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-group label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
  .form-group input, .form-group select, .form-group textarea { width: 100%; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--ink); outline: none; transition: border-color .15s; font-family: inherit; background: white; }
  .form-group input, .form-group select { height: 40px; padding: 0 12px; }
  .form-group textarea { min-height: 120px; padding: 10px 12px; resize: vertical; }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
  .form-group input::placeholder, .form-group textarea::placeholder { color: var(--ink-mute); }
  .checkbox-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--page-bg); border-radius: var(--radius-sm); cursor: pointer; border: 1.5px solid var(--line); transition: border-color .15s; margin-bottom: 14px; }
  .checkbox-row:hover { border-color: var(--brand-50); }
  .checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
  .checkbox-row label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); cursor: pointer; flex: 1; }
  .delivery-section { background: var(--brand-50); border: 1.5px solid rgba(26,86,219,.2); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: none; }
  .delivery-section.visible { display: block; }
  .delivery-section .form-section-title { color: var(--brand); border-bottom-color: rgba(26,86,219,.2); }
  .modal-footer { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: white; border-radius: 0 0 16px 16px; }
  .btn-secondary { padding: 10px 20px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: all .15s; }
  .btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
  .btn-primary { padding: 10px 24px; background: var(--brand); color: white; border: none; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 800; cursor: pointer; transition: background .2s; }
  .btn-primary:hover { background: var(--brand-600); }

  /* SUCCESS */
  .success-modal { text-align: center; padding: 40px 24px; }
  .success-icon { width: 64px; height: 64px; background: #d1fae5; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
  .success-icon svg { width: 32px; height: 32px; }
  .success-modal h2 { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); margin-bottom: 8px; }
  .success-modal p { font-size: var(--fs-base); color: var(--ink-soft); }
  .success-order-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
  .success-order-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--page-bg); border: 1px solid var(--line); }
  .success-order-supplier { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; }
  .success-order-number { font-size: var(--fs-base); font-weight: 800; color: var(--ink); margin-top: 2px; }
  .success-order-total { font-size: var(--fs-sm); font-weight: 800; color: var(--brand); white-space: nowrap; }

  /* ADMIN */
  .admin-note { margin-bottom: 16px; padding: 12px 14px; background: var(--page-bg); border-radius: var(--radius); font-size: var(--fs-sm); color: var(--ink-soft); }
  .admin-brand-panel { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page-bg); display: flex; flex-direction: column; gap: 12px; }
  .admin-brand-head { display: flex; flex-direction: column; gap: 4px; }
  .admin-brand-title { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); }
  .admin-brand-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  .admin-brand-tab { padding: 7px 12px; border: 1.5px solid var(--border-strong); border-radius: 999px; background: white; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: all .15s; }
  .admin-brand-tab:hover { border-color: var(--brand); color: var(--brand); }
  .admin-brand-tab.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
  .admin-brand-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
  .admin-grid { display: grid; grid-template-columns: 1.18fr .98fr; gap: 18px; }
  .admin-modal .modal-body { padding-bottom: 12px; }
  .admin-delete-btn { margin-right: auto; border-color: #fecaca; color: #b91c1c; }
  .admin-delete-btn:hover { border-color: #ef4444; color: #b91c1c; background: #fef2f2; }
  .archive-note { margin-bottom: 14px; padding: 12px 14px; background: var(--page-bg); border-radius: var(--radius); font-size: var(--fs-sm); color: var(--ink-soft); }
  .admin-icon-preview { min-height: 160px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%); display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
  .admin-icon-preview img { width: 100%; height: 100%; min-height: 134px; object-fit: cover; border-radius: var(--radius); display: block; }
  .admin-image-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
  .admin-helper { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 4px; }
  .admin-mode .cart-btn { display: none; }
  .admin-mode .qty-ctrl,
  .admin-mode .add-btn { display: none; }
  .admin-mode .card-footer { justify-content: flex-end; min-height: 48px; }
  .admin-hidden { display: none !important; }

  /* TOAST */
  .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #0f172a; color: white; padding: 11px 18px; border-radius: var(--radius); font-size: var(--fs-sm); font-weight: 600; z-index: var(--z-toast); opacity: 0; transition: all .3s cubic-bezier(.4,0,.2,1); white-space: nowrap; }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* FILTER TOGGLE BUTTON — ascuns pe desktop */
  .filter-toggle-btn { display: none; }

  /* SIDEBAR HEADER — ascuns pe desktop */
  .sidebar-header { display: none; }
  .sidebar-search-slot { display: none; }

  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; padding: 14px; }
    input, select, textarea { font-size: var(--fs-md); }
    .flip-btn,
    .admin-edit-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .qty-btn { width: 44px; height: 44px; }
    .cart-qty-btn { width: 36px; height: 36px; font-size: var(--fs-md); }
    .overlay {
      background: transparent;
      transition: opacity .2s;
    }
    /* MAJOR rewrite (2026-04-17): unified bottom-sheet for cart on mobile.
       The sheet is a flex column with three regions — header / scrolling
       body / fixed footer-block (totals + CTA).
       Scroll lives ONLY on .drawer-items. No position:sticky tricks:
       flex-shrink:0 on siblings already pins them naturally. */
    .cart-drawer {
      position: fixed;
      top: 0; right: 0; bottom: 0; left: 0;
      width: 100%;
      max-width: 100vw;
      /* Phase 83: removed height/max-height:100dvh — same Safari toolbar
         gap issue as filter sidebar. inset:0 handles full coverage. */
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transform: translateY(100%);
      transition: transform .28s cubic-bezier(.4,0,.2,1);
      box-shadow: none;
    }
    .cart-drawer.open { transform: translateY(0); }
    .cart-drawer .drawer-header { flex: 0 0 auto; }
    .cart-drawer .drawer-items {
      flex: 1 1 auto;
      min-height: 0;                    /* critical: let flex child shrink */
      max-height: none;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }
    .cart-drawer .cart-total-row,
    .cart-drawer .drawer-footer {
      flex: 0 0 auto;
      position: static;                 /* kill legacy sticky hack */
    }
    .cart-drawer .drawer-footer {
      padding-bottom: max(var(--space-4, 16px), env(safe-area-inset-bottom));
    }
    .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
    /* Phase 83b: flip-card stays functional on mobile, but front face
       drives the card height (position:relative) so there's no fixed
       min-height gap. Back face overlays via position:absolute.
       Flip still works — tap (i) to see product details on back. */
    .card-wrapper { height: auto; min-height: 0; }
    .card-inner { height: auto; }
    .card-front { position: relative; inset: auto; }
    .card-back { position: absolute; inset: 0; }
    .card-body { flex: 0 1 auto; }
    /* UX-081 (phase 65): on mobile, header becomes 2 rows — logo + actions
       on the first row, full-width search on the second row. Previously
       .header-search-slot was display:none which broke J-pub-find-product
       (mobile users had no way to search without opening the filter drawer
       first, which didn't even contain a search field). */
    .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 12px; }
    .logo { min-width: 0; gap: 8px; }
    .logo-icon { width: 32px; height: 32px; border-radius: 9px; }
    .logo-icon svg { width: 18px; height: 18px; }
    .logo-text { font-size: var(--fs-md); }
    /* Phase 84 (Cezar 2026-04-30): hide logo-sub on mobile — too cluttered next to icons. */
    .logo-sub { display: none; }
    .header-actions { gap: 6px; margin-left: 0; justify-self: end; }
    /* Mobile hamburger overflow menu was retired; keep a defensive hide
       in case the element is reintroduced somewhere. */
    .header-overflow { display: none; }
    /* UX-081 (phase 65): search visible on mobile, spans both grid columns
       as the second row of the header. */
    .header-search-slot {
      display: flex;
      grid-column: 1 / -1;
      order: 3;
      width: 100%;
      max-width: none;
    }
    .search-wrap { width: 100%; max-width: none; }
    .search-wrap input { font-size: var(--fs-md); }
    .admin-toolbar { align-items: flex-start; }
    .admin-brand-add { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
    .qty-ctrl { border-radius: var(--radius); }
    /* UX-086 (phase 66): ensure 44×44 tap target (WCAG 2.5.5). Line 566
       already sets 44×44 but this later rule was overriding it back to 34px. */
    .qty-btn { width: 44px; height: 44px; font-size: var(--fs-lg); }
    .qty-input { width: 44px; height: 44px; font-size: var(--fs-md); }
    .form-group input, .form-group select, .form-group textarea { font-size: var(--fs-md); }
    .form-group input, .form-group select { height: 44px; }

    /* Buton Filtre vizibil pe mobil */
    .filter-toggle-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      background: var(--surface);
      border: 1.5px solid var(--border-strong);
      border-radius: 999px;
      font-size: var(--fs-sm);
      font-weight: 600;
      color: var(--ink-soft);
      cursor: pointer;
      flex-shrink: 0;
      transition: all .15s;
    }
    .filter-toggle-btn:hover { border-color: var(--brand); color: var(--brand); }
    .filter-toggle-btn.active { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
    /* Phase 83c: icon-only buttons on mobile — hide text labels, keep
       44×44 tap targets (WCAG 2.5.5). aria-label provides accessibility. */
    .filter-toggle-btn .btn-label,
    .cart-btn .btn-label { display: none; }
    .filter-toggle-btn,
    .cart-btn { min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; }
    .filter-toggle-btn svg,
    .cart-btn svg { width: 18px; height: 18px; }
    .account-btn { min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; }
    .account-btn .account-btn-label { display: none; }

    /* MAJOR rewrite (2026-04-17): filter sidebar on mobile is a left-slide
       sheet built as a flex column. Scroll lives on .sidebar-body — the
       .sidebar itself is overflow:hidden so header stays fixed naturally
       via flex:0 0 auto (no position:sticky inside a non-scrolling
       container). All brands + categories are reachable by scrolling. */
    .sidebar {
      position: fixed;
      top: 0; bottom: 0; left: 0;
      width: 300px;
      max-width: 85vw;
      /* Phase 83: use 100% height — resolves to the viewport for fixed
         elements, and works correctly even when body is position:fixed
         (which can confuse top:0+bottom:0 auto-height in some engines). */
      height: 100%;
      align-self: stretch;               /* override desktop align-self:start */
      background: var(--surface);
      z-index: var(--z-drawer);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
      transform: translateX(-100%);
      transition: transform .28s cubic-bezier(.4,0,.2,1);
      box-shadow: none;
      visibility: hidden;                /* out of tab-order while closed */
    }
    .sidebar.open {
      transform: translateX(0);
      visibility: visible;
      box-shadow: var(--shadow-lg);
    }
    .sidebar-header {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 16px;
      border-bottom: 1px solid var(--line);
      font-size: var(--fs-md);
      font-weight: 700;
      color: var(--ink);
      background: var(--surface);
    }
    .sidebar-body {
      flex: 1 1 auto;
      min-height: 0;                     /* critical for flex+overflow */
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    }
    .filter-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.48);
      z-index: 299;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s;
    }
    .filter-overlay.visible { opacity: 1; pointer-events: all; }
    .sidebar-search-slot {
      display: block;
      padding: 14px 16px 12px;
      border-bottom: 1px solid var(--line);
      background: var(--surface);
    }
    .sidebar-search-slot:empty { display: none; padding: 0; border-bottom: none; }
    .sidebar-search-slot .search-wrap { flex: none; max-width: none; }
    .sidebar-close-btn {
      /* UX-086 (phase 66): 44×44 tap target (WCAG 2.5.5). */
      background: none; border: none;
      font-size: var(--fs-lg); cursor: pointer;
      color: var(--ink-soft);
      min-width: 44px; min-height: 44px;
      display: inline-flex; align-items: center; justify-content: center;
      border-radius: var(--radius-sm);
      line-height: 1;
    }
    .sidebar-close-btn:hover { background: var(--page-bg); }
    .sidebar .filter-card { border-radius: 0; border: none; border-bottom: 1px solid var(--line); box-shadow: none; }
  }

  /* Desktop — .sidebar-body is transparent; no flex column constraints. */
  @media (min-width: 901px) {
    .sidebar-body { display: contents; }
  }

/* ═══════════════════════════════════════════════════════
   Shared dashboard shell (supplier + admin pages)
   ═══════════════════════════════════════════════════════ */

/* Tabs */
.sp-tabs {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; padding: 0 24px; gap: 2px; overflow-x: auto;
}
.sp-tab {
  padding: 10px 16px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-soft);
  border: none; background: none; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.sp-tab:hover { color: var(--ink); }
/* UX-022: use --brand (5.17:1 on white) instead of --accent (2.77:1 FAIL) */
.sp-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.sp-panel { display: none; padding: 24px; min-height: calc(100vh - 120px); }
.sp-panel.active { display: block; }
.sp-panel.sp-catalog-panel { padding: 0; }
.sp-catalog-panel .layout { min-height: calc(100vh - 120px); }

/* Overview stats */
.sp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.sp-stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.sp-stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.sp-stat-value { font-size: var(--fs-xl); font-weight: 800; color: var(--ink); }
.sp-stat-sub { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }

/* Section titles + toolbar */
.sp-section-title { font-size: var(--fs-md); font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.sp-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.sp-toolbar input, .sp-toolbar select {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); background: var(--surface); color: var(--ink); outline: none;
}
.sp-toolbar input { flex: 1; min-width: 180px; }
.sp-toolbar input:focus, .sp-toolbar select:focus { border-color: var(--accent); }
.sp-toolbar-spacer { flex: 1; }

/* Table */
.sp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sp-table th { padding: 10px 14px; text-align: left; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.sp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.sp-table tr:last-child td { border-bottom: none; }
.sp-table tr.clickable { cursor: pointer; }
.sp-table tr.clickable:hover td { background: var(--surface-alt); }
.sp-empty { padding: 48px 24px; text-align: center; color: var(--ink-mute); font-size: var(--fs-sm); }

/* Status badges */
.sp-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-lg); font-size: var(--fs-xs); font-weight: 600; }
.sp-badge.noua         { background: #eff6ff; color: #1d4ed8; }
.sp-badge.confirmata   { background: #f0fdf4; color: #15803d; }
.sp-badge.in_livrare   { background: #fff7ed; color: #c2410c; }
.sp-badge.livrata      { background: #f0fdf4; color: #15803d; }
.sp-badge.anulata      { background: #fef2f2; color: #b91c1c; }
.sp-badge.active       { background: #f0fdf4; color: #15803d; }
.sp-badge.paused       { background: #fff7ed; color: #c2410c; }
.sp-badge.archived     { background: #f1f5f9; color: #64748b; }

/* Order/item detail drawer */
.sp-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: var(--z-modal); display: none; }
.sp-drawer-overlay.open { display: block; }
.sp-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg, -4px 0 24px rgba(0,0,0,.12)); z-index: calc(var(--z-modal) + 1); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.sp-drawer-overlay.open .sp-drawer { transform: none; }
.sp-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sp-drawer-head-title { font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.sp-drawer-close { background: none; border: none; cursor: pointer; font-size: var(--fs-lg); color: var(--ink-mute); padding: 4px; }
.sp-drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.sp-drawer-section-title { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.sp-drawer-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: 4px 0; }
.sp-drawer-row span:first-child { color: var(--ink-mute); flex-shrink: 0; }
.sp-drawer-row span:last-child  { color: var(--ink); font-weight: 500; text-align: right; max-width: 65%; word-break: break-word; }
.sp-drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.sp-drawer-foot select { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: var(--fs-sm); background: var(--surface); color: var(--ink); }
.sp-drawer-foot select:focus { outline: none; border-color: var(--accent); }

/* Commission ledger */
.sp-ledger-summary { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sp-ledger-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; flex: 1; min-width: 140px; }
.sp-ledger-kpi-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; }
.sp-ledger-kpi-value { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); margin-top: 4px; }

/* Form layout for supplier/profile forms */
.sp-form { display: flex; flex-direction: column; gap: 16px; }
.sp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sp-form-row.full { grid-template-columns: 1fr; }
.sp-form label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.sp-form input, .sp-form textarea, .sp-form select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-family: inherit; background: var(--surface); color: var(--ink);
  box-sizing: border-box; outline: none;
}
.sp-form input:focus, .sp-form textarea:focus, .sp-form select:focus { border-color: var(--accent); }
.sp-form input[readonly] { background: var(--surface-alt); color: var(--ink-mute); cursor: default; }
.sp-form textarea { resize: vertical; min-height: 72px; }
.sp-form-note { font-size: var(--fs-xs); color: var(--ink-mute); }

/* Auth gate */
.sp-auth-gate { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 16px; }
.sp-auth-gate p { font-size: var(--fs-base); color: var(--ink-soft); }

/* Loading placeholder */
.sp-loading { color: var(--ink-mute); font-size: var(--fs-sm); padding: 32px 0; text-align: center; }

/* Admin tab bar (uses primary color instead of accent) */
.ad-tabs {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; padding: 0 24px; gap: 2px; overflow-x: auto;
  position: sticky; top: 64px; z-index: 90;
}
.ad-tab {
  padding: 10px 16px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-soft);
  border: none; background: none; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.ad-tab:hover { color: var(--ink); }
.ad-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.ad-panel { display: none; }
.ad-panel.active { display: block; }
.ad-panel:not(.ad-catalog-panel).active { padding: 24px; max-width: 1300px; margin: 0 auto; min-height: calc(100vh - 120px); }
.ad-catalog-panel.active { display: block; }

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sp-panel { padding: 16px; }
  .sp-form-row { grid-template-columns: 1fr; }
  .sp-stats { grid-template-columns: 1fr 1fr; }
  .ad-panel:not(.ad-catalog-panel).active { padding: 16px; }
  .modal { max-width: calc(100vw - 24px); max-height: 92vh; overflow-y: auto; }
}

/* UX-006 retired (2026-04-17): the position:sticky hack on cart-total-row
   and drawer-footer was causing iOS Safari to miscompute the drawer-items
   scrolling viewport. The mobile cart block in @media (max-width: 900px)
   above now handles pinning via flex:0 0 auto on siblings of the
   scrolling body — the layout everyone else uses. */

/* Body scroll lock while any storefront drawer is open.
   Replaces the JS touchmove-preventDefault handler that was itself
   interfering with the drawer-items scrolling logic.
   Applies at all viewports — filter sidebar only adds `drawer-open`
   on mobile (≤900px), cart drawer always sets it. So this rule locks
   body whenever either is actively open. */
/* Phase 83: lock scroll on both html+body to prevent Safari iOS
   rubber-band bounce that reveals a grey zone behind drawers.
   html overflow:hidden is needed because iOS Safari ignores body-only. */
html.drawer-open,
body.drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body.drawer-open {
  /* Phase 83: position:fixed prevents iOS scroll-through entirely.
     Scroll position is saved/restored in JS (_lockBodyScroll). */
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

/* UX-042 — Responsive data tables: stack rows as cards on ≤640px.
   Each <tr> becomes a card, each <td> stacks label:value via ::before.
   The render code must add class="data-table-card" to the table and
   data-label="…" to every <td>. Action cells use class="actions-cell". */
@media (max-width: 640px) {
  .data-table-card thead { display: none; }
  .data-table-card,
  .data-table-card tbody,
  .data-table-card tr,
  .data-table-card td { display: block; width: 100%; }
  .data-table-card tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .data-table-card td {
    border: none;
    padding: var(--space-1) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    min-height: 32px;
    text-align: left;
  }
  .data-table-card td::before {
    content: attr(data-label);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .data-table-card td[data-label=""]::before { content: none; }
  .data-table-card td.actions-cell {
    justify-content: flex-end;
    padding-top: var(--space-2);
    margin-top: var(--space-2);
    border-top: 1px solid var(--line-soft);
  }
  .data-table-card td.actions-cell::before { display: none; }
  /* Remove the horizontal-scroll wrapper padding when stacked */
  .sp-table-wrap { overflow: visible; }
}


/* ── Skip link (P-0024) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-loading);
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ── Accessibility: visually hidden utility (P-0026) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Disabled states (P-0039) ── */
.btn-secondary:disabled,
.btn-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.header-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-alt);
  color: var(--ink-mute);
  cursor: not-allowed;
  opacity: 0.7;
}

/* ── Small phone breakpoints (P-0043) ── */
@media (max-width: 375px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .header { padding: 8px 12px; }
  .main { padding: 10px 12px 80px; }
}

/* ── Transition tokens reference (P-0038):
   .15s == var(--dur-fast)   |   .25s == var(--dur-normal)   |   .4s == var(--dur-slow)
   Existing transitions are kept as literals; use tokens in new rules.
── */

/* ── UX-038: Unified DelphiDateSelector ────────────────────────────────── */
.delphi-date-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.delphi-date-selector__selects {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.delphi-date-selector__select {
  font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-height: 36px;
}
.delphi-date-selector__select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.delphi-date-selector__select:disabled {
  color: var(--ink-faint);
  background: var(--surface-alt);
  cursor: not-allowed;
}
.delphi-date-selector__presets {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.delphi-date-selector__preset {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  min-height: 36px;
}
.delphi-date-selector__preset:last-child { border-right: 0; }
.delphi-date-selector__preset:hover { background: var(--surface-alt); color: var(--ink); }
.delphi-date-selector__preset:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.delphi-date-selector__preset.is-active {
  background: var(--brand);
  color: white;
}

/* UX-007 — Account drawer */
.account-btn { gap: 6px; }
.account-drawer { z-index: var(--z-drawer); }
.account-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.account-drawer-empty { padding: 40px 16px; text-align: center; color: var(--ink-mute); font-size: var(--fs-sm); }
.account-orders-list { display: flex; flex-direction: column; gap: 8px; }
.account-order-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; font: inherit; color: inherit; }
.account-order-row:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.account-order-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.account-order-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-order-number { font-weight: 700; color: var(--ink); font-size: var(--fs-sm); }
.account-order-badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-soft); font-size: var(--fs-xs); font-weight: 600; }
.account-order-meta { color: var(--ink-mute); font-size: var(--fs-xs); }
.account-back-btn { align-self: flex-start; background: none; border: none; padding: 4px 0; color: var(--brand); font: inherit; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.account-back-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.account-order-detail-title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
.account-order-info { color: var(--ink-mute); font-size: var(--fs-sm); }
.account-section-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-mute); margin-top: 6px; }
.account-items-list, .account-history-list { display: flex; flex-direction: column; gap: 6px; }
.account-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--ink); }
.account-item-price { color: var(--ink-mute); font-weight: 600; }
.account-history-row { font-size: var(--fs-xs); color: var(--ink-mute); padding: 4px 0; border-bottom: 1px solid var(--line); }

/* UX-016 — Commission audit trail timeline */
.ledger-audit-btn { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ledger-audit-btn:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand); }
.ledger-audit-btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.audit-trail-modal .modal-body { max-height: 60vh; overflow-y: auto; }
.audit-trail-title { font-weight: 700; color: var(--ink); }
.audit-trail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.audit-trail-empty { color: var(--ink-mute); font-size: var(--fs-sm); padding: var(--space-4) 0; text-align: center; }
.audit-entry { border-left: 3px solid var(--line); padding-left: var(--space-3); padding-top: var(--space-1); padding-bottom: var(--space-1); }
.audit-entry--insert { border-left-color: var(--brand); }
.audit-entry--update,
.audit-entry--adjustment { border-left-color: var(--warn-text); }
.audit-entry--delete { border-left-color: var(--err-text); }
.audit-entry--loading { color: var(--ink-mute); font-size: var(--fs-sm); border-left-color: var(--line); }
.audit-entry-meta { font-size: var(--fs-xs); color: var(--ink-mute); }
.audit-entry-actor { color: var(--ink); font-weight: 600; }
.audit-entry-role { text-transform: uppercase; letter-spacing: .5px; }
.audit-entry-desc { font-size: var(--fs-sm); color: var(--ink); margin-top: var(--space-1); }
.audit-entry-reason { margin: var(--space-1) 0 0; padding: var(--space-2); background: var(--surface-alt); border-radius: var(--radius-sm); font-style: italic; font-size: var(--fs-sm); color: var(--ink-soft); border: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════════════════════════
   STOREFRONT PREMIUM POLISH (2026-04-17)
   Minimalist refinement pass: softer shadows, finer borders, subtle
   micro-interactions, tabular numerics for prices, header blur, improved
   hierarchy. No structural changes — purely additive overrides.
   ═══════════════════════════════════════════════════════════════════════ */

/* Page background — a shade warmer, reduces harsh contrast against cards */
body[data-page-mode="catalog"] { background: var(--store-page-bg); }

/* Sticky header with glass effect */
body[data-page-mode="catalog"] header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* Refined search bar — softer border, subtler background */
body[data-page-mode="catalog"] .search-wrap input {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
  transition: border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
body[data-page-mode="catalog"] .search-wrap input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.10);
}

/* Header action buttons — lighter border, cleaner */
body[data-page-mode="catalog"] .header-action-btn {
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-weight: 600;
}

/* Layout — more breathing room between sidebar and grid */
body[data-page-mode="catalog"] .layout { gap: 32px; }

/* Sidebar filter cards — layered shadow, finer border */
body[data-page-mode="catalog"] .filter-card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  border-radius: var(--radius-md);
}
body[data-page-mode="catalog"] .filter-title {
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  font-size: var(--fs-xs);
  letter-spacing: 0.8px;
}

/* Sticky sidebar — respect the taller glass header (desktop only).
   Phase 83: scoped to min-width:901px so it doesn't override the
   mobile fixed drawer's top:0 (which needs full-screen coverage). */
@media (min-width: 901px) {
  body[data-page-mode="catalog"] .sidebar { top: 80px; }
}

/* Cat/sub counts — more discreet */
body[data-page-mode="catalog"] .cat-item .cat-count,
body[data-page-mode="catalog"] .subcat-item .subcat-count {
  background: transparent;
  color: var(--ink-mute);
  font-weight: 500;
}
body[data-page-mode="catalog"] .cat-item.active .cat-count,
body[data-page-mode="catalog"] .subcat-item.active .subcat-count {
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

/* Product cards — softer elevation + lift on hover */
body[data-page-mode="catalog"] .card-front,
body[data-page-mode="catalog"] .card-back {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform var(--dur-normal) var(--ease),
              box-shadow var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
}
body[data-page-mode="catalog"] .card-wrapper { transition: transform var(--dur-normal) var(--ease); }
body[data-page-mode="catalog"] .card-wrapper:hover:not(.flipped) { transform: translateY(-2px); }
body[data-page-mode="catalog"] .card-wrapper:hover .card-front {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
              0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.10);
}

/* Price — tabular numerics, crisper hierarchy */
body[data-page-mode="catalog"] .price-line {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.02em;
}
body[data-page-mode="catalog"] .price-kicker {
  font-weight: 700;
  font-size: 10.5px;
  color: var(--ink-mute);
  opacity: 0.8;
}

/* Add-to-cart button — tighter focus ring, active press feedback */
body[data-page-mode="catalog"] .add-btn {
  font-weight: 700;
  letter-spacing: 0.1px;
  transition: background-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
body[data-page-mode="catalog"] .add-btn:active { transform: scale(0.97); }

/* Cart button refinement — no visible badge when count is 0 (already via inline style),
   cleaner pill */
body[data-page-mode="catalog"] .cart-btn {
  padding: 8px 20px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(26, 86, 219, 0.15),
              0 4px 12px rgba(26, 86, 219, 0.18);
}
body[data-page-mode="catalog"] .cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(26, 86, 219, 0.18),
              0 8px 20px rgba(26, 86, 219, 0.24);
}
body[data-page-mode="catalog"] .cart-btn { transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-normal) var(--ease); }

/* Variant & brand pills — cleaner borders */
body[data-page-mode="catalog"] .variant-pill,
body[data-page-mode="catalog"] .brand-opt {
  border-width: 1px;
  border-color: rgba(15, 23, 42, 0.10);
}

/* Results bar — lighter, more spacious */
body[data-page-mode="catalog"] .results-bar {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

/* Phase 62h (2026-04-20, Cezar request): ascunde countere (sidebar) +
   „N produse · pagina X/Y" + containerul decorativ al results-bar. Chip-urile
   de filtru active rămân vizibile fără cadranul dreptunghic. */
body[data-page-mode="catalog"] .cat-item .cat-count,
body[data-page-mode="catalog"] .subcat-item .subcat-count { display: none; }
body[data-page-mode="catalog"] .results-count { display: none; }
body[data-page-mode="catalog"] .results-bar {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin-bottom: 8px;
}
body[data-page-mode="catalog"] .results-bar:empty,
body[data-page-mode="catalog"] .results-bar:has(.active-filters:empty):not(:has(.filter-tag)):not(:has(.filter-clear-btn)) {
  display: none;
}

/* Brand trigger — match card radius */
body[data-page-mode="catalog"] .brand-multi-trigger {
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-weight: 600;
}

/* Reduced motion — disable all transforms/transitions */
@media (prefers-reduced-motion: reduce) {
  body[data-page-mode="catalog"] * {
    transition: none !important;
    animation: none !important;
  }
  body[data-page-mode="catalog"] .card-wrapper:hover:not(.flipped) { transform: none; }
}

/* Mobile — header slightly smaller, more compact */
@media (max-width: 600px) {
  body[data-page-mode="catalog"] .layout { gap: 16px; padding: 16px 12px 80px; }
  /* Phase 83b: same front-drives-height approach as ≤900px rule above. */
  body[data-page-mode="catalog"] .card-wrapper { height: auto; min-height: 0; }
  body[data-page-mode="catalog"] .card-inner { height: auto; }
  body[data-page-mode="catalog"] .card-front { position: relative; inset: auto; }
  body[data-page-mode="catalog"] .card-back { position: absolute; inset: 0; }
}

/* ── Skeleton loading cards ── */
.sk-card {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-lg);
  height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.sk-img { height: 150px; background: linear-gradient(90deg, var(--store-shimmer-base) 0%, var(--store-shimmer-peak) 50%, var(--store-shimmer-base) 100%); background-size: 200% 100%; animation: sk-shimmer 1.4s ease-in-out infinite; }
.sk-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sk-line { background: linear-gradient(90deg, var(--store-shimmer-base) 0%, var(--store-shimmer-peak) 50%, var(--store-shimmer-base) 100%); background-size: 200% 100%; animation: sk-shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-xs); height: 12px; }
.sk-line--xs { width: 40%; height: 9px; }
.sk-line--title { width: 85%; height: 14px; }
.sk-line--sm { width: 55%; height: 10px; }
.sk-line--price { width: 50%; height: 22px; margin-top: auto; }
@keyframes sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-img, .sk-line { animation: none; }
}
@media (max-width: 600px) {
  .sk-card { height: auto; min-height: 440px; }
}

/* ── Refined empty state ── */
.empty-state--refined { padding: 64px 20px 80px; max-width: 420px; margin: 0 auto; }
.empty-state--refined svg { width: 48px; height: 48px; color: var(--ink-mute); opacity: 0.5; margin-bottom: 16px; }
.empty-state--refined h3 { font-size: var(--fs-h3); font-weight: 700; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em; }
.empty-state--refined p { font-size: var(--fs-base); color: var(--ink-mute); margin-bottom: 20px; line-height: 1.5; }
.empty-state-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px;
  background: var(--brand); color: var(--surface);
  border: none; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 2px rgba(26, 86, 219, 0.15), 0 4px 12px rgba(26, 86, 219, 0.18);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.empty-state-cta:hover { background: var(--brand-600); transform: translateY(-1px); }
.empty-state-cta:active { transform: scale(0.97); }

/* Phase 69bb (F-006): catalog-failure fallback — CSS-first, no inline styles,
   no inline onclick (CSP-safe). Render from renderCatalogFailureState(). */
.mv2-catalog-fail {
  text-align: center;
  padding: 60px 20px;
}
.mv2-catalog-fail-msg {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: 12px;
}
.mv2-catalog-fail-btn {
  font-size: var(--fs-sm);
}

/* Phase 81ao (Cezar 2026-04-28): Loyalty banner storefront — design tokens only (AP-019) */
.delphi-loyalty-banner {
  background: var(--brand-soft);
  border-bottom: 3px solid var(--brand);
  padding: var(--t-space-3) var(--t-space-4);
  font-size: var(--t-font-md);
  color: var(--ink);
}
.delphi-loyalty-banner[hidden] { display: none !important; }
.delphi-loyalty-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--t-space-4);
  flex-wrap: wrap;
}
.delphi-loyalty-banner-icon { font-size: var(--t-font-xl); line-height: 1; }
.delphi-loyalty-banner-msg { flex: 1; min-width: 200px; }
.delphi-loyalty-banner-msg strong { font-weight: 800; }
.delphi-loyalty-banner-hint {
  font-size: var(--t-font-xs);
  color: var(--ink-soft);
  font-style: italic;
}
.delphi-loyalty-banner-link {
  font-size: var(--t-font-sm);
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  padding: var(--t-space-2) var(--t-space-3);
  border: 1px solid var(--brand);
  border-radius: var(--t-radius-full);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.delphi-loyalty-banner-link:hover { background: var(--brand); color: var(--surface); }
.delphi-loyalty-banner-close {
  background: transparent;
  border: none;
  font-size: var(--t-font-lg);
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0 var(--t-space-2);
  line-height: 1;
}
.delphi-loyalty-banner-close:hover { color: var(--ink); }
@media (max-width: 640px) {
  .delphi-loyalty-banner-msg { font-size: var(--t-font-sm); }
  .delphi-loyalty-banner-hint { display: none; }
}

/* ── Phase 84 (2026-04-30): hero storefront ──
   Stil inspirat din delphi-website-x: gradient sky-pale → white → sky,
   2 orbe radiale în colțuri, headline cu gradient highlight pe „cabinete
   și clinici medicale". Subtitlu placeholder; vom itera. */
.hero-medexa {
  position: relative;
  overflow: hidden;
  padding: 48px 24px 40px;
  background: linear-gradient(165deg, #f4f8ff 0%, #ffffff 40%, #e8f2ff 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.hero-medexa::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-medexa::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-medexa-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero-medexa h1 {
  font-size: var(--t-font-4xl); /* 30px from design tokens */
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #0c1f3f;
  margin: 0 0 16px;
}
.hero-medexa h1 .hero-highlight {
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-medexa-sub {
  font-size: var(--t-font-lg); /* 15px from design tokens */
  color: #64748b;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto;
}
@media (max-width: 700px) {
  .hero-medexa { padding: 32px 20px 28px; }
  .hero-medexa h1 { font-size: var(--t-font-3xl); line-height: 1.22; margin-bottom: 12px; }
  .hero-medexa-sub { font-size: var(--t-font-md); }
  .hero-medexa::before { width: 400px; height: 400px; top: -120px; right: -100px; }
  .hero-medexa::after { width: 300px; height: 300px; bottom: -60px; left: -80px; }
}
