/* Prevent price from breaking into two lines and stack discounted price below original */
.no-break {
  white-space: nowrap;
}
.vertical-price-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  justify-content: center;
  min-height: 3.5rem;
}
/* Discount price styles */
.product-original-price {
  text-decoration: line-through;
  color: var(--price-original);
  font-size: 1rem;
  margin-inline-end: 0.5em;
  opacity: 0.6;
}
.product-discounted-price {
  color: var(--price-discount);
  font-weight: 700;
  font-size: 1.5rem; /* Increase font size for prominence */
}
.product-price-block {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  min-height: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* --- Theme Variables --- */
:root {
  /* Modern Color Palette - Light Mode */
  --bg-color: #e5e7eb;
  --text-color: #0f172a;
  --header-bg: linear-gradient(135deg, #1e3a8a 0%, #1e293b 50%, #0f172a 100%);
  --header-text: #ffffff;
  --card-bg: #ffffff;
  --card-border: #9ca3af;
  --card-hover: #f9fafb;
  --sidebar-bg: #ffffff;
  --sidebar-border: #9ca3af;
  
  /* Action Colors */
  --button-bg: #2563eb;
  --button-hover: #1d4ed8;
  --button-border: transparent;
  --button-text: #ffffff;
  --primary-color: #2563eb;
  --primary-hover: #1e40af;
  --primary-text: #ffffff;
  
  /* Text Hierarchy */
  --secondary-text: #334155; /* Darkened from #475569 for better contrast (6.7:1) */
  --muted-text: #475569; /* Darkened from #64748b for better contrast (5.4:1) */
  
  /* Price Colors */
  --price-regular: #059669; /* Emerald green for regular prices */
  --price-discount: #059669; /* Strong emerald green for discounts */
  --price-original: #dc2626; /* Red for crossed-out prices */
  
  /* Status Colors */
  --success-color: #047857; /* Darkened from #10b981 for better contrast (4.8:1 on light bg) */
  --success-bg: #d1fae5;
  --error-color: #dc2626; /* Darkened from #ef4444 for better contrast (5.9:1 on light bg) */
  --error-bg: #fee2e2;
  --warning-color: #d97706; /* Darkened from #f59e0b for better contrast (4.8:1 on light bg) */
  --warning-bg: #fef3c7;
  --info-color: #2563eb; /* Darkened from #3b82f6 for better contrast (5.1:1 on light bg) */
  --info-bg: #dbeafe;
  
  /* Cart Badge */
  --cart-badge-bg: #f59e0b; /* Amber/yellow for cart count */
  --cart-badge-text: #451a03; /* Darkened from #78350f for better contrast (4.7:1) */
  
  /* Spacing System */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Animation */
  --transition-speed: 0.2s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Elevation */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 8px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.2), 0 4px 8px -4px rgb(0 0 0 / 0.15);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  
  /* Hero Section Colors */
  --hero-bg-start: #2563eb;
  --hero-bg-mid: #1e40af;
  --hero-bg-end: #1e3a8a;
  --hero-overlay-light: rgba(96, 165, 250, 0.15);
  --hero-overlay-lighter: rgba(147, 197, 253, 0.15);
  --hero-text-gradient-start: #ffffff;
  --hero-text-gradient-end: #e0e7ff;
  
  /* Gradient Presets */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  --gradient-hero: linear-gradient(135deg, var(--hero-bg-start) 0%, var(--hero-bg-mid) 50%, var(--hero-bg-end) 100%);
  --gradient-featured: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --gradient-discount: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  
  /* Product Card Colors */
  --product-bg-pattern: #f3f4f6;
  --product-border-light: #e5e7eb;
  
  /* Featured Category Colors */
  --featured-bg: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --featured-text: #78350f;
  --featured-border: #d97706;
  --featured-shadow: rgba(251, 191, 36, 0.3);
  --featured-hover: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
  --featured-hover-shadow: rgba(251, 191, 36, 0.5);
  --featured-active: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --featured-active-shadow: rgba(217, 119, 6, 0.6);
  
  /* Discount Category Colors */
  --discount-bg: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --discount-text: #ffffff;
  --discount-border: #991b1b;
  --discount-shadow: rgba(220, 38, 38, 0.3);
  --discount-hover: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  --discount-hover-shadow: rgba(239, 68, 68, 0.5);
  --discount-active: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
  --discount-active-shadow: rgba(153, 27, 27, 0.6);
  --discount-border-dark: #7f1d1d;
}

/* Google Translate Compatibility Fixes */
/* Prevent Google Translate from breaking layouts */
body {
  top: 0 !important; /* Override Google Translate top positioning */
}

/* Fix for Google Translate wrapper elements breaking grid/flex layouts */
.cart-content-wrapper > *,
.cart-item > *,
.cart-item-info > *,
.summary-row > *,
.form-group > *,
.customer-form > * {
  max-width: 100%;
}

/* Ensure Google Translate font tags don't break grid */
.cart-item font,
.cart-content-wrapper font,
.summary-row font,
.form-group font {
  display: contents;
}

/* Fix grid items when wrapped by Google Translate */
.cart-item > font {
  display: contents;
}

.cart-item-info font,
.cart-item-name font,
.cart-item-price font {
  display: inline;
}

/* Prevent layout shifts from translate bar */
html.translated-ltr,
html.translated-rtl {
  margin-top: 0 !important;
}

body.translated-ltr,
body.translated-rtl {
  top: 0 !important;
  margin-top: 0 !important;
}

/* Handle Google Translate's iframe and toolbar */
#goog-gt-tt,
.goog-te-banner-frame {
  display: none !important;
}

.goog-te-balloon-frame {
  z-index: 10000 !important;
}

/* Ensure text in grids wraps properly when translated */
.cart-item-name,
.cart-item-price,
.summary-row span,
.form-group label {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Product Card Link Styles */
.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

[data-theme="dark"] {
  /* Modern Color Palette - Dark Mode */
  --bg-color: #0a0f1a;
  --text-color: #f3f4f6;
  --header-bg: linear-gradient(135deg, #1e3a8a 0%, #1e293b 50%, #111827 100%);
  --header-text: #ffffff;
  --card-bg: #1a1f2e;
  --card-border: #2d3748;
  --card-hover: #242b3d;
  --sidebar-bg: #1a1f2e;
  --sidebar-border: #2d3748;
  
  /* Action Colors */
  --button-bg: #3b82f6;
  --button-hover: #2563eb;
  --button-border: transparent;
  --button-text: #ffffff;
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-text: #ffffff;
  
  /* Text Hierarchy */
  --secondary-text: #e5e7eb; /* Lightened for better contrast on dark bg (10.2:1) */
  --muted-text: #d1d5db; /* Lightened from #9ca3af for better contrast (9.5:1) */

  /* Price Colors - Dark Mode */
  --price-regular: #ffffff; /* Brighter emerald for dark mode visibility */
  --price-discount: #10b981; /* Softer emerald for dark mode */
  --price-original: #f87171; /* Lighter red for dark mode */
  
  /* Status Colors */
  --success-color: #6ee7b7; /* Lightened from #34d399 for better contrast (6.1:1 on dark bg) */
  --success-bg: #064e3b;
  --error-color: #fca5a5; /* Lightened from #f87171 for better contrast (5.8:1 on dark bg) */
  --error-bg: #7f1d1d;
  --warning-color: #fcd34d; /* Lightened from #fbbf24 for better contrast (6.8:1 on dark bg) */
  --warning-bg: #78350f;
  --info-color: #93c5fd; /* Lightened from #60a5fa for better contrast (6.2:1 on dark bg) */
  --info-bg: #1e3a8a;
  
  /* Cart Badge */
  --cart-badge-bg: #fbbf24; /* Brighter amber/yellow for dark mode */
  --cart-badge-text: #0f172a; /* Darkened from #1e293b for better contrast (8.9:1) */

  /* Dark mode specific shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

/* Modern Theme Toggle and Cart Styles */
#theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--header-text);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

#theme-toggle-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

#theme-toggle-btn:hover::before {
  opacity: 1;
}

#theme-toggle-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#theme-toggle-btn:active {
  transform: translateY(0);
}

#theme-toggle-btn i,
#theme-toggle-btn svg.icon {
  font-size: 1.25rem; /* for <i> fallback */
  width: 22px;
  height: 22px;
  position: absolute;
  transition: all 0.5s var(--transition-ease);
  fill: currentColor;
}

#light-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

#dark-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] #light-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] #dark-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* Modern Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-speed) var(--transition-ease),
              color var(--transition-speed) var(--transition-ease);
}

