/* storefront-core.css — generated from the listed sources. Edit the sources, then rebuild this file. */
/* source: variables.css */
/* ===== AL WADI STORE — DESIGN TOKENS ===== */
:root {
  /* Native form controls (select option lists, etc.) follow the active theme. */
  color-scheme: light;

  /* === LIGHT THEME (Default) === */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255,255,255,0.7);
  --bg-glass-border: rgba(0,180,216,0.15);
  --bg-overlay: rgba(0,0,0,0.5);
  --bg-header: rgba(255,255,255,0.85);
  --bg-footer: #0a1628;
  --bg-input: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-on-footer: #cbd5e1;

  --accent: #00b4d8;
  --accent-hover: #0096b7;
  --accent-light: rgba(0,180,216,0.1);
  --accent-glow: rgba(0,180,216,0.3);
  --accent-gradient: linear-gradient(135deg, #00b4d8, #0077b6);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg-product-media: #ffffff;
  --shadow-product-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
  --border-product-hover: rgba(0, 180, 216, 0.28);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(0,180,216,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-heading: 'Inter', 'Noto Sans Arabic', sans-serif;
  --font-body: 'Outfit', 'Noto Sans Arabic', sans-serif;

  --header-h: 96px;
  --header-offset: var(--header-h);
  --logo-max-h: 72px;
  --logo-max-w: 240px;
  --container: 1680px;
  --container-padding-x: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === DARK THEME === */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-primary: #0b1526;
  --bg-secondary: #0f1f35;
  --bg-tertiary: #121e32;
  --bg-card: #16243c;
  --bg-card-hover: #1c2e4a;
  --bg-glass: rgba(15, 31, 53, 0.88);
  --bg-glass-border: rgba(0, 180, 216, 0.28);
  --bg-overlay: rgba(0, 0, 0, 0.72);
  --bg-header: rgba(11, 21, 38, 0.97);
  --bg-footer: #050d18;
  --bg-input: #1a2d4a;

  --bg-product-media: #1a2d4a;
  --shadow-product-hover: 0 10px 28px rgba(0, 0, 0, 0.42);
  --border-product-hover: rgba(0, 180, 216, 0.38);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f172a;
  --text-on-footer: #cbd5e1;

  --accent-light: rgba(0, 180, 216, 0.14);

  --border: #243b5c;
  --border-light: #1a2d4a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.48);
  --shadow-xl: 0 20px 56px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 24px rgba(0, 180, 216, 0.22);
}

/* === RTL SUPPORT === */
[dir="rtl"] {
  --font-heading: 'Noto Sans Arabic', 'Inter', sans-serif;
  --font-body: 'Noto Sans Arabic', 'Outfit', sans-serif;
}
/* source: base.css */
/* ===== BASE & RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 0;
}
/* Show the active language before site.js runs. Inline styles from applyLang still win after load. */
.i18n-block-ar { display: none; }
html[dir="rtl"] .i18n-block-en { display: none; }
html[dir="rtl"] .i18n-block-ar { display: revert; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Screen-reader / data-only nodes — never use left:-9999px (breaks RTL mobile width) */
.u-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  inset-inline-start: 0 !important;
  inset-block-start: 0 !important;
}

/* Phone / email / numeric contact values — keep LTR inside RTL pages */
.contact-ltr,
[dir="ltr"].contact-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}
a { text-decoration: none; color: inherit; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }

main {
  padding-top: 0;
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--container-padding-x);
  box-sizing: border-box;
}
.section { padding: 80px 0; }
.section-title {
  font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 8px;
  background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 48px; font-size: 1.05rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px;
  border-radius: var(--radius-full); font-weight: 600; font-size: 0.95rem;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 4px 15px rgba(0,180,216,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,180,216,0.4); }
.btn-outline {
  border: 2px solid var(--accent); color: var(--accent); background: transparent;
}
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 8px 20px; font-size: 0.85rem; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 0 6px; position: absolute; top: -6px; right: -6px;
}
[dir="rtl"] .badge { right: auto; left: -6px; }

/* ===== HEADER ===== */
.header {
  position: relative;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: auto;
  box-sizing: border-box;
  transition: all var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 6px 12px 6px 0;
  margin-right: 4px;
  text-decoration: none;
}
[dir="rtl"] .logo {
  padding: 6px 0 6px 12px;
  margin-right: 0;
  margin-left: 4px;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(var(--logo-max-h), calc(var(--header-h) - 12px));
  max-height: var(--logo-max-h);
  min-height: 48px;
  padding: 0 4px;
  background: transparent;
  border-radius: var(--radius-md);
  overflow: visible;
}
.logo-icon .brand-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: min(var(--logo-max-w), 52vw);
  object-fit: contain;
  object-position: center;
}
.logo-icon .logo-fallback {
  display: none;
}
.logo-icon.use-fallback {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  overflow: hidden;
}
.logo-icon.use-fallback .brand-logo {
  display: none;
}
.logo-icon.use-fallback .logo-fallback {
  display: block;
}
.logo-text { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.logo-text span { color: var(--accent); }

/* Nav */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 16px; border-radius: var(--radius-full); font-weight: 500; font-size: 0.9rem;
  color: var(--text-secondary); transition: all var(--transition);
}
.nav a:hover, .nav a.active { color: var(--accent); background: var(--accent-light); }
.nav .nav-maintenance-link {
  cursor: pointer;
}

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 4px; }
.header-btn {
  position: relative; width: 44px; height: 44px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1.15rem; transition: all var(--transition);
}
.header-btn:hover { color: var(--accent); background: var(--accent-light); }
.theme-toggle { cursor: pointer; }
.lang-toggle {
  font-size: 0.8rem; font-weight: 700; width: auto; padding: 0 12px;
  border: 2px solid var(--border); color: var(--text-primary);
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  align-items: center; justify-content: center; cursor: pointer;
}
.mobile-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all var(--transition);
}
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile Nav — off-canvas without expanding document scrollWidth (critical for RTL) */
.mobile-nav {
  display: none; position: fixed; top: 0; inset-inline-start: 0; inset-inline-end: 0; bottom: 0;
  background: var(--bg-secondary); z-index: 999; padding: 24px;
  flex-direction: column; gap: 8px; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--transition), visibility var(--transition);
  visibility: hidden; pointer-events: none;
}
[dir="rtl"] .mobile-nav { transform: translateX(-100%); }
.mobile-nav.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.mobile-nav a,
.mobile-nav-theme {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-radius: var(--radius-md); font-size: 1rem; font-weight: 500;
  color: var(--text-primary); transition: all var(--transition);
  width: 100%; border: none; background: transparent; text-align: start;
  font-family: inherit; cursor: pointer;
}
.mobile-nav a:hover,
.mobile-nav a.active,
.mobile-nav-theme:hover { background: var(--accent-light); color: var(--accent); }
.mobile-nav a.nav-maintenance-link {
  cursor: pointer;
}
.mobile-nav-theme i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

