/* ==========================================================================
   ELMIR TOOLS & CO - Official Catalog Stylesheet
   Modern Automotive Theme: Cobalt / Royal Blue Accent
   Full Dark Mode & White/Light Mode Support
   Bilingual English (LTR) & Arabic (RTL) Support
   ========================================================================== */

/* --- Root & Theme Variables --- */
:root {
  /* Dynamic Blue Accent Palette */
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #3b82f6;
  --accent-blue-subtle: rgba(37, 99, 235, 0.12);
  --accent-blue-glow: rgba(37, 99, 235, 0.28);
  
  --accent-cyan: #0284c7;
  --accent-cyan-subtle: rgba(2, 132, 199, 0.12);
  --accent-whatsapp: #25d366;
  --accent-whatsapp-hover: #22c55e;
  --danger: #ef4444;
  
  /* Typography */
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Theme: DARK (Default)
   ========================================================================== */
body.theme-dark,
:root:not(.theme-light) {
  --bg-primary: #0b0f17;
  --bg-secondary: #131b26;
  --bg-card: #182232;
  --bg-card-hover: #1f2c40;
  --bg-input: #1a2536;
  --bg-elevated: #223046;
  --bg-topbar: #06090e;
  --bg-footer: #06090e;
  --bg-img-wrap: #ffffff;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: var(--accent-blue-light);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.45);
  
  --hero-bg-grad: linear-gradient(180deg, rgba(19, 27, 38, 0.8) 0%, rgba(11, 15, 23, 1) 100%),
                 radial-gradient(ellipse at 50% -20%, rgba(37, 99, 235, 0.2), transparent 70%);
  --hero-title-grad: linear-gradient(135deg, #ffffff 30%, #60a5fa 100%);
  --header-bg: rgba(11, 15, 23, 0.92);
}

/* ==========================================================================
   Theme: LIGHT / WHITE MODE
   ========================================================================== */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-topbar: #0f172a;
  --bg-footer: #0f172a;
  --bg-img-wrap: #f8fafc;
  
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-focus: var(--accent-blue);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.15);
  --shadow-card-hover: 0 12px 28px rgba(37, 99, 235, 0.12);
  
  --hero-bg-grad: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%),
                 radial-gradient(ellipse at 50% -20%, rgba(37, 99, 235, 0.12), transparent 70%);
  --hero-title-grad: linear-gradient(135deg, #0f172a 20%, #2563eb 100%);
  --header-bg: rgba(255, 255, 255, 0.92);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-en);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

[dir="rtl"] body,
[dir="rtl"] {
  font-family: var(--font-ar);
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Top Info Bar
   ========================================================================== */
.top-bar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  padding: 0.45rem 0;
  color: #94a3b8;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.top-info a:hover {
  color: var(--accent-blue-light);
}

.top-info i {
  color: var(--accent-blue-light);
  margin-right: 0.25rem;
}

[dir="rtl"] .top-info i {
  margin-right: 0;
  margin-left: 0.25rem;
}

.divider {
  color: rgba(255, 255, 255, 0.2);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme Toggle Button */
.btn-theme,
.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  transition: all var(--transition-fast);
}

.btn-theme:hover,
.btn-lang:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.btn-theme i {
  color: #fbbf24; /* Sun icon gold */
}

body.theme-light .btn-theme i {
  color: #60a5fa; /* Moon icon soft blue */
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

body.theme-light .main-header {
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 4px 14px var(--accent-blue-glow);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: block;
}

.accent-text {
  color: var(--accent-blue);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

/* Header Search */
.header-search-wrapper {
  flex: 1;
  max-width: 540px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: 1rem;
}

.search-input-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.65rem 2.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-normal);
}