/* Arabic Typography Support */
/* Automatically use Cairo font for Arabic text while keeping Inter for English */
body {
  font-family: 'Inter', 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
}

/* Bidirectional text support - automatically detect and apply RTL for Arabic content */
[lang="ar"],
*:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
  text-align: end;
}

/* Auto-detect Arabic text and apply proper styling */
/* This uses CSS unicode-range to automatically style Arabic characters */
@supports (font-family: 'Cairo') {
  /* Arabic Unicode ranges: Arabic, Arabic Supplement, Arabic Extended-A */
  *:has(> :first-child:is(:lang(ar))) {
    font-family: 'Cairo', 'Tajawal', sans-serif;
  }
}

/* Ensure proper rendering for mixed content (Arabic + English) */
.product-name,
.product-description,
h1, h2, h3, h4, h5, h6,
p, span, div, li, a, button, input, textarea {
  /* Allow browser to detect text direction automatically */
  unicode-bidi: plaintext;
}

/* Specific handling for product cards with mixed content */
.product-card .product-name,
.product-card .product-description {
  text-align: start; /* Use logical property for bidirectional support */
  direction: auto; /* Let browser detect direction */
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--space-md);
}

/* Modern Button Styles */
button, 
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  text-decoration: none;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

button:hover,
.button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