/* Search Overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 2000; background: var(--bg-overlay);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 120px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  width: 90%; max-width: 640px; background: var(--bg-secondary);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  border: 1px solid var(--border); overflow: hidden;
  transform: translateY(-20px); transition: transform var(--transition);
}
.search-overlay.open .search-box { transform: translateY(0); }
.search-input-wrap { display: flex; align-items: center; padding: 16px 20px; gap: 12px; }
.search-input-wrap i { color: var(--accent); font-size: 1.2rem; }
.search-input-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 1.1rem; color: var(--text-primary);
}
.search-input-wrap input::placeholder { color: var(--text-tertiary); }
.search-close { color: var(--text-tertiary); font-size: 1rem; cursor: pointer; padding: 4px; }
.search-close:hover { color: var(--text-primary); }
.search-suggestions { border-top: 1px solid var(--border); padding: 12px; }
.search-suggestions a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.9rem;
}
.search-suggestions a:hover { background: var(--accent-light); color: var(--accent); }
.search-suggestions a i { width: 20px; text-align: center; }
/* source: brand-logo.css */
/* Branded logo shell — UI variant (logo-ui.png) and CSS fallback */

.logo-icon picture {
  display: contents;
}

/* Header theme logos: light stays default; dark shows only under [data-theme="dark"]. */
.logo-icon picture.brand-logo-picture--light {
  display: contents;
}

.logo-icon picture.brand-logo-picture--dark {
  display: none;
}

html[data-theme="dark"] .logo-icon picture.brand-logo-picture--light {
  display: none;
}

html[data-theme="dark"] .logo-icon picture.brand-logo-picture--dark {
  display: contents;
}

.brand-logo-shell--baked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand-logo-shell--baked .brand-logo--ui {
  display: block;
  width: auto;
  height: auto;
  max-width: min(240px, 78vw);
  max-height: 72px;
  object-fit: contain;
}

.footer-brand-logo .brand-logo-shell--baked .brand-logo--ui {
  max-width: min(220px, 72vw);
  max-height: 64px;
}

/* CSS-only fallback if UI asset is missing (original logo inside shell) */
.brand-logo-shell:not(.brand-logo-shell--baked) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.brand-logo-shell:not(.brand-logo-shell--baked) .brand-logo {
  max-height: 52px;
  max-width: min(200px, 70vw);
}

.brand-logo-shell--on-light:not(.brand-logo-shell--baked) {
  background: var(--bg-input);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
/* source: header.css */
/* ===== HEADER — TOP BAR + MAIN BAR ===== */
.header {
  height: auto;
  min-height: 0;
}

.header-top {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px var(--container-padding-x);
  min-height: 38px;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .header--legacy .header-top-inner {
    padding-inline: clamp(24px, 2.5vw, 40px);
  }
}

.header-contacts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.header-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}

.header-contact-link i {
  color: var(--accent);
  font-size: 0.85rem;
}

.header-contact-link:hover {
  color: var(--accent);
}

.header-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.header--legacy .href-after-sales-top {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 32px;
  padding-block: 2px;
}

