/* =============================================================
   FAIR BUSINESS — SHARED HEADER
   Verbatim port of header-prototype.html. Do not modify directly;
   if the source prototype evolves, regenerate this file.
   ============================================================= */

/* Container override only when used inside the header */
.site-header .container { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

body[data-auth="out"] .auth-only-in { display: none !important; }
body[data-auth="in"]  .auth-only-out { display: none !important; }

body.has-drawer-open { overflow: hidden; }

/* visibility helpers */
.desktop-only-flex { display: inline-flex; }
.desktop-only { display: inline-block; }
.mobile-only { display: none; }

/* ========== STICKY HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); border-bottom-color: var(--slate-200); }
.site-header.is-mega-open { border-bottom-color: transparent; box-shadow: none; }

/* Utility bar */
.utility-bar { background: var(--green-50); border-bottom: 1px solid var(--slate-200); font-size: 13px; color: var(--slate-600); }
.utility-inner { display: flex; align-items: center; justify-content: space-between; height: 36px; gap: 24px; }
.util-group { display: flex; align-items: center; gap: 18px; }
.util-item { display: inline-flex; align-items: center; gap: 6px; transition: color .15s var(--ease); }
.util-item:hover { color: var(--green-600); }
.util-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.util-divider { width: 1px; height: 14px; background: var(--slate-300); }

/* Main header */
.main-header-inner { display: flex; align-items: center; height: 72px; gap: 28px; }
.site-header .logo { flex-shrink: 0; display: flex; align-items: center; }
.site-header .logo img { height: 38px; width: auto; }

/* Nav items */
.main-nav { display: flex; align-self: stretch; align-items: stretch; }
.nav-item {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  padding: 0 14px; font-size: 14px; font-weight: 500;
  color: var(--slate-700); cursor: pointer; user-select: none;
  transition: color .15s var(--ease);
}
.nav-item:hover { color: var(--green-600); }
.nav-item.is-active { color: var(--slate-900); font-weight: 600; }
.nav-item.is-active::after,
.nav-item.is-mega-open::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 2px; background: var(--green); border-radius: 2px 2px 0 0;
}
.nav-item .chevron {
  width: 13px; height: 13px; stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  opacity: .55; transition: transform .25s var(--ease), opacity .15s var(--ease);
}
.nav-item:hover .chevron { opacity: 1; }
.nav-item.is-mega-open .chevron { transform: rotate(180deg); opacity: 1; }

/* Search (desktop) — on the home page the hero already has a big search bar.
 * The header search is hidden until the hero search scrolls out of view.
 * `inline-public-home.js` adds `has-hero` to <body> on first paint, then toggles
 * `scrolled-past-hero` via IntersectionObserver. Other routes don't get
 * `has-hero` so the header search shows immediately. */
.header-search {
  flex: 1; max-width: 360px; margin-left: auto;
  opacity: 1;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
body.has-hero:not(.scrolled-past-hero) .header-search {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
}
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; height: 40px;
  padding: 0 70px 0 40px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  font-family: inherit; font-size: 14px;
  color: var(--slate-900);
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.search-wrap input::placeholder { color: var(--slate-400); }
.search-wrap input:focus { outline: none; background: var(--white); border-color: var(--green); box-shadow: 0 0 0 3px rgba(56,173,78,.15); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--slate-500); background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-xs); padding: 3px 6px; pointer-events: none; line-height: 1; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 6px; }
.dropdown-wrap { position: relative; }

.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--slate-600); position: relative; transition: background .15s var(--ease), color .15s var(--ease); }
.icon-btn:hover, .icon-btn.is-active { background: var(--slate-100); color: var(--slate-900); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lang-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; height: 40px; background: transparent; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--slate-600); transition: background .15s var(--ease), color .15s var(--ease); }
.lang-toggle:hover, .lang-toggle.is-active { background: var(--slate-100); color: var(--slate-900); }
.lang-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.chevron-sm { width: 12px; height: 12px; stroke-width: 2.2; opacity: .7; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.is-active .chevron-sm { transform: rotate(180deg); }

/* Circle flags */
.flag { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; object-fit: cover; box-shadow: 0 0 0 1px rgba(15,23,42,.06); }
.flag-sm { width: 14px; height: 14px; }

/* CTAs (header-only) */
.cta-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--green); color: var(--white); font-size: 14px; font-weight: 600; height: 40px; padding: 0 16px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: var(--shadow-sm); transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .2s var(--ease); }
.cta-primary:hover { background: var(--green-hover); box-shadow: var(--shadow-cta); }
.cta-primary:active { transform: translateY(1px); }
.cta-primary svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ghost-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--slate-700); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.ghost-btn:hover { background: var(--slate-100); color: var(--slate-900); }