button:active,
.button:active {
  transform: translateY(0);
}

/* Modern Header & Navigation */
header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 70px;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--header-text);
  flex-shrink: 0;
  line-height: 1.2;
}

/* Header Search Container */
.header-search-container {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.header-search-container #search-bar {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  font-size: 0.9375rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--header-text);
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 18px;
}

.header-search-container #search-bar::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header-search-container #search-bar:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.header-search-container #search-bar:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-speed) var(--transition-ease);
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  position: relative;
  transition: all var(--transition-speed) var(--transition-ease);
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.cart-link i {
  font-size: 1.5rem;
}

.cart-count {
  background: var(--cart-badge-bg);
  color: var(--cart-badge-text);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Cart FAB - Hidden by default, shown only on mobile */
.cart-fab {
  display: none;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  transition: all var(--transition-speed) var(--transition-ease);
  flex-shrink: 0;
}

.hamburger-menu:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.hamburger-menu:active {
  transform: translateY(0);
}

.hamburger-menu span {
  display: block;
  width: 22px;
  height: 2.5px;
  background-color: var(--header-text);
  margin: 4px auto;
  border-radius: 2px;
  transition: transform var(--transition-speed) var(--transition-ease),
              opacity var(--transition-speed) var(--transition-ease);
}

/* Menu Overlay */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* Search Overlay - Modern backdrop for expanded search on mobile */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.search-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: all;
}

/* New Badge Styling - Modern and Eye-catching */
.new-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  animation: pulse-badge 2s ease-in-out infinite;
}

.new-badge::before {
  content: '';
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2l2.4 7.4h7.6l-6 4.6 2.3 7-6.3-4.6-6.3 4.6 2.3-7-6-4.6h7.6z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Sale badge for product cards */
.sale-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  animation: pulse-sale-badge 2s ease-in-out infinite;
}

/* When both badges are present, move sale badge below new badge */
.new-badge ~ .sale-badge {
  top: 52px;
}