.header--legacy .href-after-sales-top.active {
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.lang-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.lang-option:hover {
  color: var(--text-primary);
  background: var(--accent-light);
}

.lang-option.active {
  color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.lang-flag {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.lang-flag-us {
  background-image: url('https://flagcdn.com/w40/us.png');
}

.lang-flag-sa {
  background-image: url('https://flagcdn.com/w40/sa.png');
}

.header-main {
  border-bottom: 1px solid transparent;
}

.header-main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px var(--container-padding-x);
  min-height: 72px;
  box-sizing: border-box;
}

.header-main .logo-icon {
  height: min(var(--logo-max-h), 64px);
  min-height: 44px;
}

.header-search-trigger {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 280px;
  margin: 0 8px 0 16px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-tertiary);
  font-size: 0.88rem;
  text-align: start;
  transition: all var(--transition);
  cursor: pointer;
}

[dir="rtl"] .header-search-trigger {
  margin: 0 16px 0 8px;
}

.header-search-trigger i {
  color: var(--accent);
}

.header-search-trigger:hover {
  border-color: var(--accent);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.header-search-trigger kbd {
  margin-inline-start: auto;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.header-actions .header-btn-search-icon {
  display: flex;
}

@media (min-width: 992px) {
  .header-search-trigger {
    display: inline-flex;
  }

  .header-actions .header-btn-search-icon {
    display: none;
  }
}

/* Nav + categories dropdown */
.nav {
  gap: 2px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}

.nav-dropdown-toggle .nav-caret {
  font-size: 0.65rem;
  opacity: 0.7;
  transition: transform var(--transition);
}

.nav-dropdown.open .nav-dropdown-toggle,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-dropdown.open .nav-dropdown-toggle .nav-caret {
  transform: rotate(180deg);
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  z-index: 1300;
  width: min(720px, calc(100vw - 48px));
  max-height: min(70vh, 480px);
  overflow: auto;
  padding: 18px 20px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  pointer-events: none;
}

.nav-dropdown.open .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.nav-dropdown-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-dropdown-view-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.nav-dropdown-view-all:hover {
  text-decoration: underline;
}

.nav-dropdown-empty {
  padding: 12px 0;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.nav-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 20px;
}

.nav-dropdown-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.nav-dropdown-cat:hover {
  color: var(--accent);
}

.nav-dropdown-cat-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.nav-dropdown-cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-dropdown-sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
}

.nav-dropdown-sublist a {
  display: block;
  padding: 5px 0 5px 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.nav-dropdown-sublist a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

[dir="rtl"] .nav-dropdown-sublist a {
  padding: 5px 8px 5px 0;
}

/* Categories dropdown — parent list + side flyout submenu */
.nav-dropdown-panel.nav-dropdown-panel--menu {
  padding: 10px 0 12px;
  overflow: visible;
}

.nav-dropdown-panel--menu .nav-dropdown-panel-head {
  margin-bottom: 8px;
  padding-inline: 16px;
}

.nav-dropdown-panel-body {
  display: flex;
  align-items: stretch;
  min-height: 120px;
  max-height: min(68vh, 460px);
  overflow: hidden;
}

.nav-dropdown-panel--menu.has-submenu-open .nav-dropdown-panel-body {
  max-height: min(68vh, 460px);
}

.nav-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-dropdown-panel--menu.has-submenu-open .nav-dropdown-menu {
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
  border-inline-end: 1px solid var(--border);
}

.nav-dropdown-flyout-slot {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  background: var(--bg-secondary);
}

.nav-dropdown-panel--menu.has-submenu-open .nav-dropdown-flyout-slot {
  display: block;
}

.nav-dropdown-menu-item {
  position: relative;
}

.nav-dropdown-menu-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--text-primary);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown-menu-parent:hover,
.nav-dropdown-menu-item:focus-within > .nav-dropdown-menu-parent {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-dropdown-menu-parent .nav-dropdown-cat-img {
  width: 32px;
  height: 32px;
}

.nav-dropdown-menu-caret {
  margin-inline-start: auto;
  font-size: 0.68rem;
  opacity: 0.55;
  flex-shrink: 0;
  transition: transform var(--transition);
}

[dir="rtl"] .nav-dropdown-menu-caret {
  transform: scaleX(-1);
}

.nav-dropdown-flyout-slot .nav-dropdown-submenu {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-width: 240px;
  max-width: none;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 0;
  background: var(--bg-secondary);
  border: none;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}

.nav-dropdown-flyout-slot .nav-dropdown-submenu.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-dropdown-flyout-slot .nav-dropdown-submenu[hidden] {
  display: none !important;
}

.nav-dropdown-flyout-slot .nav-dropdown-submenu.is-active[hidden] {
  display: block !important;
}

.nav-dropdown-panel--menu.has-submenu-open {
  width: min(560px, calc(100vw - 48px));
  overflow: visible;
}

.nav-dropdown-menu-item.is-submenu-open > .nav-dropdown-menu-parent {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-dropdown-submenu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-dropdown-submenu-list a {
  display: block;
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown-submenu-list a:hover,
.nav-dropdown-submenu-list a:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
}

/* Legacy header */
.header--legacy .nav-dropdown-panel--menu {
  width: min(300px, calc(100vw - 48px));
  overflow: visible;
  transition: width var(--transition);
}

.header--legacy .nav-dropdown-panel--menu.has-submenu-open {
  width: min(560px, calc(100vw - 48px));
}

.header--legacy .nav-dropdown.open .nav-dropdown-panel--menu {
  overflow: visible;
}

/* Mobile categories accordion */
.mobile-nav-categories {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.mobile-nav-categories-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-nav-categories-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.mobile-nav-categories-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-caret {
  font-size: 0.75rem;
  transition: transform var(--transition);
}

.mobile-nav-categories.open .mobile-nav-caret {
  transform: rotate(180deg);
}

.mobile-nav-categories-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 4px;
  max-height: 50vh;
  overflow-y: auto;
}

.mobile-nav-categories.open .mobile-nav-categories-panel {
  display: flex;
}

.mobile-nav-cat-group {
  margin-bottom: 4px;
}

.mobile-nav-cat-parent {
  font-weight: 600;
}

.mobile-nav-cat-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.mobile-nav-subcats {
  padding-inline-start: 44px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-sublink {
  font-size: 0.9rem !important;
  padding: 10px 16px !important;
  color: var(--text-secondary) !important;
}

.mobile-nav-link-all {
  font-weight: 600;
  color: var(--accent) !important;
}

/* Search overlay — modern panel */
.search-overlay {
  padding: 0;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.search-shell {
  width: min(680px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-16px) scale(0.98);
  transition: transform var(--transition);
}

.search-overlay.open .search-shell {
  transform: translateY(0) scale(1);
}

.search-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.search-form {
  padding: 8px;
}

.search-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 52px;
  height: 52px;
  padding-block: 6px;
  padding-inline-start: 18px;
  padding-inline-end: 6px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg-input);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.search-field-icon {
  display: flex;
  align-items: center;
  align-self: center;
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-field input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.05rem;
  line-height: 1.25;
  padding-block: 0;
  padding-inline: 14px;
  color: var(--text-primary);
  box-sizing: border-box;
}

[dir="ltr"] .search-field input {
  direction: ltr;
  text-align: start;
}

[dir="rtl"] .search-field input {
  direction: rtl;
  text-align: start;
}

.search-field input::placeholder {
  color: var(--text-tertiary);
}

.search-field-submit {
  flex: 0 0 auto;
  align-self: center;
  min-width: 5.75rem;
  height: calc(100% - 4px);
  margin-inline-end: 2px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity var(--transition), transform var(--transition);
}

.search-field-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.search-panel .search-suggestions {
  padding: 8px 12px 14px;
}

.search-panel .search-suggestions-title {
  padding: 8px 12px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.search-dismiss {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--text-inverse);
  background: rgba(15, 23, 42, 0.55);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}

.search-dismiss:hover {
  background: rgba(15, 23, 42, 0.75);
}

@media (max-width: 991px) {
  .header-top-inner {
    padding: 6px 12px;
    min-height: 34px;
  }

  .header--legacy .href-after-sales-top {
    display: none !important;
  }

  .header-contact-link span.contact-text {
    display: none;
  }

  .lang-option span:not(.lang-flag) {
    display: none;
  }

  .lang-option {
    padding: 6px 10px;
  }

  .header-main-inner {
    padding: 8px 12px;
    min-height: 60px;
  }

  /* Legacy header only — reference header uses search-bar category dropdown on mobile */
  .header:not(.header--reference) .nav-dropdown-panel {
    display: none !important;
  }
}
/* source: header-reference.css */
/* ==========================================================================
   Al Wadi — 3-tier storefront header (layout inspired by reference only)
   Scoped to .header--reference — uses site design tokens, not competitor colors.
   Rollback: Storefront:HeaderStyle = "legacy" in appsettings.json
   ========================================================================== */

.header.header--reference,
header#mainHeader.header--reference {
  position: relative;
  z-index: 100;
  width: 100%;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.header.header--reference.scrolled {
  box-shadow: var(--shadow-md);
}

.header--reference {
  --href-top-h: 38px;
  --href-nav-h: 50px;
  --href-search-height: 46px;
  --href-search-submit-width: 50px;
  --href-logo-area-w: 280px;
  --href-search-max-w: 420px;
  --href-main-gap: 20px;
  --href-top-padding-x: clamp(24px, 2.5vw, 40px);
  font-family: var(--font-body);
}

.header--reference .href-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--container-padding-x);
  box-sizing: border-box;
}

/* --- Tier 1: Top utility bar --- */
.header--reference .href-top {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.header--reference .href-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--href-top-h);
}

.header--reference .href-top-util,
.header--reference .href-top-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
}

.header--reference .href-top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
}

.header--reference .href-top-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header--reference .href-top-auth:not(:has(.account-auth-link)) {
  display: none;
}

.header--reference .href-top-end .href-top-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header--reference .href-top-end .href-top-auth:not(:has(.account-auth-link)) {
  display: none;
}

.header--reference .href-top-address-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.header--reference .href-top-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}

.header--reference .href-top-link i {
  color: var(--accent);
  font-size: 0.85rem;
}

.header--reference .href-top-link:hover {
  color: var(--accent);
}

.header--reference .href-top-sep {
  color: var(--text-tertiary);
  user-select: none;
}

.header--reference .href-top-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

/* After-Sales utility link (desktop top bar; hidden on ≤991px — see mobile drawer) */
.header--reference .href-after-sales-top {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 32px;
  padding-block: 2px;
}