/* Avatar pill */
.avatar-btn { margin-left: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--slate-200); background: var(--white); border-radius: 999px; cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.avatar-btn:hover, .avatar-btn.is-active { border-color: var(--slate-300); box-shadow: var(--shadow-sm); }
.site-header .avatar-img { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--slate-900); flex-shrink: 0; }
.site-header .avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn .chevron-sm { stroke: var(--slate-400); }

/* Mobile-only avatar (no chevron, smaller) */
.avatar-btn-mobile {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: opacity .15s var(--ease);
}
.avatar-btn-mobile:hover, .avatar-btn-mobile.is-active { opacity: .85; }
.avatar-btn-mobile .avatar-img { width: 32px; height: 32px; }

/* Mobile-only language button (compact: just flag) */
.lang-toggle-mobile {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: background .15s var(--ease);
}
.lang-toggle-mobile:hover, .lang-toggle-mobile.is-active { background: var(--slate-100); }
.lang-toggle-mobile .flag { width: 22px; height: 22px; }

/* ========== DROPDOWN BASE ========== */
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 240px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.dropdown-menu.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; font-size: 14px; color: var(--slate-700); border-radius: var(--radius-sm); transition: background .12s var(--ease), color .12s var(--ease); cursor: pointer; font-weight: 500; }
.dd-item:hover { background: var(--slate-50); color: var(--slate-900); }
.dd-item .dd-icon { width: 16px; height: 16px; stroke: var(--slate-500); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.dd-item:hover .dd-icon { stroke: var(--slate-700); }
.dd-item .dd-spacer { flex: 1; }
.dd-item .dd-badge { background: var(--slate-100); color: var(--slate-600); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.dd-item .dd-badge.is-green { background: var(--green-100); color: var(--green-600); }
.dd-item .dd-shortcut { font-size: 11px; font-weight: 500; color: var(--slate-400); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.dd-item.is-danger { color: var(--red-500); }
.dd-item.is-danger .dd-icon { stroke: var(--red-500); }
.dd-item.is-danger:hover { background: var(--red-50); color: var(--red-500); }
.dd-divider { height: 1px; background: var(--slate-200); margin: 6px 4px; }

.account-menu { min-width: 280px; }
.dd-user { display: flex; align-items: center; gap: 12px; padding: 12px 10px 10px; }
.dd-user-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.dd-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dd-user-name { font-size: 14px; font-weight: 600; color: var(--slate-900); line-height: 1.3; }
.dd-user-email { font-size: 12px; color: var(--slate-500); line-height: 1.3; margin-top: 2px; }

.lang-menu { min-width: 170px; }
.dd-item .dd-check { width: 14px; height: 14px; stroke: var(--green-600); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; margin-left: auto; opacity: 0; }
.dd-item.is-selected .dd-check { opacity: 1; }
.dd-item.is-selected { color: var(--slate-900); }

/* ========== FULL-WIDTH MEGA PANEL ========== */
.mega-panel { position: absolute; top: 100%; left: 0; right: 0; width: 100%; padding: 25px 0; background: var(--white); border-bottom: 1px solid var(--slate-200); box-shadow: var(--shadow-mega); z-index: 90; opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden; transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s; }
.mega-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; transition-delay: 0s; }
.mega-grid { display: grid; grid-template-columns: 1fr 380px; gap: 56px; padding: 56px 32px 64px; align-items: start; }
.mm-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-400); margin-bottom: 14px; padding-left: 12px; }
.mm-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.mm-cat { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-md); transition: background .15s var(--ease); cursor: pointer; }
.mm-cat:hover { background: var(--slate-50); }
.mm-cat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--slate-100); color: var(--slate-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s var(--ease), color .15s var(--ease); }
.mm-cat:hover .mm-cat-icon { background: var(--green-100); color: var(--green-600); }
.mm-cat-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mm-cat-text { min-width: 0; }
.mm-cat-name { display: block; font-size: 14px; font-weight: 600; color: var(--slate-900); line-height: 1.3; }
.mm-cat-count { display: block; font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.mm-see-all { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0 12px; padding: 8px 12px 8px 0; font-size: 13px; font-weight: 600; color: var(--green-600); border-radius: var(--radius-sm); transition: gap .15s var(--ease); }
.mm-see-all:hover { gap: 10px; }
.mm-see-all svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ========== PROMO BLOCK (3:2) ========== */
.mm-promo {
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-xl);
  color: white;
  padding: 28px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-promo, 0 16px 40px -12px rgba(56,173,78,.45));
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 55%, var(--green-dark) 100%);
}
.mm-promo-eyebrow, .mm-promo-title, .mm-promo-desc, .mm-promo-cta { z-index: 2; }
.mm-promo-blob { position: absolute; border-radius: 50%; filter: blur(48px); pointer-events: none; z-index: 0; will-change: transform; }
.mm-promo-blob.blob-a { width: 220px; height: 220px; background: #7FE89A; top: -70px; right: -50px; opacity: .65; }
.mm-promo-blob.blob-b { width: 200px; height: 200px; background: #1A6B2F; bottom: -70px; left: -50px; opacity: .55; }
.mm-promo-blob.blob-c { width: 110px; height: 110px; background: #FFFFFF; top: 38%; right: 22%; opacity: .14; }
.mm-promo::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  opacity: .22;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes blob-float-a { 0%,100% { transform: translate(0,0); } 50% { transform: translate(18px,-14px); } }
  @keyframes blob-float-b { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-16px,10px); } }
  @keyframes blob-pulse-c { 0%,100% { transform: scale(1); opacity: .14; } 50% { transform: scale(1.35); opacity: .22; } }
  .mm-promo-blob.blob-a { animation: blob-float-a 9s ease-in-out infinite; }
  .mm-promo-blob.blob-b { animation: blob-float-b 11s ease-in-out infinite; }
  .mm-promo-blob.blob-c { animation: blob-pulse-c 7s ease-in-out infinite; }
}
.mm-promo-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.9); display: inline-flex; align-items: center; gap: 8px; position: relative; }
.mm-promo-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.mm-promo-title { font-size: 24px; font-weight: 700; line-height: 1.18; letter-spacing: -.015em; margin-top: 14px; color: white; position: relative; }
.mm-promo-desc { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.88); margin-top: 8px; max-width: 280px; flex: 1; position: relative; }
.mm-promo-cta { display: inline-flex; align-items: center; gap: 8px; background: white; color: var(--green-600); font-size: 14px; font-weight: 600; padding: 11px 16px; border-radius: var(--radius-sm); width: fit-content; margin-top: 16px; transition: transform .15s var(--ease), box-shadow .2s var(--ease); position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.mm-promo-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.mm-promo-cta svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s var(--ease); }
.mm-promo-cta:hover svg { transform: translateX(3px); }