.sale-badge::before {
  content: '';
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12.79 21L3 11.21v2c0 .53.21 1.04.59 1.41l7.79 7.79c.78.78 2.05.78 2.83 0l6.21-6.21c-.18-.19-.42-.3-.67-.3h-6c-.83 0-1.58-.34-2.12-.88-.54-.54-.88-1.29-.88-2.12v-.68zM11.38 2c-.53 0-1.04.21-1.41.59L2.59 10c-.38.37-.59.88-.59 1.41v2L11.38 23c.78.78 2.05.78 2.83 0l7.79-7.79c.78-.78.78-2.05 0-2.83l-8.2-8.2C13.42 2.21 12.91 2 12.38 2h-1z'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.6);
  }
}

@keyframes pulse-sale-badge {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.6);
  }
}

/* Search expansion animation with subtle pop effect */
@keyframes searchExpand {
  0% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-50%) scale(1.02);
  }
  100% {
    transform: translateY(-50%) scale(1);
  }
}

/* ========================================
   TABLET & MOBILE STYLES (768px and down)
   ======================================== */
@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  header {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  header h1 {
    font-size: 1.5rem;
    text-align: center;
    flex: 1;
    transition: opacity 0.3s ease;
  }

  /* Hide title when search is expanded */
  header:has(#search-bar:focus) h1,
  header:has(#search-bar.expanded) h1 {
    opacity: 0;
    pointer-events: none;
  }

  /* =========================
     SEARCH BAR - MOBILE BEHAVIOR
     ========================= */
  /* Collapse search to icon only on mobile */
  .header-search-container {
    max-width: 40px;
    flex: 0;
    position: relative;
  }

  .header-search-container #search-bar {
    width: 40px;
    padding: 0.625rem;
    font-size: 0.9375rem;
    background-position: center;
    background-size: 18px;
    cursor: pointer;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    /* Staggered multi-property transitions for smooth animation */
    transition: 
      width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      border-radius 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
      padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      background-position 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
      box-shadow 0.3s ease,
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    inset-inline-end: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    will-change: width, border-radius, transform;
  }

  /* Placeholder fade animation */
  .header-search-container #search-bar::placeholder {
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  /* Expand search when focused or active */
  .header-search-container #search-bar:focus,
  .header-search-container #search-bar.expanded {
    position: fixed;
    width: calc(100vw - 240px);
    max-width: none;
    inset-inline-start: 60px;
    inset-inline-end: auto;
    text-indent: 0;
    padding-inline: 0.75rem 2.5rem;
    padding-block: 0.75rem;
    background-position: 0.75rem center;
    background-size: 18px;
    cursor: text;
    z-index: 100;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1);
    top: 35px;
    animation: searchExpand 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  /* Fade in placeholder after expansion */
  .header-search-container #search-bar.expanded::placeholder,
  .header-search-container #search-bar:focus::placeholder {
    opacity: 1;
    transition-delay: 0.25s;
  }

  /* Modern Off-canvas sidebar */
  #category-sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 100vh;
    width: 300px;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s var(--transition-ease);
    background-color: var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
    border-inline-end: 1px solid var(--card-border);
  }

  /* Inner scrollable area so the close button stays visible */
  #category-sidebar .sidebar-inner {
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3.5rem 1rem 6rem 1rem; /* Extra bottom padding for safe scrolling */
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  /* Show close button only on mobile */
  .close-menu { display: block; }

  body.menu-open {
    overflow: hidden; /* prevent background scroll when menu open */
  }

  body.menu-open #category-sidebar {
    transform: translateX(0); /* slide in */
  }

  body.menu-open .menu-overlay {
    display: block;
  }

  body.menu-open .hamburger-menu span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  body.menu-open .hamburger-menu span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .hamburger-menu span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* Main content wrapper for sidebar and product list */
.main-content-wrapper {
  display: flex;
  gap: 1.5rem; /* Space between sidebar and product list */
  padding: 1rem; /* Overall padding for the main content area */
}

/* ========================================
   DESKTOP LAYOUT (769px and up)
   ======================================== */