.header--reference .href-after-sales-top.active {
  color: var(--accent);
}

/* Theme toggle — top bar beside language switcher (all breakpoints) */
.header--reference .href-theme-toggle-top {
  display: inline-flex;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.header--reference .href-lang-wrap {
  position: relative;
}

.header--reference .href-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.header--reference .href-lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.header--reference .href-lang-flag,
.header--reference .lang-flag {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.header--reference .lang-flag-us {
  background-image: url('https://flagcdn.com/w40/us.png');
}

.header--reference .lang-flag-sa {
  background-image: url('https://flagcdn.com/w40/sa.png');
}

.header--reference .href-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 1200;
  min-width: 148px;
  padding: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.header--reference .href-lang-wrap.open .href-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header--reference .href-lang-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: start;
  cursor: pointer;
  transition: all var(--transition);
}

.header--reference .href-lang-menu button:hover,
.header--reference .href-lang-menu button.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* --- Tier 2: Logo, search, cart --- */
.header--reference .href-main {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.header--reference .href-main-inner {
  display: flex;
  align-items: center;
  gap: var(--href-main-gap);
  padding: 12px 0;
  min-height: 88px;
  overflow: visible;
}

.header--reference .href-main {
  overflow: visible;
}

.header--reference .href-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.header--reference .href-logo .logo-icon {
  height: min(var(--logo-max-h), 92px);
  min-height: 58px;
  max-height: 96px;
  width: 100%;
  max-width: var(--href-logo-area-w);
  padding-inline: 6px;
}

.header--reference .href-logo .brand-logo {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.header--reference .href-search {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--href-search-max-w);
  min-width: 0;
  margin-inline: auto;
  height: var(--href-search-height);
  min-height: var(--href-search-height);
  max-height: var(--href-search-height);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: visible;
  position: relative;
  background: var(--bg-input);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.header--reference .href-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.header--reference .href-search-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  padding-block: 0;
  padding-inline: 16px;
  font-size: 0.95rem;
  line-height: 1.25;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: transparent;
  box-sizing: border-box;
}

[dir="ltr"] .header--reference .href-search-input {
  direction: ltr;
  text-align: start;
}

[dir="rtl"] .header--reference .href-search-input {
  direction: rtl;
  text-align: start;
}

.header--reference .href-search-input::placeholder {
  color: var(--text-tertiary);
}

.header--reference .href-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--href-search-submit-width);
  width: var(--href-search-submit-width);
  min-width: var(--href-search-submit-width);
  height: 100%;
  padding: 0;
  border: none;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-size: 1.05rem;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity var(--transition), transform var(--transition);
  border-radius: 0;
  border-start-end-radius: calc(var(--radius-md) - 1px);
  border-end-end-radius: calc(var(--radius-md) - 1px);
}



.header--reference .href-search-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.header--reference .href-nav-dropdown-panel {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 1300;
  overflow: visible;
}

.header--reference .href-nav-dropdown-panel .nav-dropdown-panel {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  display: none;
  width: min(300px, calc(100vw - 48px));
  max-height: min(75vh, 520px);
  overflow: visible;
  padding: 10px 0 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transition: width var(--transition);
}

.header--reference .nav-dropdown.open .href-nav-dropdown-panel .nav-dropdown-panel {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.header--reference .nav-dropdown-panel--menu.has-submenu-open {
  width: min(560px, calc(100vw - 48px));
}

.header--reference .nav-dropdown-flyout-slot .nav-dropdown-submenu {
  z-index: 2;
}

.header--reference .href-main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

/* Desktop: logo column | centered search | actions */
@media (min-width: 992px) {
  .header--reference {
    --href-logo-area-w: 340px;
    --href-search-max-w: 440px;
    --href-main-gap: 22px;
    --logo-max-h: 96px;
    --logo-max-w: 340px;
  }

  .header--reference .href-main-inner {
    display: grid;
    grid-template-columns: var(--href-logo-area-w) minmax(0, 1fr) auto;
    grid-template-areas: "logo search actions";
    align-items: center;
    column-gap: var(--href-main-gap);
    row-gap: 0;
    min-height: 96px;
  }

  .header--reference .href-logo {
    grid-area: logo;
    width: var(--href-logo-area-w);
    max-width: var(--href-logo-area-w);
  }

  .header--reference .href-logo .logo-icon {
    height: min(96px, var(--logo-max-h, 96px));
    min-height: 64px;
    max-height: 96px;
    max-width: var(--href-logo-area-w);
  }

  .header--reference .href-search {
    grid-area: search;
    justify-self: center;
    width: min(100%, var(--href-search-max-w));
    max-width: var(--href-search-max-w);
    margin-inline: auto;
    flex: none;
  }

  .header--reference .href-main-actions {
    grid-area: actions;
    justify-self: end;
    margin-inline-start: 0;
  }
}

@media (min-width: 1200px) {
  .header--reference {
    --href-logo-area-w: 360px;
    --href-search-max-w: 460px;
    --href-main-gap: 26px;
    --logo-max-h: 100px;
    --logo-max-w: 360px;
  }

  .header--reference .href-main-inner {
    min-height: 100px;
  }

  .header--reference .href-logo .logo-icon {
    max-height: 100px;
    height: min(100px, var(--logo-max-h, 100px));
    min-height: 66px;
  }
}

.header--reference .href-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 1.15rem;
  transition: all var(--transition);
}

.header--reference .href-icon-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.header--reference .href-icon-btn .badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  background: var(--accent);
  color: var(--text-inverse);
}

.header--reference .href-cart-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: start;
}

.header--reference .href-cart-box:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.header--reference .href-cart-icon-wrap {
  position: relative;
  color: var(--accent);
  font-size: 1.45rem;
}

.header--reference .href-cart-count {
  position: absolute;
  top: -6px;
  inset-inline-end: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header--reference .href-cart-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.header--reference .href-cart-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header--reference .href-cart-amount {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* --- Tier 3: Categories + navigation --- */
.header--reference .href-nav {
  background: var(--bg-footer);
  border-bottom: 1px solid rgba(0, 180, 216, 0.12);
  overflow: visible;
}

.header--reference .href-nav-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: var(--href-nav-h);
  overflow: visible;
}

.header--reference .href-nav-cat {
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.header--reference .href-categories-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: var(--href-nav-h);
  padding-block: 0;
  padding-inline-end: 24px;
  padding-inline-start: 24px;
  border: none;
  font-family: inherit;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

@media (min-width: 992px) {
  .header--reference .href-nav {
    --href-cat-bleed: calc((100vw - min(100vw, var(--container))) / 2 + var(--container-padding-x));
  }

  .header--reference .href-nav-cat::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 100%;
    width: var(--href-cat-bleed);
    background: var(--accent-gradient);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    z-index: 0;
    pointer-events: none;
  }

  .header--reference .href-nav-cat.nav-dropdown.open::before,
  .header--reference .href-nav-cat:has(.href-categories-btn:hover)::before {
    opacity: 0.95;
    box-shadow: var(--shadow-glow);
  }

  .header--reference .href-categories-btn {
    position: relative;
    z-index: 1;
    margin-inline-start: calc(-1 * var(--href-cat-bleed));
    padding-inline-start: calc(24px + var(--href-cat-bleed));
  }

  .header--reference .href-nav-cat .href-nav-dropdown-panel {
    inset-inline-start: calc(-1 * var(--href-cat-bleed));
  }
}

.header--reference .href-categories-btn:hover {
  opacity: 0.95;
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow);
}