/* ========== MOBILE LOGIN LINK + HAMBURGER ========== */
.mobile-login {
  display: none;
  height: 40px; padding: 0 12px;
  align-items: center;
  font-size: 14px; font-weight: 600;
  color: var(--slate-900);
  border-radius: var(--radius-sm);
}
.mobile-login:hover { background: var(--slate-100); }

.mobile-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  background: transparent; border: none;
  cursor: pointer;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease);
}
.mobile-toggle:hover { background: var(--slate-100); }
.mt-line { width: 22px; height: 2px; background: var(--slate-900); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s var(--ease); }
.mobile-toggle.is-active .mt-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.is-active .mt-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.is-active .mt-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== MOBILE SEARCH ROW ========== */
.mobile-search-row {
  display: none;
  border-top: 1px solid var(--slate-100);
  background: var(--white);
}
.mobile-search-inner {
  display: flex; align-items: center; gap: 8px;
  height: var(--mobile-row2);
  padding: 0 16px;
}
.mobile-search-wrap {
  flex: 1; position: relative;
}
.mobile-search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  font-family: inherit; font-size: 15px;
  color: var(--slate-900);
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.mobile-search-wrap input::placeholder { color: var(--slate-400); }
.mobile-search-wrap input:focus { outline: none; background: var(--white); border-color: var(--green); box-shadow: 0 0 0 3px rgba(56,173,78,.15); }
.mobile-search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mobile-cta-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: white;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.mobile-cta-icon:hover { background: var(--green-hover); }
.mobile-cta-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ========== INBOX BADGE (vendor CTA only) ==========
   Renders on .cta-primary (desktop) and .mobile-cta-icon (mobile) when the
   fb_company user has untouched-complaint count > 0. Hidden when count is 0
   (server-side, the chip isn't even emitted). Uses --red token so it stays
   on-brand if/when admin-customizable. Both anchors need position:relative
   so the absolutely-positioned chip sits in the top-right corner.
   ----------------------------------------------------- */
.cta-primary { position: relative; }
.mobile-cta-icon { position: relative; }

.cta-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  /* --red-600 token is defined globally in mobile-app-shell.css's :root;
     fallback covers stylesheet-loaded-out-of-order edge case. */
  background: var(--red-600, #dc2626);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  border: 2px solid var(--white, #fff);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  pointer-events: none;
  /* Numbers like "99+" need a tad more breathing room. */
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
/* The mobile icon is smaller (40px square), so the chip sits a bit tighter
   to keep it inside the visible region of the header row. */
.cta-badge-mobile {
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  font-size: 10px;
  border-width: 1.5px;
}

/* ========== MOBILE DRAWER (NAV ONLY) ========== */
.md-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 999; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
.md-backdrop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 380px;
  background: var(--white);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-drawer);
}
.mobile-drawer.is-open { transform: translateX(0); }