@media (min-width: 769px) {
  /* =========================
     SEARCH BAR - FULL WIDTH
     ========================= */
  /* Ensure search bar is always fully visible on desktop */
  .header-search-container {
    display: block;
  }

  .header-search-container #search-bar {
    width: 100%;
    /* All other styles inherited from base desktop styles */
  }
}

/* ========================================
   LARGE DESKTOP (1200px and up)
   ======================================== */
@media (min-width: 1200px) {
  /* =========================
     SEARCH BAR - EXPANDED
     ========================= */
  /* Give more space to search on larger screens */
  .header-search-container {
    max-width: 600px;
  }
}

.CartBtn {
  width: 100%; /* Full width on mobile and smaller cards */
  min-height: 40px;
  height: auto;
  border-radius: 12px;
  border: none;
  background-color: rgb(255, 208, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition-duration: .5s;
  overflow: hidden;
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.103);
  position: relative;
  margin-top: 0.5rem; /* Space between card content and button */
  padding: 0.5rem; /* Ensure adequate padding for text */
}

.CartBtn .IconContainer {
  position: absolute;
  inset-inline-start: -50px;
  width: 30px;
  height: 30px;
  background-color: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
  transition-duration: .5s;
}

.icon {
  border-radius: 1px;
}

.CartBtn .text {
  height: 100%;
  width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(17, 17, 17);
  z-index: 1;
  transition-duration: .5s;
  font-size: 1.04em;
  font-weight: 600;
  margin: 0; /* Remove default paragraph margin */
  line-height: 1; /* Ensure consistent vertical centering */
}

.CartBtn:hover .IconContainer {
  transform: translateX(58px);
  border-radius: 40px;
  transition-duration: .5s;
}

.CartBtn:hover .text {
  transform: translate(10px,0px);
  transition-duration: .5s;
}

.CartBtn:active {
  transform: scale(0.95);
  transition-duration: .5s;
}

/* Notification Card Styles - Modern & Consistent */
@keyframes slideIn {
  0% {
    transform: translateX(120%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.notification-card {
  /* Layout */
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 10000;
  
  /* Sizing */
  width: 380px;
  max-width: calc(100vw - 3rem);
  min-height: 140px;
  
  /* Styling */
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  
  /* Spacing */
  padding: 1.25rem;
  
  /* Animation */
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Interaction */
  cursor: default;
  user-select: none;
}

[data-theme="light"] .notification-card {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12),
              0 6px 16px rgba(59, 130, 246, 0.1),
              0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: rgba(229, 231, 235, 0.8);
}

[data-theme="dark"] .notification-card {
  background: rgba(26, 31, 46, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5),
              0 6px 16px rgba(59, 130, 246, 0.2),
              0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(45, 55, 72, 0.8);
}

.notification-card.slideOut {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.notification-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  height: 100%;
}

.notification-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .notification-icon {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.notification-icon .icon-cart-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-icon .icon-cart-box svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
}

.notification-title-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.notification-title {
  flex: 1;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.4;
  margin: 0;
}

[data-theme="light"] .notification-title {
  color: #111827;
}

[data-theme="dark"] .notification-title {
  color: #f3f4f6;
}

.notification-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--transition-ease);
  background: transparent;
  border: none;
  padding: 0;
  margin: -4px -4px 0 0;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notification-close:active {
  transform: scale(0.95);
}

.notification-close svg {
  width: 14px;
  height: 14px;
  transition: all 0.2s var(--transition-ease);
}

[data-theme="light"] .notification-close svg {
  fill: #6b7280;
}

[data-theme="light"] .notification-close:hover svg {
  fill: #111827;
}

[data-theme="dark"] .notification-close svg {
  fill: #9ca3af;
}

[data-theme="dark"] .notification-close:hover svg {
  fill: #f3f4f6;
}

.notification-product {
  font-size: 0.9375rem;
  color: var(--secondary-text);
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--price-discount);
  margin: 0.125rem 0 0.5rem 0;
  line-height: 1;
}