.search-input-box input:focus {
  border-color: var(--accent-blue);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.btn-clear-search {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 0.2rem;
}

[dir="rtl"] .btn-clear-search {
  right: auto;
  left: 1rem;
}

.btn-clear-search:hover {
  color: var(--text-primary);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-quote-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.btn-quote-cart:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
}

.quote-badge {
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-whatsapp-direct {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-whatsapp);
  color: #ffffff;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all var(--transition-fast);
}

.btn-whatsapp-direct:hover {
  background: var(--accent-whatsapp-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  background: var(--hero-bg-grad);
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal);
}

.hero-content {
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--accent-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-gradient {
  background: var(--hero-title-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.5rem;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--accent-blue);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Categories Nav
   ========================================================================== */
.catalog-section {
  padding: 2.5rem 0 4rem;
}

.categories-nav-wrapper {
  margin-bottom: 2rem;
  position: relative;
}

.categories-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-elevated) transparent;
}

.categories-scroll::-webkit-scrollbar {
  height: 4px;
}

.categories-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.cat-pill i {
  color: var(--accent-blue);
  font-size: 0.95rem;
}

.cat-pill-count {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.cat-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.cat-pill.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  font-weight: 800;
  box-shadow: 0 4px 14px var(--accent-blue-glow);
}

.cat-pill.active i {
  color: #ffffff;
}

.cat-pill.active .cat-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Catalog Toolbar
   ========================================================================== */
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-counter {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.results-counter strong {
  color: var(--accent-blue);
}

.active-filter-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.filter-tag-badge button {
  color: inherit;
  font-size: 0.75rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--accent-blue);
}

.view-mode-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.btn-view {
  padding: 0.45rem 0.65rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-view.active {
  background: var(--accent-blue);
  color: #ffffff;
}

/* ==========================================================================
   Product Grid & Cards
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: var(--shadow-card-hover);
}

.product-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-img-wrap);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.product-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.06);
}

.ref-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.4);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

[dir="rtl"] .ref-badge {
  left: auto;
  right: 0.75rem;
}

.part-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--accent-blue-subtle);
  backdrop-filter: blur(6px);
  color: var(--accent-blue);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

[dir="rtl"] .part-badge {
  right: auto;
  left: 0.75rem;
}

.product-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.product-title-en {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.product-title-ar {
  font-family: var(--font-ar);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .product-title-ar {
  font-size: 1.05rem;
}

[dir="rtl"] .product-title-en {
  direction: ltr;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.product-specs-list {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  margin-top: auto;
}

.spec-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.btn-add-quote {
  background: var(--accent-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--accent-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-add-quote:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-add-quote.in-cart {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.btn-quick-view {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-quick-view:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-elevated);
}

/* List View Styling */
.products-grid.view-list {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.products-grid.view-list .product-card {
  flex-direction: row;
}

.products-grid.view-list .product-image-wrap {
  width: 220px;
  height: 100%;
  aspect-ratio: auto;
  flex-shrink: 0;
}

.products-grid.view-list .product-content {
  flex: 1;
}

.products-grid.view-list .product-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: none;
  padding-top: 0;
  margin-top: auto;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.btn-reset-filters {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-reset-filters:hover {
  background: var(--accent-blue-hover);
}

/* ==========================================================================
   Product Detail Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 14, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 10;
  transition: all var(--transition-fast);
}

[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 1rem;
}

.modal-close-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

.modal-image-col {
  background: var(--bg-img-wrap);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.modal-image-col img {
  max-height: 380px;
  object-fit: contain;
}

.modal-info-col {
  display: flex;
  flex-direction: column;
}

.modal-header-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.modal-title-en {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.modal-title-ar {
  font-family: var(--font-ar);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 1rem;
  direction: rtl;
  text-align: right;
}

.modal-desc-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-desc-box .desc-ar {
  font-family: var(--font-ar);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  direction: rtl;
  text-align: right;
  color: var(--text-primary);
}

.modal-specs-table {
  margin-bottom: 1.5rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}

.spec-label {
  color: var(--text-muted);
}

.spec-val {
  font-weight: 600;
  color: var(--text-primary);
}

.modal-actions-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.btn-modal-whatsapp {
  background: var(--accent-whatsapp);
  color: #ffffff;
  font-weight: 700;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.btn-modal-whatsapp:hover {
  background: var(--accent-whatsapp-hover);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-modal-quote {
  background: var(--accent-blue-subtle);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-modal-quote:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

/* ==========================================================================
   Quote Drawer (Sidebar)
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 990;
}

.quote-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-medium);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  box-shadow: var(--shadow-lg);
}

[dir="rtl"] .quote-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border-medium);
  transform: translateX(-100%);
}

.quote-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-title-group i {
  font-size: 1.4rem;
  color: var(--accent-blue);
}

.drawer-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.drawer-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drawer-close-btn {
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 0.35rem;
}

.drawer-close-btn:hover {
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.drawer-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.drawer-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.drawer-item-img {
  width: 54px;
  height: 54px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.drawer-item-info {
  flex: 1;
  min-width: 0;
}

.drawer-item-ref {
  font-size: 0.7rem;
  color: var(--accent-blue);
  font-weight: 800;
}

.drawer-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-drawer-item-remove {
  color: var(--text-muted);
  padding: 0.4rem;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.btn-drawer-item-remove:hover {
  color: var(--danger);
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-drawer-whatsapp {
  background: var(--accent-whatsapp);
  color: #ffffff;
  font-weight: 700;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  transition: background var(--transition-fast);
}

.btn-drawer-whatsapp:hover {
  background: var(--accent-whatsapp-hover);
}

.btn-drawer-copy {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-drawer-copy:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.btn-drawer-clear {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem;
  transition: color var(--transition-fast);
}

.btn-drawer-clear:hover {
  color: var(--danger);
}

/* ==========================================================================
   Mobile Floating Action
   ========================================================================== */
.floating-quote-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
}

[dir="rtl"] .floating-quote-btn {
  right: auto;
  left: 1.5rem;
}

.floating-quote-btn button {
  width: 56px;
  height: 56px;
  background: var(--accent-blue);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 24px var(--accent-blue-glow);
  position: relative;
}

.floating-quote-btn .quote-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #0f172a;
  color: #ffffff;
  border: 2px solid #ffffff;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 1.5rem;
  color: #94a3b8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 900;
  color: #60a5fa;
  margin-bottom: 1rem;
}

.footer-about {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.footer-contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #64748b;
}

.footer-contact-info a:hover {
  color: var(--accent-blue-light);
}

.footer-contact-info i {
  color: var(--accent-blue-light);
  width: 20px;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: #94a3b8;
}

.footer-links a:hover {
  color: #60a5fa;
  padding-left: 4px;
}

[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 4px;
}

.footer-text {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.btn-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-whatsapp);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-footer-cta:hover {
  background: var(--accent-whatsapp-hover);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-blue);
  color: #f8fafc;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2000;
  animation: toastPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

@keyframes toastPop {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Device Optimizations (iPhone & Android)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-col.brand-col {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .top-bar-content {
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
  }
  .top-info {
    justify-content: center;
    font-size: 0.75rem;
  }
  .header-container {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .brand-logo {
    gap: 0.5rem;
  }
  .logo-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .brand-name {
    font-size: 1.1rem;
  }
  .header-search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
  }
  .search-input-box input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 0.6rem 2.5rem;
  }
  .quote-btn-text {
    display: none;
  }
  .btn-whatsapp-direct span {
    display: none;
  }
  .btn-whatsapp-direct {
    padding: 0.6rem 0.85rem;
    font-size: 1rem;
  }
  .floating-quote-btn {
    display: block;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .hero-section {
    padding: 2rem 0 1.5rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-desc {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .stat-card {
    padding: 0.65rem 0.4rem;
  }
  .stat-num {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .filter-select {
    flex: 1;
    font-size: 16px; /* Prevents iOS zoom */
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }
  .modal-overlay {
    padding: 0.75rem;
    align-items: flex-end;
  }
  .modal-card {
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    padding: 1.25rem;
    gap: 1rem;
  }
  .modal-image-col {
    min-height: 180px;
    padding: 1rem;
  }
  .modal-image-col img {
    max-height: 220px;
  }
  .modal-title-en {
    font-size: 1.25rem;
  }
  .modal-title-ar {
    font-size: 1.15rem;
  }
  .quote-drawer {
    max-width: 100%;
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-col.brand-col {
    grid-column: span 1;
  }
  .products-grid.view-list .product-card {
    flex-direction: column;
  }
  .products-grid.view-list .product-image-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  .products-grid {
    grid-template-columns: 1fr;
  }
  .categories-scroll {
    -webkit-overflow-scrolling: touch;
  }
  .cat-pill {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }
}