.header--reference .href-nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}

.header--reference .href-nav-links::-webkit-scrollbar {
  display: none;
}

.header--reference .href-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  min-height: var(--href-nav-h);
  color: var(--text-on-footer);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.header--reference .href-nav-links a:hover {
  background: rgba(0, 180, 216, 0.15);
  color: #fff;
}

.header--reference .href-nav-links a.active {
  background: rgba(0, 180, 216, 0.22);
  color: #fff;
}

.header--reference .href-nav-links .nav-maintenance-link {
  cursor: pointer;
}

.header--reference .href-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.header--reference .href-mobile-toggle:hover {
  background: var(--accent-light);
}

.header--reference .href-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.header--reference .href-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header--reference .href-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.header--reference .href-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.header--reference .nav-dropdown.open .href-categories-btn {
  box-shadow: var(--shadow-glow);
}

/* Hide legacy markup if present inside reference shell */
.header--reference .header-top,
.header--reference .header-main,
.header--reference .header-search-trigger,
.header--reference .nav:not(.href-nav-links),
.header--reference .header-actions {
  display: none !important;
}

/* --- Desktop top bar: phone | address | auth + lang + theme --- */
@media (min-width: 992px) {
  .header--reference .href-top .href-container {
    padding-inline: var(--href-top-padding-x);
  }

  .header--reference .href-top-contact,
  .header--reference .href-top-actions {
    display: contents;
  }

  .header--reference .href-top-phone {
    order: 1;
  }

  .header--reference .href-top-address-slot {
    order: 2;
  }

  .header--reference .href-top-end {
    order: 3;
    margin-inline-start: auto;
    gap: 10px;
  }

  .header--reference .href-top-end .href-lang-wrap {
    padding-inline-start: 10px;
    margin-inline-start: 2px;
    border-inline-start: 1px solid var(--border);
  }
}