.notification-button {
  /* Reset */
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  
  /* Sizing */
  height: 40px;
  padding: 0 1.25rem;
  
  /* Styling */
  background: var(--button-bg);
  color: var(--button-text);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  /* Animation */
  transition: all 0.2s var(--transition-ease);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .notification-button {
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.notification-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s var(--transition-ease);
}

.notification-button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .notification-button:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.notification-button:hover::before {
  opacity: 1;
}

.notification-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-button svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s var(--transition-ease);
  flex-shrink: 0;
}

.notification-button:hover svg {
  transform: translateX(2px);
}

/* Stock Warning Styles */
.stock-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.375rem 0 0 0;
  transition: all var(--transition-speed) var(--transition-ease);
  animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stock-warning.error {
  color: var(--error-color);
  background: var(--error-bg);
  border: 1px solid color-mix(in srgb, var(--error-color) 30%, transparent);
}

.stock-warning.warning {
  color: #92400e; /* Darkened from #b45309 for better contrast (5.8:1) */
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning-color) 30%, transparent);
}

.stock-warning.out-of-stock {
  color: #991b1b;
  background: #fecaca;
  border: 1px solid color-mix(in srgb, #dc2626 40%, transparent);
  font-weight: 700;
}

[data-theme="dark"] .stock-warning.error {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.4);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .stock-warning.warning {
  color: #fcd34d;
  background: rgba(120, 53, 15, 0.4);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .stock-warning.out-of-stock {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Theme Toggle Button */
#theme-toggle-btn {
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

/* --- Responsive Styles for Mobile Devices --- */
@media (max-width: 600px) {
  body {
    font-size: 1rem;
    padding: 0;
  }
  header {
    padding: 0.75rem 1rem;
    gap: 1rem;
    min-height: 60px;
  }
  
  header h1 {
    font-size: 1.35rem;
  }
  
  /* Hide cart link in header on mobile */
  .cart-link {
    display: none;
  }
  
  /* Modern FAB for cart on mobile */
  .cart-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--primary-text);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    cursor: pointer;
  }
  
  .cart-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
  }
  
  .cart-fab:active {
    transform: scale(0.95);
  }
  
  .cart-fab i {
    font-size: 1.5rem;
  }
  
  .cart-fab .cart-count {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    background: var(--cart-badge-bg);
    color: var(--cart-badge-text);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.5rem;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--bg-color);
  }
  
  #theme-toggle-btn {
    width: 40px;
    height: 40px;
  }
  
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
  }
  
  .hamburger-menu span {
    display: block;
    width: 20px;
    height: 2.5px;
    background-color: var(--header-text);
    margin: 3px auto;
  }
  
  .main-content-wrapper {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  /* Button already full width from base styles, just adjust height for mobile */
  .CartBtn {
    min-height: 38px;
    height: auto;
    font-size: 1em;
  }
}

@media (max-width: 600px) {
  /* Notification Card - Mobile Optimized */
  .notification-card {
    inset-inline: 1rem;
    bottom: 1rem;
    width: auto;
    max-width: none;
    padding: 1rem;
    border-radius: var(--radius-md);
  }
  
  .notification-wrapper {
    gap: 0.875rem;
  }
  
  .notification-icon {
    width: 44px;
    height: 44px;
  }
  
  .notification-icon .icon-cart-box svg {
    width: 22px;
    height: 22px;
  }
  
  .notification-content {
    gap: 0.5rem;
  }
  
  .notification-title {
    font-size: 1rem;
  }
  
  .notification-close {
    width: 24px;
    height: 24px;
    margin: -2px -2px 0 0;
  }
  
  .notification-close svg {
    width: 13px;
    height: 13px;
  }
  
  .notification-product {
    font-size: 0.875rem;
  }
  
  .notification-price {
    font-size: 1.0625rem;
    margin: 0 0 0.375rem 0;
  }
  
  .notification-button {
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
    width: 100%;
  }
  
  .notification-button svg {
    width: 16px;
    height: 16px;
  }
}