.md-header {
  position: sticky; top: 0;
  background: var(--white);
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-200);
}
.md-header .logo img { height: 30px; }
.md-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--slate-700); transition: background .15s var(--ease); }
.md-close:hover { background: var(--slate-100); color: var(--slate-900); }
.md-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.md-body { flex: 1; padding-bottom: 16px; }

.md-section { padding: 8px; border-bottom: 1px solid var(--slate-100); }
.md-section:last-of-type { border-bottom: none; }
.md-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-400); padding: 14px 12px 6px; }

.md-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px; font-size: 16px; font-weight: 600; color: var(--slate-900); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s var(--ease); }
.md-nav-item:hover { background: var(--slate-50); }
.md-nav-item.is-active { color: var(--green-600); }
.md-nav-item .chevron-down { width: 18px; height: 18px; stroke: var(--slate-500); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.md-nav-item.is-expanded .chevron-down { transform: rotate(180deg); }
.md-nav-item .arrow-right { width: 16px; height: 16px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.md-sub-nav { overflow: hidden; max-height: 0; transition: max-height .35s var(--ease); }
.md-nav-item.is-expanded + .md-sub-nav { max-height: 800px; }
.md-sub-inner { padding: 4px 0 8px; }
.md-sub-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); transition: background .15s var(--ease); }
.md-sub-item:hover { background: var(--slate-50); }
.md-sub-icon { width: 34px; height: 34px; border-radius: var(--radius-md); background: var(--slate-100); color: var(--slate-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.md-sub-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-sub-text { flex: 1; min-width: 0; }
.md-sub-name { font-size: 14px; font-weight: 500; color: var(--slate-900); }
.md-sub-count { font-size: 12px; color: var(--slate-500); }
.md-sub-see-all { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--green-600); }
.md-sub-see-all svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.md-cta-row { display: flex; gap: 8px; padding: 16px; }
.md-cta-row > * { flex: 1; }
.md-cta-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: white; font-weight: 600; font-size: 15px; padding: 14px 16px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: var(--shadow-sm); }
.md-cta-primary:hover { background: var(--green-hover); }
.md-cta-primary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-cta-ghost { display: inline-flex; align-items: center; justify-content: center; background: var(--white); color: var(--slate-900); font-weight: 600; font-size: 15px; padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); cursor: pointer; }
.md-cta-ghost:hover { background: var(--slate-50); }

.md-promo-wrap { padding: 8px 16px 16px; }

/* Compact action cards — replace the bulky promo block */
.md-actions {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.md-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.md-action-card:active { transform: translateY(1px); }
.md-action-primary {
  background: var(--green);
  color: white;
  box-shadow: var(--shadow-sm);
}
.md-action-primary:hover { background: var(--green-hover); }
.md-action-secondary {
  background: var(--white);
  color: var(--slate-900);
  border: 1px solid var(--slate-200);
}
.md-action-secondary:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}
.md-action-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.md-action-primary .md-action-icon { background: rgba(255,255,255,.2); color: white; }
.md-action-secondary .md-action-icon { background: var(--green-100); color: var(--green-600); }
.md-action-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.md-action-text { flex: 1; min-width: 0; }
.md-action-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.md-action-desc {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
  opacity: .85;
}
.md-action-secondary .md-action-desc { color: var(--slate-500); opacity: 1; }
.md-action-arrow {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  opacity: .6;
  flex-shrink: 0;
  transition: transform .15s var(--ease), opacity .15s var(--ease);
}
.md-action-card:hover .md-action-arrow { transform: translateX(3px); opacity: 1; }