/* --- Tablet / mobile top bar --- */
@media (max-width: 991px) {
  .header--reference .href-top {
    font-size: 0.72rem;
  }

  .header--reference .href-top-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-block: 6px;
    min-height: 0;
  }

  /* Row 1: phone + short address */
  .header--reference .href-top-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 10px;
    width: 100%;
    min-width: 0;
  }

  .header--reference .href-top-phone {
    flex: 0 0 auto;
    font-size: 0.72rem;
    min-height: 28px;
  }

  .header--reference .href-top-phone span[dir="ltr"] {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .header--reference .href-top-address-slot {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    margin-inline-start: auto;
    gap: 4px;
  }

  /* Row 2: login/register (or account) + lang + theme */
  .header--reference .href-top-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    width: 100%;
    min-width: 0;
  }

  .header--reference .href-top-end {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    flex: 1 1 auto;
    min-width: 0;
    margin-inline-start: 0;
  }

  .header--reference .href-top-end .href-top-auth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .header--reference .href-top-end .href-lang-wrap {
    padding-inline-start: 0;
    margin-inline-start: 0;
    border-inline-start: none;
  }

  /* Keep mobile top row clean — After-Sales lives in the hamburger drawer */
  .header--reference .href-after-sales-top {
    display: none !important;
  }

  .header--reference .href-top-link span[data-en="Hotline:"],
  .header--reference .href-top-link span[data-ar="الخط الساخن:"] {
    display: none;
  }

  .header--reference .href-top-sep--auth,
  .header--reference .store-short-address-sep {
    display: none;
  }

  .header--reference .href-top-auth .account-auth-link {
    min-height: 28px;
    padding: 2px 4px;
  }

  .header--reference .href-top-auth .account-auth-sep {
    margin-inline: 2px;
  }

  .header--reference .store-short-address {
    gap: 4px 6px;
  }

  .header--reference .store-short-address__label {
    font-size: 0.65rem;
  }

  .header--reference .store-short-address__box {
    min-width: 1.15rem;
    height: 1.15rem;
    font-size: 0.58rem;
  }

  .header--reference .href-theme-toggle-top {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .header--reference .href-lang-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .header--reference .account-menu--compact .account-menu__toggle--compact {
    padding: 3px 8px 3px 3px;
  }

  .header--reference .account-menu__name--compact {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header--reference .href-main-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 10px 0;
    min-height: 0;
  }

  .header--reference {
    --href-search-height: 44px;
    --href-search-submit-width: 46px;
    --href-logo-area-w: 220px;
    --href-search-max-w: 100%;
    --logo-max-h: 76px;
    --logo-max-w: 220px;
  }

  .header--reference .href-logo {
    flex: 1 1 auto;
    max-width: min(var(--href-logo-area-w), 52vw);
  }

  .header--reference .href-logo .logo-icon {
    height: min(var(--logo-max-h), 76px);
    min-height: 52px;
    max-height: 80px;
    max-width: 100%;
  }

  .header--reference .href-search {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: min(480px, 100%);
    margin-inline: auto;
  }

  .header--reference .href-nav-dropdown-panel {
    inset-inline: 0;
    width: 100%;
    max-width: 100%;
  }

  .header--reference .nav-dropdown.open .href-nav-dropdown-panel .nav-dropdown-panel {
    display: block !important;
    width: 100%;
    max-width: 100%;
    max-height: min(65vh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header--reference .nav-dropdown-panel-body {
    flex-direction: column;
    max-height: none;
  }

  .header--reference .nav-dropdown-panel--menu.has-submenu-open .nav-dropdown-menu {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    border-inline-end: none;
  }

  .header--reference .nav-dropdown-flyout-slot {
    border-top: 1px solid var(--border);
  }

  .header--reference .nav-dropdown-flyout-slot .nav-dropdown-submenu {
    position: static;
    display: none !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .header--reference .nav-dropdown-flyout-slot .nav-dropdown-submenu.is-active {
    display: block !important;
  }

  .header--reference .nav-dropdown-menu-caret {
    transform: rotate(90deg);
  }

  [dir="rtl"] .header--reference .nav-dropdown-menu-caret {
    transform: rotate(-90deg);
  }

  .header--reference .href-cart-label,
  .header--reference .href-cart-text {
    display: none;
  }

  .header--reference .href-cart-box {
    padding: 8px 12px;
  }

  .header--reference .href-top-end {
    gap: 6px;
  }

  .header--reference .href-nav {
    display: none;
  }

  .header--reference .href-mobile-toggle {
    display: flex;
  }

  .header--reference .href-logo .brand-logo {
    max-width: 100%;
  }
}

/* --- Mobile --- */
@media (max-width: 480px) {
  .header--reference {
    --href-logo-area-w: 184px;
    --href-main-gap: 10px;
    --logo-max-h: 68px;
    --logo-max-w: 184px;
  }

  .header--reference .href-main-inner {
    gap: 10px 12px;
  }

  .header--reference .href-logo .logo-icon {
    height: min(var(--logo-max-h), 68px);
    min-height: 48px;
    max-height: 72px;
  }

  .header--reference .href-search {
    max-width: 100%;
  }

  .header--reference .href-main-actions {
    gap: 4px;
  }
  .header--reference .href-container {
    padding: 0 12px;
  }

  .header--reference .href-top {
    font-size: 0.75rem;
  }

  .header--reference .href-top-link span[dir="ltr"] {
    font-size: 0.72rem;
  }

  .header--reference .href-lang-btn span:not(.lang-flag):not(.href-lang-flag) {
    display: none;
  }

  .header--reference {
    --href-search-submit-width: 46px;
  }
}

/* ===== "Maintenance Request" nav group (Radar DR-0021) =====
   One entry that groups Request a Visit, Home Maintenance, Periodic Maintenance
   and Maintenance Contracts. Desktop: hover / click dropdown. Mobile: <details>. */
@media (min-width: 992px) {
  /* The links strip scrolls horizontally, which would clip the dropdown. */
  .header--reference .href-nav-links:has(.nav-group) {
    overflow: visible;
  }
}

.header--reference .nav-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.header--reference .nav-group__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  min-height: var(--href-nav-h);
  border: 0;
  background: transparent;
  color: var(--text-on-footer);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.header--reference .nav-group__toggle:hover,
.header--reference .nav-group.open .nav-group__toggle {
  background: rgba(0, 180, 216, 0.15);
  color: #fff;
}

.header--reference .nav-group__toggle.active {
  background: rgba(0, 180, 216, 0.22);
  color: #fff;
}

.header--reference .nav-group__caret {
  font-size: 0.65rem;
  transition: transform var(--transition);
}

.header--reference .nav-group__panel {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 1100;
  min-width: 240px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.header--reference .nav-group.open .nav-group__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header--reference .nav-group.open .nav-group__caret {
  transform: rotate(180deg);
}

@media (hover: hover) and (min-width: 992px) {
  .header--reference .nav-group:hover .nav-group__panel,
  .header--reference .nav-group:focus-within .nav-group__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .header--reference .nav-group:hover .nav-group__caret {
    transform: rotate(180deg);
  }
}

.header--reference .href-nav-links .nav-group__panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
}

.header--reference .href-nav-links .nav-group__panel a i {
  width: 18px;
  text-align: center;
  color: var(--accent);
}

.header--reference .href-nav-links .nav-group__panel a:hover,
.header--reference .href-nav-links .nav-group__panel a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Mobile drawer */
.mobile-nav .mobile-nav-group {
  width: 100%;
}

.mobile-nav .mobile-nav-group__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  transition: all var(--transition);
}

.mobile-nav .mobile-nav-group__toggle::-webkit-details-marker {
  display: none;
}

.mobile-nav .mobile-nav-group__toggle:hover,
.mobile-nav .mobile-nav-group__toggle.active {
  background: var(--accent-light);
  color: var(--accent);
}

.mobile-nav .mobile-nav-group__caret {
  margin-inline-start: auto;
  font-size: 0.75rem;
  transition: transform var(--transition);
}

.mobile-nav .mobile-nav-group[open] .mobile-nav-group__caret {
  transform: rotate(180deg);
}

.mobile-nav .mobile-nav-group__items {
  padding-inline-start: 18px;
}

.mobile-nav .mobile-nav-group__items a {
  padding-block: 11px;
  font-size: 0.95rem;
}

/* fa-phone-alt is the mirrored handset: right for RTL, backwards in English. */
html:not([dir="rtl"]) .header--reference .href-top-phone i {
  transform: scaleX(-1);
}

/* ===== Pinned search + cart on scroll (Radar DR-0026) ===== */
/* backdrop-filter on the header would make it the containing block of the fixed bar. */
.header.header--reference.header--pinned,
header#mainHeader.header--reference.header--pinned {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header--reference.header--pinned .href-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: href-pin-in .2s ease-out;
}

.header--reference.header--pinned .href-main-inner {
  min-height: 0;
  padding-block: 8px;
  justify-content: space-between;
  gap: 14px;
}

.header--reference.header--pinned .href-logo {
  flex: 0 0 auto;
}

.header--reference.header--pinned .href-logo img {
  max-height: 46px;
  width: auto;
}

/* Pinned bar: full Alwadi logo + search + cart (wishlist and menu button hidden). */
.header--reference.header--pinned .href-main-actions .href-icon-btn,
.header--reference.header--pinned .href-main-actions .href-mobile-toggle {
  display: none !important;
}

.header--reference.header--pinned .href-search {
  flex: 1 1 auto;
  max-width: 640px;
  margin: 0;
}

/* Phones: one row — search then cart. */
.header--reference.header--pinned .href-main-inner {
  flex-wrap: nowrap;
}

.header--reference.header--pinned .href-search {
  order: 0;
  min-width: 0;
}

.header--reference.header--pinned .href-main-actions {
  order: 1;
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .header--reference.header--pinned .href-main-inner {
    gap: 10px;
  }

  /* Phones: no logo in the pinned bar — the search takes the space. */
  .header--reference.header--pinned .href-logo {
    display: none;
  }

  .header--reference.header--pinned .href-search {
    flex: 1 1 0;
  }
}

@keyframes href-pin-in {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .header--reference.header--pinned .href-main { animation: none; }
}

/* ===== Tablets 768–991px: one header row + visible categories/menu bar =====
   With the shorter main menu everything fits, so tablets no longer get the phone layout
   (search pushed to its own row, categories bar hidden behind the hamburger). */
@media (min-width: 768px) and (max-width: 991px) {
  .header--reference .href-top-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .header--reference .href-top-contact,
  .header--reference .href-top-actions {
    width: auto;
  }

  .header--reference .href-main-inner {
    flex-wrap: nowrap;
    gap: 16px;
  }

  .header--reference .href-logo {
    flex: 0 0 auto;
    max-width: 200px;
  }

  .header--reference .href-search {
    order: 0;
    flex: 1 1 auto;
    width: auto;
    max-width: 420px;
    margin-inline: auto;
  }

  .header--reference .href-nav {
    display: block;
  }

  .header--reference .href-nav-links:has(.nav-group) {
    overflow: visible;
  }

  .header--reference .href-nav-links a,
  .header--reference .nav-group__toggle {
    padding: 0 12px;
  }

  /* Categories dropdown: desktop-size panel instead of the full-width phone version. */
  .header--reference .href-nav-cat .href-nav-dropdown-panel {
    inset-inline: 0 auto;
    width: auto;
    max-width: none;
  }

  .header--reference .nav-dropdown.open .href-nav-dropdown-panel .nav-dropdown-panel {
    width: min(320px, calc(100vw - 32px));
    max-width: none;
  }

  .header--reference .href-mobile-toggle {
    display: none;
  }
}

/* source: account-menu.css */
/* Header account menu (name button + dropdown).
   Loaded on every page: the header is global, so these rules must not live only in account-pages.css. */
.account-menu {
  position: relative;
}

.account-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.account-menu__toggle:hover {
  border-color: var(--accent);
}

.account-menu__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.account-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-menu__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__caret {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.account-menu__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 1200;
  min-width: 220px;
  padding: 8px 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  list-style: none;
  margin: 0;
}

.account-menu.is-open .account-menu__dropdown {
  display: block;
}

.account-menu__header {
  padding: 10px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-menu__header-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.account-menu__header-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.account-menu__logout-form {
  margin: 0;
}

.account-menu__logout {
  width: 100%;
  border: none;
  background: none;
  text-align: inherit;
  cursor: pointer;
  color: #c0392b;
}

.account-menu__logout:hover {
  background: rgba(192, 57, 43, 0.08);
}

.header--reference .href-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header--reference .href-top-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.account-menu--compact .account-menu__toggle--compact {
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: var(--bg-card);
}

.account-menu__name--compact {
  max-width: 88px;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .account-menu__name--compact {
    max-width: 64px;
  }
}

.header--legacy .header-actions .account-menu {
  margin-inline-start: 4px;
}

html[dir="rtl"] .account-menu__dropdown {
  text-align: right;
}

.account-menu__dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-decoration: none;
}

.account-menu__dropdown .dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.account-menu__dropdown .dropdown-divider {
  margin: 6px 0;
  border-color: var(--border);
}

@media (max-width: 600px) {
  .account-menu__name {
    display: none;
  }
}

/* Below 992px the top bar wraps and the account button sits at the start edge,
   so open the dropdown from that edge instead of off-screen. */
@media (max-width: 991px) {
  .header--reference .account-menu__dropdown {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }
}

/* source: store-short-address.css */
/* Store national short address — top navbar boxed display */
.store-short-address {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-width: 100%;
}

.store-short-address__label {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: inherit;
}

.store-short-address__boxes {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.store-short-address__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.2rem;
  margin-inline-start: -1px;
  border: 1px solid rgba(100, 116, 139, 0.55);
  background: var(--bg-primary, #fff);
  color: var(--text-primary);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

.store-short-address__box:first-child {
  margin-inline-start: 0;
  border-start-start-radius: 3px;
  border-end-start-radius: 3px;
}

.store-short-address__box:last-child {
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
}

.store-short-address-sep {
  user-select: none;
}

/* Legacy header top bar — mobile address row */
@media (max-width: 991px) {
  .header--legacy .header-top-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding-block: 6px;
  }

  .header--legacy .header-contacts {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px 12px;
  }

  .header--legacy .header-contacts .href-top-address-slot,
  .header--legacy .header-contacts .store-short-address {
    flex: 1 1 100%;
  }

  .header--legacy .header-contacts .store-short-address-sep {
    display: none;
  }

  .header--legacy .lang-switch {
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .store-short-address__box {
    min-width: 1.2rem;
    height: 1.2rem;
    font-size: 0.6rem;
  }

  .store-short-address__label {
    font-size: 0.65rem;
  }
}
/* source: search-autocomplete.css */
/* Search autocomplete — header + overlay */
.search-autocomplete {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline: 0;
  z-index: 1200;
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: min(70vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.search-autocomplete[hidden] {
  display: none !important;
}

.search-autocomplete.open {
  display: block;
}

.search-autocomplete-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  transition: background var(--transition);
}

.search-autocomplete-item:hover,
.search-autocomplete-item:focus-visible {
  background: var(--accent-light);
  outline: none;
}

.search-autocomplete-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-autocomplete-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-autocomplete-thumb i {
  color: var(--text-tertiary);
  font-size: 1.1rem;
}

.search-autocomplete-body {
  flex: 1;
  min-width: 0;
}

.search-autocomplete-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-autocomplete-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.search-autocomplete-cat {
  color: var(--text-tertiary);
}

.search-autocomplete-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
}

.search-autocomplete-price s {
  font-weight: 500;
  color: var(--text-tertiary);
  margin-inline-end: 6px;
  font-size: 0.78rem;
}

.search-autocomplete-empty,
.search-autocomplete-loading {
  padding: 20px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.search-autocomplete-loading i {
  color: var(--accent);
  margin-inline-end: 8px;
}

/* Header reference search bar */
.header--reference .href-search .search-autocomplete {
  inset-inline-start: 0;
  inset-inline-end: 0;
  width: 100%;
  max-width: min(100%, calc(100vw - 24px));
  min-width: 0;
}

/* Search overlay */
.search-field-wrap {
  position: relative;
}

.search-overlay .search-autocomplete {
  top: calc(100% + 8px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.search-overlay.open .search-suggestions-title,
.search-overlay.open .search-suggestions {
  transition: opacity var(--transition);
}

.search-overlay.has-autocomplete-open .search-suggestions-title,
.search-overlay.has-autocomplete-open .search-suggestions {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 640px) {
  .search-autocomplete {
    max-height: min(55vh, 360px);
  }

  .search-autocomplete-thumb {
    width: 44px;
    height: 44px;
  }

  .search-autocomplete-name {
    font-size: 0.88rem;
  }
}
/* source: components.css */
/* Shared product cards and catalog card chrome. Homepage sections live in home-components.css. */
/* ===== PRODUCT CARDS ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  align-items: stretch;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
}
.product-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-product-hover);
  border-color: var(--border-product-hover);
}
.product-image,
.product-img,
.product-info {
  position: relative;
  pointer-events: none;
}
.product-card-actions,
.product-wishlist-btn,
.add-to-cart-btn,
.product-cart-btn,
.product-rating,
.product-rating-link {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.product-image {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-product-media);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 8px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-light);
}
.product-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-product-media);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 8px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-light);
}
.product-image img,
.product-img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform var(--transition);
}
.product-card:hover .product-image img,
.product-card:hover .product-img img {
  transform: scale(1.04);
}
/* Bottom row: primary Add to Cart + compact wishlist icon */
.product-card-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
  width: 100%;
}
.product-card-actions .add-to-cart-btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
}
.product-wishlist-btn {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.product-wishlist-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}
.product-wishlist-btn.wishlisted,
.product-wishlist-btn.wishlisted:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}
.product-wishlist-btn i.fa-heart {
  transition: color 0.25s ease, transform 0.2s ease;
}
.product-wishlist-btn.wishlisted i.fa-heart {
  color: #ef4444;
}
.product-wishlist-btn:active {
  transform: scale(0.96);
}
.product-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 3;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.product-badge.sale { background: var(--danger); color: #fff; }
.product-badge.new { background: var(--success); color: #fff; }

/* Diagonal corner ribbon — opposite corner from .product-badge (start vs end) */
.product-image,
.product-img {
  --install-ribbon-size: clamp(76px, 27%, 112px);
}

.product-install-ribbon {
  position: absolute;
  z-index: 3;
  top: 0;
  inset-inline-end: 0;
  width: var(--install-ribbon-size);
  height: var(--install-ribbon-size);
  overflow: hidden;
  pointer-events: none;
}

.product-install-ribbon__band {
  position: absolute;
  top: 15px;
  inset-inline-end: -38px;
  width: 152px;
  padding: 5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  transform-origin: center;
  background: linear-gradient(
    135deg,
    rgba(8, 28, 48, 0.96) 0%,
    rgba(0, 90, 130, 0.94) 48%,
    rgba(0, 168, 210, 0.9) 100%
  );
  box-shadow:
    0 4px 14px rgba(0, 25, 45, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  border-block: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .product-install-ribbon__band {
  inset-inline-end: auto;
  inset-inline-start: -38px;
  transform: rotate(-45deg);
}

.product-install-ribbon__text {
  display: block;
  max-width: 92%;
  padding: 0 4px;
  font-size: clamp(0.52rem, 2.1vw, 0.64rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[lang="en"] .product-install-ribbon__text {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-install-ribbon--detail {
  --install-ribbon-size: clamp(96px, 16%, 136px);
}

.product-install-ribbon--detail .product-install-ribbon__band {
  top: 22px;
  inset-inline-end: -44px;
  width: 188px;
  padding: 7px 0;
}

[dir="rtl"] .product-install-ribbon--detail .product-install-ribbon__band {
  inset-inline-end: auto;
  inset-inline-start: -44px;
}

.product-install-ribbon--detail .product-install-ribbon__text {
  font-size: clamp(0.58rem, 1.1vw, 0.76rem);
}

@media (max-width: 480px) {
  .product-image,
  .product-img {
    --install-ribbon-size: clamp(68px, 30%, 92px);
  }

  .product-install-ribbon__band {
    top: 13px;
    inset-inline-end: -40px;
    width: 138px;
    padding: 4px 0;
  }

  [dir="rtl"] .product-install-ribbon__band {
    inset-inline-start: -40px;
  }

  .product-install-ribbon__text {
    font-size: clamp(0.48rem, 2.4vw, 0.58rem);
  }
}

[data-theme="dark"] .product-install-ribbon__band {
  background: linear-gradient(
    135deg,
    rgba(6, 20, 36, 0.98) 0%,
    rgba(0, 75, 110, 0.96) 50%,
    rgba(0, 150, 190, 0.92) 100%
  );
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pd-magnifier-wrap {
  position: relative;
}
.product-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-card);
}
.product-category {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.4;
  min-height: calc(1.4em * 2);
  max-height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.product-name a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}
.product-image-placeholder {
  font-size: 3rem;
  color: var(--text-tertiary);
}
.product-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 12px;
  min-height: 2.6rem;
}
.product-price .current { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.product-price .original { font-size: 0.9rem; color: var(--text-tertiary); text-decoration: line-through; }

.product-price-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.product-price-display__main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.product-price-display__current {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.product-price-display__original {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-decoration: line-through;
}
.product-price-display__badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.product-price-display__vat-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.2;
}
.product-price-display__before-tax {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.2;
}
.product-price-display__before-tax .price-with-currency {
  font-size: inherit;
  color: inherit;
  font-weight: 500;
}
.product-price-display--compact .product-price-display__current {
  font-size: 1.1rem;
}
.product-price-display--compact .product-price-display__before-tax {
  font-size: 0.72rem;
}

.price-vat-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}
.price-vat-stack__inc {
  font-weight: 700;
  color: var(--accent);
}
.price-vat-stack__original {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-decoration: line-through;
}
.price-vat-stack__ex {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.cart-summary-note {
  margin: 8px 0 14px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.price-vat-stack__hint {
  font-weight: 400;
}

.search-autocomplete-price--vat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.search-autocomplete-price-ex {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.checkout-line-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.summary-row--vat {
  font-weight: 600;
}

/* Currency: see sar-currency.css — .price-with-currency */
.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  min-height: 1.25rem;
  line-height: 1.25rem;
}
.product-rating-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  min-height: 1.25rem;
}
.product-rating-link:hover .product-rating-value,
.product-rating-link:hover .product-rating-count,
.product-rating-link:hover .product-rating-empty {
  color: var(--accent);
}
.product-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.product-rating .fas.fa-star,
.product-rating .fas.fa-star-half-alt {
  color: #f59e0b;
  font-size: 0.75rem;
}
.product-rating .far.fa-star {
  color: var(--border);
  font-size: 0.75rem;
}
.product-rating-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, var(--text));
  white-space: nowrap;
}
.product-rating-count,
.product-rating-empty {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme='dark'] .product-rating .far.fa-star {
  color: #64748b;
}
.add-to-cart-btn,
.product-cart-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  margin-top: auto;
  white-space: nowrap;
}
.product-card-actions .add-to-cart-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-to-cart-btn:hover,
.product-cart-btn:hover {
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
  transform: translateY(-1px);
}
.add-to-cart-btn.in-cart,
.product-cart-btn.in-cart,
.pd-btn-cart.in-cart {
  background: var(--success, #10b981);
  border-color: var(--success, #10b981);
  color: #fff;
}
.add-to-cart-btn.in-cart:hover,
.product-cart-btn.in-cart:hover,
.pd-btn-cart.in-cart:hover {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

/* Card variants — unified surfaces */
.product-card.homepage-card,
.product-card.related-card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: none;
}
.product-card.homepage-card:hover,
.product-card.related-card:hover {
  box-shadow: var(--shadow-product-hover);
  border-color: var(--border-product-hover);
}
.product-card.homepage-card .product-info,
.product-card.related-card .product-info {
  background: var(--bg-card);
  padding: 16px;
}
.product-card.related-card .product-name {
  font-size: 0.95rem;
  min-height: calc(1.4em * 2);
  max-height: calc(1.4em * 2);
}

/* Services in the search dropdown (same as search-autocomplete.css; the home page loads this bundle instead). */
.search-autocomplete-group {
  padding: 10px 14px 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.search-autocomplete-thumb--service {
  background: rgba(0, 180, 216, 0.12) !important;
  color: var(--accent, #00b4d8);
}

.search-autocomplete-item--service .search-autocomplete-cat {
  white-space: normal;
}