/* --- Breadcrumb Navigation Styles --- */
.breadcrumb {
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  box-shadow: var(--shadow-sm);
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.9375rem;
  color: var(--secondary-text);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-inline-start: var(--space-sm);
  color: var(--secondary-text);
  font-weight: 600;
  font-size: 1.125rem;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed) var(--transition-ease);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.breadcrumb a:hover {
  color: var(--primary-hover);
  background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.breadcrumb li:last-child span {
  color: var(--text-color);
  font-weight: 600;
}

/* --- Stock Status Styles --- */
.stock-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid;
}

.stock-status i {
  font-size: 1.25rem;
}

.stock-status.in-stock {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.stock-status.low-stock {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  color: #92400e;
  border-color: #fb923c;
}

.stock-status.out-of-stock {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #f87171;
}

/* Dark mode stock status */
[data-theme='dark'] .stock-status.in-stock {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.15) 100%);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.3);
}

[data-theme='dark'] .stock-status.low-stock {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.25) 0%, rgba(251, 146, 60, 0.15) 100%);
  color: #fdba74;
  border-color: rgba(253, 186, 116, 0.3);
}

[data-theme='dark'] .stock-status.out-of-stock {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.15) 100%);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.3);
}

/* Disable add to cart button when out of stock */
.CartBtn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Header Link Styles --- */
.store-title {
  color: var(--header-text);
  text-decoration: none;
  transition: all var(--transition-speed) var(--transition-ease);
  display: inline-block;
}

.store-title:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--header-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) var(--transition-ease);
  font-size: 1.25rem;
  line-height: 1;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* --- Responsive Breadcrumbs & Trust Badges --- */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.8125rem;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
  }
  
  .breadcrumb ol {
    gap: 0.25rem;
  }
  
  .breadcrumb a {
    padding: 0.125rem 0.25rem;
  }
  
  .breadcrumb li:not(:last-child)::after {
    margin-inline-start: 0.25rem;
    font-size: 1rem;
  }
}

/* ========================================
   EXTRA SMALL MOBILE (480px and down)
   ======================================== */
@media (max-width: 480px) {
  /* =========================
     SEARCH BAR - COMPACT
     ========================= */
  .header-search-container #search-bar {
    font-size: 0.8125rem;
    background-size: 16px;
  }

  /* Adjust expanded search for smaller screens */
  .header-search-container #search-bar:focus,
  .header-search-container #search-bar.expanded {
    width: calc(100vw - 220px);
    left: 65px;
    padding: 0.65rem 0.65rem 0.65rem 2.25rem;
    background-position: 0.65rem center;
    background-size: 16px;
    font-size: 0.875rem;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 
                0 3px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1);
    top: 50%;
    animation: searchExpand 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  /* Ensure hamburger is always visible on very small screens */
  .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .hamburger-menu span {
    display: block !important;
    width: 20px;
    height: 2.5px;
    background-color: var(--header-text);
    margin: 3px auto;
  }
  
  header h1 {
    font-size: 1.25rem;
  }
  
  .breadcrumb {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
  }
}

/* ========================================
   ARABIC LANGUAGE SUPPORT
   ======================================== */

/* Enhanced Arabic Typography */
/* Improve letter spacing and line height for Arabic text */
:lang(ar) {
  letter-spacing: 0;
  word-spacing: 0.05em;
  line-height: 1.7; /* Better for Arabic script */
}

/* Arabic headings - slightly larger line height */
h1:lang(ar), h2:lang(ar), h3:lang(ar), 
h4:lang(ar), h5:lang(ar), h6:lang(ar) {
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0;
}

/* Price formatting remains LTR even in Arabic context */
.product-price,
.product-original-price,
.product-discounted-price,
.cart-item-price,
.total-price {
  direction: ltr;
  unicode-bidi: embed;
  font-variant-numeric: tabular-nums;
}

/* Numbers in Arabic context - use Western Arabic numerals */
.product-price:lang(ar),
.product-original-price:lang(ar),
.product-discounted-price:lang(ar) {
  font-family: 'Inter', sans-serif;
  font-feature-settings: 'tnum' 1; /* Tabular numbers */
}