.md-link { display: flex; align-items: center; gap: 12px; padding: 12px; font-size: 15px; color: var(--slate-700); font-weight: 500; border-radius: var(--radius-sm); transition: background .15s var(--ease); cursor: pointer; }
.md-link:hover { background: var(--slate-50); color: var(--slate-900); }
.md-link svg.md-link-icon { width: 18px; height: 18px; stroke: var(--slate-500); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.md-lang-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; }
.md-lang-row > span { font-size: 14px; font-weight: 500; color: var(--slate-700); display: inline-flex; align-items: center; gap: 8px; }
.md-lang-row > span svg { width: 16px; height: 16px; stroke: var(--slate-500); fill: none; stroke-width: 2; }
.md-lang-toggle { display: inline-flex; background: var(--slate-100); border: 1px solid var(--slate-200); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.md-lang-toggle button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--slate-600); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); font-family: inherit; }
.md-lang-toggle button.is-active { background: white; color: var(--slate-900); box-shadow: var(--shadow-sm); }

.md-footer { padding: 18px 16px; background: var(--green-50); display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--green-100); }
.md-contact { display: inline-flex; align-items: center; gap: 10px; color: var(--slate-700); font-size: 14px; }
.md-contact:hover { color: var(--green-600); }
.md-contact svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

/* ========================================== */
/* ============= RESPONSIVE ================= */
/* ========================================== */

@media (max-width: 1180px) { .header-search { max-width: 260px; } }

@media (max-width: 1024px) {
  .header-search { display: none; }
  .nav-item { padding: 0 10px; }
  .mega-grid { grid-template-columns: 1fr 320px; gap: 32px; }
}

/* ===== MOBILE: ≤ 860px ===== */
@media (max-width: 860px) {
  /* Hide desktop bits */
  .utility-bar,
  .main-nav,
  .header-search,
  .desktop-only,
  .desktop-only-flex,
  .lang-toggle,
  .header-actions .cta-primary,
  .header-actions .ghost-btn,
  .avatar-btn,
  .mega-panel { display: none !important; }

  /* Show mobile bits */
  .mobile-only { display: block; }
  .avatar-btn-mobile.auth-only-in,
  body[data-auth="in"] .avatar-btn-mobile { display: inline-flex; }
  .lang-toggle-mobile { display: inline-flex; }
  .mobile-toggle { display: inline-flex; }
  .mobile-search-row { display: block; }
  body[data-auth="out"] .mobile-login { display: inline-flex; }

  /* Compact main row */
  .main-header-inner { height: var(--mobile-row1); gap: 0; justify-content: space-between; }
  .site-header .logo img { height: 28px; }
  .site-header .container { padding: 0 16px; }

  .header-actions { gap: 2px; }

  /* Mobile-specific dropdown positioning — pin directly under the main header
     bar. Previously included `mobile-row2` (56px) in the top calc, which placed
     dropdowns ~120px below the viewport top, far away from their trigger
     buttons. Most pages don't render a second mobile row, so that offset was
     pure dead space. Now flush below the 60px header. */
  .account-menu, #langMenuMobile {
    position: fixed;
    top: calc(var(--mobile-row1) + 4px);
    right: 8px;
    left: auto;
    transform-origin: top right;
  }
  .account-menu {
    width: calc(100vw - 16px);
    max-width: 380px;
    min-width: 0;
  }
  #langMenuMobile { min-width: 200px; }
}

@media (max-width: 480px) {
  .mobile-drawer { max-width: 100%; }
  .avatar-btn-mobile { width: 36px; }
  .avatar-btn-mobile .avatar-img { width: 30px; height: 30px; }
  .lang-toggle-mobile { width: 36px; height: 36px; }
  .lang-toggle-mobile .flag { width: 20px; height: 20px; }
  .mobile-toggle { width: 36px; }
  .site-header .logo img { height: 26px; }
}

/* ===== Header search results dropdown ===== */
.search-wrap { position: relative; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,.12));
  max-height: 480px;
  overflow-y: auto;
  z-index: 1100;
}
.search-dropdown[hidden] { display: none; }
.search-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--slate-500); }
.search-group { padding: 8px 0; border-bottom: 1px solid var(--slate-100); }
.search-group:last-child { border-bottom: none; }
.search-group h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--slate-500); padding: 6px 16px; margin: 0;
}
.search-group ul { list-style: none; margin: 0; padding: 0; }
.search-group li a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  text-decoration: none; color: var(--slate-900);
  transition: background .12s var(--ease);
}
.search-group li a:hover { background: var(--slate-50); }
.search-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.search-group li a strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-group li a small { font-size: 12px; color: var(--slate-500); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-thumb {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--slate-600);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
}
.search-thumb.is-product { border-radius: var(--radius-sm); }
.search-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-thumb.is-cat svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.search-thumb.has-img { background: var(--white); }
.search-thumb.is-letter {
  background: linear-gradient(135deg, var(--slate-200), var(--slate-300));
  color: var(--slate-700);
}

@media (max-width: 1024px) {
  .search-dropdown { left: 8px; right: 8px; }
}