/* Search and input fields - support both directions */
input[type="search"],
input[type="text"],
textarea {
  direction: auto; /* Auto-detect based on first character */
  text-align: start;
}

input[type="search"]:lang(ar),
input[type="text"]:lang(ar),
textarea:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* Buttons with Arabic text */
button:lang(ar),
.CartBtn:lang(ar),
.apply-filters-btn:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

/* Breadcrumbs - maintain LTR for navigation arrows */
.breadcrumb {
  direction: ltr;
  text-align: start;
}

.breadcrumb a:lang(ar),
.breadcrumb span:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
  display: inline-block;
}

/* Icons should not flip direction */
i, .icon, svg {
  direction: ltr;
}

/* Mixed language support - Arabic with English or numbers */
.mixed-content {
  direction: auto;
  text-align: start;
  unicode-bidi: plaintext;
}

/* Optimize font rendering for Arabic */
@supports (font-variant-ligatures: common-ligatures) {
  :lang(ar) {
    font-variant-ligatures: common-ligatures;
    text-rendering: optimizeLegibility;
  }
}

/* Responsive Arabic typography */
@media (max-width: 768px) {
  :lang(ar) {
    line-height: 1.65;
  }
  
  h1:lang(ar) { font-size: 1.75rem; }
  h2:lang(ar) { font-size: 1.5rem; }
  h3:lang(ar) { font-size: 1.25rem; }
}

/* Ensure smooth transitions maintain quality */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 400px;
  width: 100%;
}

.empty-state-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--primary-color) 10%, transparent) 0%, 
    color-mix(in srgb, var(--primary-color) 5%, transparent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: empty-state-float 3s ease-in-out infinite;
}

.empty-state-icon i {
  font-size: 3.5rem;
  color: var(--muted-text);
  opacity: 0.6;
}

@keyframes empty-state-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.empty-state-message {
  font-size: 1.125rem;
  color: var(--secondary-text);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.empty-state-suggestions {
  background: color-mix(in srgb, var(--info-bg) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--info-color) 20%, transparent);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 500px;
  text-align: start;
}

.empty-state-suggestions h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-state-suggestions h4 i {
  color: var(--info-color);
  font-size: 1.25rem;
}

.empty-state-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.empty-state-suggestions li {
  color: var(--secondary-text);
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.empty-state-suggestions li::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: var(--info-color);
  font-weight: bold;
}

/* --- Error State --- */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 400px;
  width: 100%;
}

.error-state-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--error-color) 10%, transparent) 0%, 
    color-mix(in srgb, var(--error-color) 5%, transparent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: error-state-shake 0.5s ease-in-out;
}

.error-state-icon i {
  font-size: 3.5rem;
  color: var(--error-color);
  opacity: 0.8;
}

@keyframes error-state-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.error-state-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.error-state-message {
  font-size: 1.125rem;
  color: var(--secondary-text);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.error-state-details {
  background: var(--error-bg);
  border: 1px solid color-mix(in srgb, var(--error-color) 30%, transparent);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  max-width: 500px;
}

.error-state-details code {
  color: var(--error-color);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.retry-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--primary-color);
  color: var(--primary-text);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  box-shadow: var(--shadow-sm);
}

.retry-button:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.retry-button:active {
  transform: translateY(0);
}

.retry-button i {
  font-size: 1.25rem;
}

/* Spinner for retry button */
.retry-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.retry-button.loading i {
  animation: retry-spin 1s linear infinite;
}

@keyframes retry-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .empty-state,
  .error-state {
    padding: 3rem 1.5rem;
    min-height: 350px;
  }
  
  .empty-state-icon,
  .error-state-icon {
    width: 100px;
    height: 100px;
  }
  
  .empty-state-icon i,
  .error-state-icon i {
    font-size: 3rem;
  }
  
  .empty-state-title,
  .error-state-title {
    font-size: 1.5rem;
  }
  
  .empty-state-message,
  .error-state-message {
    font-size: 1rem;
  }
  
  .empty-state-suggestions {
    padding: 1.25rem;
  }
}