/* 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-right: 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 */

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

/* Product Detail Page Styles */
.product-detail-page {
  padding: var(--space-xl) var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

.product-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  transition: box-shadow var(--transition-speed) var(--transition-ease);
}

.product-container:hover {
  box-shadow: var(--shadow-lg);
}

/* Left column media stack: main image + thumbnails */
.product-media-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: sticky;
  top: 100px;
  height: fit-content;
}

.product-image {
  width: 100%;
  height: 550px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--primary-color) 3%, transparent) 0%, 
    color-mix(in srgb, var(--card-bg) 100%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--card-border) 40%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed) var(--transition-ease),
              box-shadow var(--transition-speed) var(--transition-ease);
  position: relative;
}

.product-image:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: var(--space-lg);
  transition: transform 0.3s var(--transition-ease);
}

.product-image:hover img {
  transform: scale(1.05);
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

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

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  font-weight: 300;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-size: 1.5rem;
  font-weight: 300;
  transition: all var(--transition-speed) var(--transition-ease);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

/* Prevent background scroll when lightbox is open */
body.lb-open { overflow: hidden; }

/* Thumbnails strip under the main image */
.product-thumbnails {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.product-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.product-thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.product-thumbnails::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.thumbnail-btn {
  width: 90px;
  height: 90px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.thumbnail-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--primary-color) 5%, transparent) 0%, 
    transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.thumbnail-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  position: relative;
  z-index: 1;
}

.thumbnail-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-btn:hover::before {
  opacity: 1;
}

.thumbnail-btn.active {
  border-color: var(--primary-color);
  border-width: 3px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--primary-color) 8%, transparent) 0%, 
    var(--card-bg) 100%);
}

.thumbnail-btn.active::before {
  opacity: 1;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-height: 100%;
}

.product-info h1 {
  font-size: 2.25rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.product-name {
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
}

.product-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--price-regular);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.product-description {
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--secondary-text);
  line-height: 1.75;
  margin: 0;
}

.product-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-md);
}

.product-actions .CartBtn {
  flex: 1;
  max-width: none;
  height: 56px;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  transition: all var(--transition-speed) var(--transition-ease);
}

.product-actions .CartBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.product-actions .CartBtn:active {
  transform: translateY(0);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  padding: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.quantity-btn {
  background: var(--primary-color);
  color: var(--button-text);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) var(--transition-ease);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quantity-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.08);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.quantity-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.quantity-btn:disabled {
  background: var(--card-border);
  color: var(--muted-text);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

#quantity {
  width: 60px;
  text-align: center;
  border: none;
  background: transparent;
  padding: var(--space-sm);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-color);
  transition: color var(--transition-speed) var(--transition-ease);
}

#quantity:focus {
  outline: none;
  color: var(--primary-color);
}

/* Responsive design for product page */
@media (max-width: 768px) {
  .product-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl);
  }
  
  .product-detail-page {
    padding: var(--space-lg) var(--space-md);
  }

  .product-media-column {
    position: static;
  }

  .product-image {
    height: 400px;
  }

  .thumbnail-btn {
    width: 80px;
    height: 80px;
  }
  
  .product-info h1 {
    font-size: 1.75rem;
  }
  
  .product-price {
    font-size: 1.75rem;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .quantity-selector {
    width: 100%;
    justify-content: center;
  }
  
  .product-actions .CartBtn {
    width: 100%;
  }
}
  --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;
}

[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: #10b981; /* 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 Cart Link Styles - removed duplicate, keeping updated version above */

/* 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: right;
}

/* 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);
}

/* Products Hero Section */
.products-hero {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  margin-bottom: 0;
  background: linear-gradient(135deg, 
    #2563eb 0%, 
    #1e40af 50%,
    #1e3a8a 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.products-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(147, 197, 253, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.products-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
}

.products-title {
  position: relative;
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.products-subtitle {
  position: relative;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

/* 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);
}
/* Responsive sort filter controls */
.sort-options {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1em;
}

.mobile-sort-select {
    display: none;
    padding: 8px;
    border: 1px solid var(--button-border);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    width: 100%;
    margin: 0.5em 0;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .sort-options {
        display: none !important;
    }
    .mobile-sort-select {
        display: block;
    }
}

/* Custom radio button styles (from asset.css, themed) */
.mydict div {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  justify-content: center;
  gap: 0.5rem;
}
.mydict input[type="radio"] {
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.mydict input[type="radio"]:checked + span {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  z-index: 1;
  color: var(--primary-text);
  transform: translateY(-2px);
}
label span {
  display: block;
  cursor: pointer;
  background-color: var(--card-bg);
  padding: 0.625rem 1.125rem;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  letter-spacing: -0.01em;
  color: var(--text-color);
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 2px solid var(--card-border);
}
label span:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}
label span:active {
  transform: translateY(0);
}
label:first-child span {
  border-radius: 12px 0 0 12px;
}
label:last-child span {
  border-radius: 0 12px 12px 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;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* Modern Product Grid and Cards */
.main-content-wrapper {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: all var(--transition-speed) var(--transition-ease);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
  background: var(--card-hover);
  border-color: var(--primary-color);
}

/* Product list image container to keep a consistent aspect ratio without cropping */
.product-media {
  width: 100%;
  aspect-ratio: 1 / 1; /* uniform square thumbnails across all cards */
  /* Subtle dotted pattern over the card background to make letterboxing feel intentional */
  background:
    radial-gradient(circle at 25% 25%, rgba(0,0,0,0.04) 2px, transparent 2px) 0 0/16px 16px,
    radial-gradient(circle at 75% 75%, rgba(0,0,0,0.04) 2px, transparent 2px) 0 0/16px 16px,
    #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* prevent cropping or distortion */
  object-position: center;
  display: block;
  padding: var(--space-sm);
  /* Subtle drop shadow around the image only */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

/* New Badge Styling - Modern and Eye-catching */
.new-badge {
  position: absolute;
  top: 12px;
  right: 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;
  right: 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);
  }
}

/* New badge for product detail page */
.product-detail-new-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  z-index: 10;
}

.product-detail-new-badge::before {
  content: '';
  width: 16px;
  height: 16px;
  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 detail page */
.product-detail-sale-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  z-index: 10;
}

.product-detail-sale-badge::before {
  content: '';
  width: 16px;
  height: 16px;
  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;
}

.product-info {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-color);
  line-height: 1.4;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--price-regular);
  margin-bottom: var(--space-sm);
  min-height: 2em;
  display: flex;
  align-items: center;
}

.product-description {
  font-weight: 400; /* Adjust font weight */
  font-size: 1rem; /* Adjust font size */
  color: var(--secondary-text);
  margin-bottom: var(--space-md);
  flex: 1;
}

.add-to-cart {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

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

.add-to-cart:active {
  transform: translateY(0);
}

.add-to-cart i {
  font-size: 1.25rem;
}

/* Product card title and description styles for grid cards */
.product-card-link h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-sm) 0;
  color: var(--text-color);
  line-height: 1.4;
}

.product-card-link .product-desc {
  font-size: 0.875rem;
  color: var(--secondary-text);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em; /* Ensures consistent height for 2 lines */
}

/* Modern Responsive Styles */
@media (max-width: 768px) {
  .products-hero {
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 0;
  }

  .products-title {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
  }

  .products-subtitle {
    font-size: 0.875rem;
  }
  
  .search-container {
    padding: 1rem;
  }
  
  #search-bar {
    max-width: 100%;
    padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    font-size: 0.9375rem;
    border-radius: 10px;
    background-position: 0.875rem center;
    background-size: 18px;
  }

  .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;
  }

  /* Hide full search bar on mobile, show icon only */
  .header-search-container {
    max-width: 40px;
    flex: 0;
    position: relative;
  }

  .header-search-container #search-bar {
    width: 40px;
    padding: 0.625rem;
    background-position: center;
    cursor: pointer;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
  }

  .header-search-container #search-bar:focus,
  .header-search-container #search-bar.expanded {
    position: fixed;
    width: calc(100vw - 240px);
    max-width: none;
    left: 60px;
    right: auto;
    text-indent: 0;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    background-position: 0.75rem center;
    cursor: text;
    z-index: 100;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
    top: 35px;
  }

  .main-content-wrapper {
    padding: var(--space-md);
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
  }

  /* Modern Off-canvas sidebar */
  #category-sidebar {
    position: fixed;
    top: 0;
    left: 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-right: 1px solid var(--card-border);
  }

  /* Inner scrollable area so the close button stays visible */
  #category-sidebar .sidebar-inner {
    height: 100vh;
    overflow-y: auto;
    padding: 3.5rem 1rem 2rem 1rem; /* room for close button and content */
    box-sizing: border-box;
  }

  /* 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-only sidebar layout: scope these rules to larger viewports so mobile
   media rules are not accidentally overridden by cascade. */
@media (min-width: 769px) {
  #category-sidebar {
    position: relative;
    flex: 0 0 200px; /* Fixed width sidebar on desktop */
    background-color: var(--sidebar-bg);
    padding: 1rem;
    border-right: 1px solid var(--sidebar-border);
    border-radius: 6px;
  }

  /* Ensure search bar is fully visible on desktop */
  .header-search-container {
    display: block;
  }

  .header-search-container #search-bar {
    width: 100%;
  }
}

/* Larger desktop screens - give more space to search */
@media (min-width: 1200px) {
  .header-search-container {
    max-width: 600px;
  }
}

#category-sidebar h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--text-color);
}

#category-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;  /* Added bottom margin */
}

/* Close button styles */
.close-menu {
  display: none; /* visible only on mobile via media query */
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

#category-list li {
  margin-bottom: 0.5rem;
}

#product-list-container { flex-grow: 1; padding: 0; } /* Product list takes remaining space, remove its own padding */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product-card { 
  border: 1px solid var(--card-border); 
  padding: 0.75rem; 
  border-radius: 6px; 
  background: var(--card-bg);
  /* Use flexbox to make the button anchor to the bottom */
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make the card link grow to push the footer down */
.product-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1; /* Takes up available space, pushing footer to bottom */
}

/* Footer section containing price and button, anchored at bottom */
.product-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto; /* Push to bottom if card is taller */
}

.product-price { font-weight: bold; margin-top: 0.5rem; }

.product-price-block {
  margin: 0; /* Remove default margins for tight spacing */
  padding: 0.25rem 0; /* Small vertical padding */
  min-height: 3.5rem; /* Ensure consistent height for price area */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.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 */
}

.IconContainer {
  position: absolute;
  left: -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;
}

.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;
  right: 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;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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);
}

/* Cart page styles */
#cart-items-container { padding: 1rem; }
/* Style for the loading state */
#cart-items-container.loading {
  opacity: 0.5;
  pointer-events: none; /* Prevent clicks while loading */
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--card-border);
  transition: background-color var(--transition-speed) var(--transition-ease);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

.cart-item:hover {
  background: var(--card-hover);
}

.quantity-change, .remove-item {
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  margin: 0 0.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition-speed) var(--transition-ease);
  font-size: 0.875rem;
}

.quantity-change {
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--button-text);
}

.quantity-change:hover {
  background: var(--button-hover);
  transform: scale(1.05);
}

.remove-item {
  background: var(--error-bg);
  border: 1px solid var(--error-color);
  color: var(--error-color);
}

.remove-item:hover {
  background: var(--error-color);
  color: white;
}
#total-price-container {
  padding: 1.5rem 1rem;
  text-align: right;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  background: var(--card-hover);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  border: 2px solid var(--card-border);
}

#total-price-container strong {
  color: var(--price-regular);
}

#customer-form {
  padding: 1.5rem 1rem;
  border-top: 2px solid var(--sidebar-border);
  margin-top: 1rem;
  background: var(--card-bg);
  border-radius: var(--radius-md);
}
#customer-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9375rem;
}
#customer-form input {
  width: 100%;
  padding: 0.75rem;
  box-sizing: border-box;
  background: var(--bg-color);
  color: var(--text-color);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all var(--transition-speed) var(--transition-ease);
}

#customer-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   MODERN CART PAGE STYLES
   ======================================== */

/* Cart Page Container */
.cart-page {
  background: var(--bg-color);
  min-height: calc(100vh - 80px);
  padding: 2rem 1rem;
}

.cart-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Cart Header */
.cart-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid color-mix(in srgb, var(--card-border) 30%, transparent);
}

.cart-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-subtitle {
  font-size: 1.125rem;
  color: var(--secondary-text);
  margin: 0;
  font-weight: 500;
}

/* Cart Content Layout */
.cart-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: start;
}

/* Cart Items Section */
.cart-items-section {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  overflow: hidden;
  min-height: 400px;
}

.cart-items-list {
  padding: 1.5rem;
}

/* Individual Cart Item */
.cart-item {
  display: grid;
  grid-template-columns: 160px 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 2px solid transparent;
  transition: all var(--transition-speed) var(--transition-ease);
  position: relative;
  overflow: hidden;
}

.cart-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color) 3%, transparent) 0%,
    transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.cart-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cart-item:hover::before {
  opacity: 1;
}

/* Cart Item Image */
.cart-item-image {
  width: 160px;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--primary-color) 3%, transparent) 0%, 
    color-mix(in srgb, var(--card-bg) 100%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--card-border) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Cart new badge */
.cart-new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  animation: pulse-badge 2s ease-in-out infinite;
}

.cart-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;
}

/* Cart discount badge */
.cart-discount-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  font-size: 0.65rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  animation: pulse-sale-badge 2s ease-in-out infinite;
  width: auto;
  height: auto;
}

.cart-discount-badge::before {
  content: '';
  width: 12px;
  height: 12px;
  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;
}

/* Cart Item Info */
.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  min-width: 0; /* Allows text truncation to work properly */
}

.cart-item-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.cart-item-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--price-regular);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

/* Cart discount price styles */
.cart-item-original-price {
  text-decoration: line-through;
  color: var(--price-original);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.6;
  line-height: 1.2;
}

.cart-item-discounted-price {
  color: var(--price-discount);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}

/* Quantity Controls */
.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  padding: 0.5rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
}

.quantity-change {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--primary-color);
  color: var(--button-text);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) var(--transition-ease);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.quantity-change:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.quantity-change:active:not(:disabled) {
  transform: scale(0.95);
}

.quantity-change:disabled {
  background: var(--card-border);
  color: var(--muted-text);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.cart-item-qty {
  min-width: 40px;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
}

/* 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);
}

/* Remove Button */
.cart-item-remove {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.remove-item {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--error-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) var(--transition-ease);
  padding: 0;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}

.remove-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--error-bg);
  border-radius: 8px;
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.remove-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  position: relative;
  z-index: 1;
  transition: all var(--transition-speed) var(--transition-ease);
}

.remove-item:hover {
  color: #dc2626;
  transform: scale(1.1);
}

.remove-item:hover::before {
  opacity: 1;
}

.remove-item:hover svg {
  stroke-width: 3;
}

.remove-item:active {
  transform: scale(0.95);
}

.remove-item:active svg {
  transform: rotate(15deg);
}

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

.empty-cart-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  color: var(--muted-text);
  opacity: 0.5;
}

.empty-cart-icon svg {
  width: 100%;
  height: 100%;
}

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

.empty-cart-state p {
  font-size: 1.125rem;
  color: var(--secondary-text);
  margin: 0 0 2rem 0;
}

.continue-shopping-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: var(--primary-text);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-speed) var(--transition-ease);
}

.continue-shopping-btn svg {
  width: 20px;
  height: 20px;
}

.continue-shopping-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.continue-shopping-btn:active {
  transform: translateY(0);
}

/* Order Summary Sidebar */
.order-summary {
  position: sticky;
  top: 100px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  overflow: hidden;
}

.summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  padding: 1.5rem;
  border-bottom: 2px solid var(--card-border);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color) 5%, transparent) 0%,
    transparent 100%);
}

/* Summary Details */
.summary-details {
  padding: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-color);
}

.summary-row span:first-child {
  font-weight: 500;
  color: var(--secondary-text);
}

.summary-value {
  font-weight: 600;
  color: var(--text-color);
}

.shipping-note {
  font-size: 0.875rem;
  color: var(--muted-text);
  font-style: italic;
}

.summary-divider {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--card-border), transparent);
  margin: 1.5rem 0;
}

.summary-total {
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 2px solid var(--card-border);
}

.summary-total span:first-child {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.total-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--price-regular);
  letter-spacing: -0.02em;
}

/* Customer Form */
.customer-form {
  padding: 1.5rem;
  border-top: 2px solid var(--card-border);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color) 3%, transparent) 0%,
    transparent 100%);
}

.form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.5rem 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.form-group label svg {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-color);
  transition: all var(--transition-speed) var(--transition-ease);
  box-sizing: border-box;
  /* Prevent zoom on iOS when focusing inputs */
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder {
  color: var(--muted-text);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  background: var(--bg-color);
}

/* Order Button */
.order-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1.125rem 1.5rem;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all var(--transition-speed) var(--transition-ease);
}

.order-btn svg {
  width: 24px;
  height: 24px;
}

.order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
  background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
}

.order-btn:active {
  transform: translateY(0);
}

.order-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive Design - Large Tablet/Small Desktop */
@media (max-width: 1200px) {
  .cart-content-wrapper {
    grid-template-columns: 1fr 400px;
    gap: 1.75rem;
  }

  .cart-item {
    grid-template-columns: 140px 1fr auto auto;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .cart-item-image {
    width: 140px;
    height: 140px;
  }
}

/* Responsive Design - Large Tablet/Small Desktop */
@media (max-width: 1200px) {
  .cart-content-wrapper {
    grid-template-columns: 1fr 400px;
    gap: 1.75rem;
  }

  .cart-item {
    grid-template-columns: 140px 1fr auto auto;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .cart-item-image {
    width: 140px;
    height: 140px;
  }
}

/* Responsive Design - Mobile/Tablet (Single Column Layout) */
@media (max-width: 999px) {
  .cart-page {
    padding: 1rem 0.5rem;
  }

  .cart-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }

  .cart-title {
    font-size: 2rem;
  }

  .cart-subtitle {
    font-size: 1rem;
  }

  .cart-content-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .order-summary {
    position: static;
    order: 2;
  }

  .cart-items-section {
    order: 1;
  }

  .cart-items-list {
    padding: 1rem;
  }

  .cart-item {
    grid-template-columns: 120px 1fr auto auto;
    gap: 1rem;
    padding: 1rem;
  }

  .cart-item-image {
    width: 120px;
    height: 120px;
  }

  .cart-item-name {
    font-size: 1rem;
  }

  .cart-item-price {
    font-size: 1.125rem;
  }

  .cart-item-discounted-price {
    font-size: 1.25rem;
  }

  .quantity-change {
    width: 38px;
    height: 38px;
  }

  .form-group input {
    font-size: 16px; /* Prevent zoom on iPad */
  }
}

/* Responsive Design - Mobile (Smaller Screens) */
@media (max-width: 768px) {
  .cart-title {
    font-size: 1.875rem;
  }

  .cart-item {
    grid-template-columns: 100px 1fr auto auto;
    gap: 0.875rem;
    padding: 1rem;
    margin-bottom: 0.875rem;
  }

  .cart-item-image {
    width: 100px;
    height: 100px;
  }

  .cart-item-name {
    font-size: 0.9375rem;
    line-height: 1.3;
  }

  .cart-item-price {
    font-size: 1.125rem;
  }

  .cart-item-original-price {
    font-size: 0.875rem;
  }

  .cart-item-discounted-price {
    font-size: 1.125rem;
  }

  .cart-new-badge {
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    padding: 0.35rem;
  }

  .cart-new-badge::before {
    width: 12px;
    height: 12px;
  }

  .cart-discount-badge {
    bottom: 4px;
    left: 4px;
    font-size: 0.6rem !important;
    padding: 0.25rem 0.45rem;
    gap: 0.25rem;
  }

  .cart-discount-badge::before {
    width: 10px;
    height: 10px;
  }

  .quantity-change {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .cart-item-qty {
    min-width: 34px;
    font-size: 0.95rem;
  }

  .cart-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .remove-item {
    width: 38px;
    height: 38px;
  }

  .remove-item svg {
    width: 22px;
    height: 22px;
  }

  .empty-cart-state {
    padding: 3rem 1.5rem;
  }

  .empty-cart-icon {
    width: 100px;
    height: 100px;
  }

  .empty-cart-state h2 {
    font-size: 1.5rem;
  }

  .empty-cart-state p {
    font-size: 1rem;
  }

  .summary-card {
    border-radius: 12px;
  }

  .summary-title {
    font-size: 1.25rem;
    padding: 1.25rem;
  }

  .summary-details {
    padding: 1.25rem;
  }

  .customer-form {
    padding: 1.25rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }

  .order-btn {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
}

/* Responsive Design - Small Mobile (2-Column Grid Layout) */
@media (max-width: 520px) {
  .cart-title {
    font-size: 1.75rem;
  }

  .cart-item {
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto auto;
    gap: 0.875rem;
    padding: 1rem;
    margin-bottom: 0.875rem;
  }

  .cart-item-image {
    width: 110px;
    height: 110px;
    grid-row: 1 / 3;
    grid-column: 1;
  }

  .cart-item-info {
    grid-column: 2;
    grid-row: 1;
    padding-right: 2.75rem; /* Add padding to prevent overlap with delete button */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: start;
    min-width: 0; /* Allow content to shrink */
  }

  .cart-item-name {
    font-size: 0.9375rem;
    line-height: 1.3;
    /* Prevent text overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
  }

  .cart-item-price {
    font-size: 1.125rem;
    margin-top: 0.25rem;
  }

  .cart-item-original-price {
    font-size: 0.875rem;
  }

  .cart-item-discounted-price {
    font-size: 1.125rem;
  }

  .cart-item-quantity {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-self: end;
    padding: 0.375rem 0.5rem;
    gap: 0.5rem;
    width: auto;
    min-width: fit-content;
    margin-top: 0;
  }

  .quantity-change {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }

  .cart-item-qty {
    min-width: 36px;
    font-size: 1rem;
  }

  .cart-item-remove {
    position: absolute;
    top: 1.125rem;
    right: 1.125rem;
    inset-inline-end: 1.125rem; /* Use logical property for RTL support */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Override for RTL cart items */
  .cart-item[dir="rtl"] .cart-item-remove {
    right: auto;
    left: 1.125rem;
    inset-inline-end: auto;
    inset-inline-start: 1.125rem;
  }

  .remove-item {
    width: 40px;
    height: 40px;
  }

  .remove-item svg {
    width: 22px;
    height: 22px;
  }
}

/* Extra Small Screens */
@media (max-width: 480px) {
  .cart-page {
    padding: 0.75rem 0.5rem;
  }

  .cart-title {
    font-size: 1.5rem;
  }

  .cart-subtitle {
    font-size: 0.9375rem;
  }

  .cart-items-list {
    padding: 0.5rem;
  }

  .cart-item {
    padding: 0.875rem;
    gap: 0.75rem;
    grid-template-columns: 90px 1fr;
  }

  .cart-item-image {
    width: 90px;
    height: 90px;
  }

  .cart-new-badge {
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    padding: 0.3rem;
  }

  .cart-new-badge::before {
    width: 11px;
    height: 11px;
  }

  .cart-discount-badge {
    bottom: 3px;
    left: 3px;
    font-size: 0.55rem !important;
    padding: 0.2rem 0.4rem;
    gap: 0.2rem;
  }

  .cart-discount-badge::before {
    width: 9px;
    height: 9px;
  }

  .cart-item-info {
    padding-right: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-self: start;
    min-width: 0; /* Allow content to shrink */
  }

  .cart-item-name {
    font-size: 0.875rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .cart-item-price {
    font-size: 1rem;
  }

  .cart-item-original-price {
    font-size: 0.8125rem;
  }

  .cart-item-discounted-price {
    font-size: 1rem;
  }

  .cart-item-quantity {
    padding: 0.25rem 0.35rem;
    gap: 0.35rem;
    width: auto;
    align-self: end;
    margin-top: 0;
    max-width: 100%;
  }

  .quantity-change {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .cart-item-qty {
    min-width: 28px;
    font-size: 0.875rem;
  }

  .cart-item-remove {
    top: 1rem;
    right: 1rem;
    inset-inline-end: 1rem;
  }

  .cart-item[dir="rtl"] .cart-item-remove {
    left: 1rem;
    inset-inline-start: 1rem;
  }

  .remove-item {
    width: 36px;
    height: 36px;
  }

  .remove-item svg {
    width: 20px;
    height: 20px;
  }

  .stock-warning {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .summary-title {
    font-size: 1.125rem;
    padding: 1rem;
  }

  .summary-details {
    padding: 1rem;
  }

  .customer-form {
    padding: 1rem;
  }

  .form-title {
    font-size: 1.125rem;
  }

  .form-group input {
    padding: 0.75rem 0.875rem;
    font-size: 16px; /* 16px prevents iOS zoom on focus */
  }

  .order-btn {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .order-btn svg {
    width: 20px;
    height: 20px;
  }

  .continue-shopping-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* Category styles */
.category-section {
  margin-bottom: 2rem;
}

.category-title {
  border-bottom: 2px solid var(--sidebar-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Category filter buttons */
#category-list button {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--secondary-text);
  transition: all var(--transition-speed) var(--transition-ease);
  border-radius: var(--radius-md);
  min-height: 44px;
  position: relative;
}

#category-list button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition-speed) var(--transition-ease);
}

#category-list button:hover, #category-list button.active {
  color: var(--primary-color);
  font-weight: 600;
  background: var(--card-hover);
  padding-left: 1.25rem;
}

#category-list button.active::before,
#category-list button:hover::before {
  height: 60%;
}

/* Focus state for keyboard accessibility */
#category-list button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Special styling for Featured category */
#category-list button[data-category="Featured"] {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  font-weight: 700;
  padding-left: 1rem;
  border-left: 4px solid #d97706;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  position: relative;
  overflow: hidden;
}

#category-list button[data-category="Featured"]::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  transform: none;
  border-radius: 0;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

#category-list button[data-category="Featured"]::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2378350f"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-50%) scale(1.2) rotate(15deg);
  }
}

#category-list button[data-category="Featured"]:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.5);
  transform: translateX(4px);
  padding-left: 1.5rem;
}

#category-list button[data-category="Featured"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.6);
}

#category-list button[data-category="Featured"].active::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
}

/* Special styling for Discounts category */
#category-list button[data-category="Discounts"] {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #ffffff;
  font-weight: 700;
  padding-left: 1rem;
  border-left: 4px solid #991b1b;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  position: relative;
  overflow: hidden;
}

#category-list button[data-category="Discounts"]::before {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.1) 10px,
    rgba(255, 255, 255, 0.1) 20px
  );
  width: 200%;
  height: 200%;
  top: -50%;
  left: -100%;
  transform: none;
  border-radius: 0;
  animation: slide 8s linear infinite;
}

@keyframes slide {
  0% {
    left: -100%;
  }
  100% {
    left: 0%;
  }
}

#category-list button[data-category="Discounts"]::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7zm11.77 8.27L13 19.54l-4.27-4.27C8.28 14.81 8 14.25 8 13.5c0-1.38 1.12-2.5 2.5-2.5.69 0 1.32.28 1.77.74l.73.72.73-.73c.45-.45 1.08-.73 1.77-.73 1.38 0 2.5 1.12 2.5 2.5 0 .75-.28 1.31-.73 1.77z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: flame 1.5s ease-in-out infinite;
}

@keyframes flame {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-55%) scale(1.1);
    filter: brightness(1.3);
  }
}

#category-list button[data-category="Discounts"]:hover {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
  transform: translateX(4px);
  padding-left: 1.5rem;
}

#category-list button[data-category="Discounts"].active {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
  box-shadow: 0 6px 20px rgba(153, 27, 27, 0.6);
  border-left-color: #7f1d1d;
}

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

/* Search Bar Styles - Legacy (kept for other pages if needed) */
.search-container {
  padding: 1.5rem 1rem;
  background: var(--bg-color);
  position: relative;
  display: none; /* Hidden as search is now in header */
}

#search-bar {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background-color: var(--card-bg);
  color: var(--text-color);
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  position: relative;
  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='%236b7280' 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: 1rem center;
  background-size: 20px;
}

#search-bar:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15), 
              0 0 0 4px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

#search-bar:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

#search-bar::placeholder {
  color: var(--secondary-text);
}

/* Dark mode search icon - Legacy */
[data-theme="dark"] #search-bar {
  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='%239ca3af' 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");
}

/* --- Filter Pane (moved under search bar) --- */
.filter-pane {
  margin-top: 1.5rem;
  padding: 0 1rem 1.25rem 1rem;
  box-sizing: border-box;
}
.filter-pane .filter-inner {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--card-bg);
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--card-border);
}
.filter-pane .sort-block {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.filter-title {
  margin: 0;
  margin-right: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.01em;
}
.sort-options button {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-color);
}
.sort-options button.active {
  background: var(--primary-color);
  color: var(--primary-text);
  border-color: var(--primary-color);
}
.price-block { 
  margin-left: auto; 
  display: flex; 
  align-items: center; 
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-color);
  border-radius: 12px;
  border: 2px solid var(--card-border);
}
.price-slider-container { 
  display: flex; 
  align-items: center; 
  gap: 0.75rem;
}
#price-slider { 
  width: 180px;
  height: 6px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--slider-value, 100%), var(--card-border) var(--slider-value, 100%), var(--card-border) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-text);
  cursor: grab;
  box-shadow: 0 0 0 3px var(--primary-color), 0 3px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--primary-color);
}

#price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px var(--primary-color), 0 4px 12px rgba(37, 99, 235, 0.4);
}

#price-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

#price-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-text);
  cursor: grab;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color), 0 3px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#price-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px var(--primary-color), 0 4px 12px rgba(37, 99, 235, 0.4);
}

#price-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.price-range-display { 
  font-size: 1rem; 
  color: var(--text-color); 
  display: flex; 
  gap: 0.25rem; 
  align-items: center;
  font-weight: 600;
}

#price-range-input {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.125rem;
  border: 2px solid var(--card-border);
  background: var(--bg-color);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  width: 80px;
  text-align: center;
  transition: all 0.2s ease;
}

#price-range-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--card-bg);
}

#price-range-input::-webkit-inner-spin-button,
#price-range-input::-webkit-outer-spin-button {
  opacity: 1;
}

#price-range-value {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.125rem;
}

/* Ensure the price label and value never wrap onto multiple lines */
.price-range-display {
  white-space: nowrap;
  flex-wrap: nowrap;
}
.price-range-display span {
  white-space: nowrap;
}

/* Mobile Filter Button - Hidden on desktop */
.mobile-filter-btn {
  display: none;
}

/* Mobile Bottom Sheet Styles */
.filter-sheet-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-sheet-overlay.active {
  display: block;
  opacity: 1;
}

.filter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  z-index: 1000;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.filter-sheet.active {
  transform: translateY(0);
}

.filter-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}

.filter-sheet-header::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 5px;
  background: var(--muted-text);
  border-radius: 3px;
  opacity: 0.3;
}

.filter-sheet-header h2 {
  margin: 0;
  margin-top: 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.close-filter-sheet {
  background: var(--card-hover);
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.5rem;
}

.close-filter-sheet:hover {
  background: var(--card-border);
  transform: scale(1.05);
}

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

.filter-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.filter-section {
  margin-bottom: 2rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
}

.mobile-sort-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-sort-option {
  display: flex;
  align-items: center;
  padding: 1.125rem 1.25rem;
  background: var(--bg-color);
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mobile-sort-option:active {
  transform: scale(0.98);
}

.mobile-sort-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mobile-sort-option::before {
  content: '';
  display: inline-flex;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2.5px solid var(--card-border);
  border-radius: 50%;
  margin-right: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-bg);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-sort-option span {
  font-size: 1.0625rem;
  color: var(--text-color);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mobile-sort-option:has(input:checked) {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-color: var(--primary-color);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
  transform: translateY(-2px);
}

.mobile-sort-option:has(input:checked)::before {
  background: var(--primary-text);
  border-color: var(--primary-text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), inset 0 0 0 4px var(--primary-color);
}

.mobile-sort-option:has(input:checked) span {
  color: var(--primary-text);
  font-weight: 600;
}

.mobile-price-slider-container {
  padding: 1rem 0.5rem;
}

#mobile-price-slider {
  width: 100%;
  height: 6px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--slider-value, 100%), var(--card-border) var(--slider-value, 100%), var(--card-border) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
}

#mobile-price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-text);
  cursor: grab;
  box-shadow: 0 0 0 4px var(--primary-color), 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--primary-color);
}

#mobile-price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px var(--primary-color), 0 6px 16px rgba(37, 99, 235, 0.4);
}

#mobile-price-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

#mobile-price-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-text);
  cursor: grab;
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-color), 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-price-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px var(--primary-color), 0 6px 16px rgba(37, 99, 235, 0.4);
}

#mobile-price-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.mobile-price-display {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-color);
  border-radius: 12px;
  font-size: 1.125rem;
  color: var(--text-color);
  font-weight: 600;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-border);
}

#mobile-price-input {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.25rem;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  width: 90px;
  text-align: center;
  transition: all 0.2s ease;
}

#mobile-price-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#mobile-price-input::-webkit-inner-spin-button,
#mobile-price-input::-webkit-outer-spin-button {
  opacity: 1;
}

#mobile-price-value {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.25rem;
}

.filter-sheet-footer {
  padding: 1.25rem 1.5rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

.apply-filters-btn {
  width: 100%;
  padding: 1.125rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: var(--primary-text);
  border: none;
  border-radius: 16px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
  letter-spacing: -0.01em;
}

.apply-filters-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.apply-filters-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Make filters stack neatly on small screens */
@media (max-width: 600px) {
  /* Hide desktop filter pane on mobile */
  .filter-pane { 
    display: none;
  }

  /* Show mobile filter button */
  .mobile-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: calc(100% - 1rem);
    max-width: 100%;
    margin: 1.5rem 0.5rem 1rem 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--primary-text);
    border: none;
    border-radius: 16px;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    z-index: 100;
    letter-spacing: -0.01em;
    overflow: visible;
  }

  .mobile-filter-btn i {
    font-size: 1.375rem;
    display: inline-block;
    line-height: 1;
    flex-shrink: 0;
  }
  
  .mobile-filter-btn span {
    white-space: nowrap;
  }

  .mobile-filter-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  }

  .mobile-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  }
}

/* --- 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;
    right: 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;
    right: -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);
  }

  /* Cart badges at 600px and below */
  .cart-new-badge {
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    padding: 0.32rem;
  }

  .cart-new-badge::before {
    width: 11px;
    height: 11px;
  }

  .cart-discount-badge {
    bottom: 3px;
    left: 3px;
    font-size: 0.57rem !important;
    padding: 0.22rem 0.4rem;
    gap: 0.22rem;
  }

  .cart-discount-badge::before {
    width: 9px;
    height: 9px;
  }

  /* Center cart item images at 600px and below */
  .cart-item-image {
    align-self: center;
  }
  
  #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;
  }
  /* Sidebar layout on very small screens is handled by the off-canvas rules above; avoid overriding position here */
  #product-list-container {
    padding: 0;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr); /* 2-column grid on mobile */
    gap: 0.5rem; /* Reduced from 0.75rem */
  }
  .product-card {
    padding: 0.5rem; /* Maintain some padding for better spacing */
    font-size: 0.9rem; /* Slightly smaller for 2 columns */
  }
  .product-info {
    padding: 0.5rem; /* Reduced from 1rem */
  }
  .product-title {
    font-size: 0.95rem; /* Slightly smaller */
    margin-bottom: 0.25rem; /* Reduced spacing */
  }
  .product-description {
    font-size: 0.9rem; /* Smaller text */
    margin-bottom: 0.5rem; /* Reduced from 1rem */
    line-height: 1.3; /* Tighter line height */
  }
  .product-price {
    margin-bottom: 0.5rem; /* Reduced spacing */
    min-height: 1.5em; /* Reduced from 2em */
  }
  .product-media {
    aspect-ratio: 1 / 1; /* Keep square but will be smaller overall */
  }
  /* Thumbnails remain square; container scales with column width */
  /* Button already full width from base styles, just adjust height for mobile */
  .CartBtn {
    min-height: 38px;
    height: auto;
    font-size: 1em;
  }
  .search-container {
    padding: 0.75rem 0.5rem;
  }
  #search-bar {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 0.875rem;
    border-radius: 8px;
    background-position: 0.75rem center;
    background-size: 16px;
  }
  
  /* Notification Card - Mobile Optimized */
  .notification-card {
    left: 1rem;
    right: 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;
  }
  
  #cart-items-container {
    padding: 0.5rem;
  }
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0;
  }
  #total-price-container {
    padding: 0.5rem;
    font-size: 1rem;
  }
  #customer-form {
    padding: 0.5rem;
    margin-top: 0.5rem;
  }
  .category-section {
    margin-bottom: 1rem;
  }
  .category-title {
    font-size: 1.1rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
  }
  #category-list button {
    font-size: 0.98rem;
    padding: 0.4rem 0;
  }
}

/* --- 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-left: 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;
}

/* --- Trust Badges Styles --- */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: var(--space-xl);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color) 8%, transparent) 0%,
    color-mix(in srgb, var(--primary-color) 3%, transparent) 100%);
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary-color) 15%, transparent);
  box-shadow: var(--shadow-sm);
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  color: var(--text-color);
  padding: var(--space-sm);
  transition: transform var(--transition-speed) var(--transition-ease);
}

.trust-badge:hover {
  transform: translateY(-2px);
}

.trust-badge i {
  font-size: 2rem;
  color: var(--primary-color);
  background: var(--card-bg);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.trust-badge span {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
}

/* --- 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;
}

/* --- Related Products Section Styles --- */
.related-products-section {
  margin-top: 3rem;
  padding: var(--space-xl) 0;
  border-top: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
}

.related-products-section h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--space-xl);
  text-align: left;
  letter-spacing: -0.01em;
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.related-products-grid .product-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  transition: all var(--transition-speed) var(--transition-ease);
  overflow: hidden;
  position: relative;
}

.related-products-grid .product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color) 3%, transparent) 0%,
    transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
  pointer-events: none;
}

.related-products-grid .product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.related-products-grid .product-card:hover::before {
  opacity: 1;
}

.related-products-grid .product-img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  transition: transform 0.3s var(--transition-ease);
}

.related-products-grid .product-card:hover .product-img {
  transform: scale(1.05);
}

.related-products-grid .product-name {
  padding: var(--space-lg) var(--space-lg) var(--space-xs);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
}

.related-products-grid .product-price {
  padding: 0 var(--space-lg) var(--space-lg);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

/* --- 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-left: 0.25rem;
    font-size: 1rem;
  }
  
  .trust-badges {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
  }
  
  .trust-badge {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: var(--space-md);
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }
  
  .trust-badge i {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
  }
  
  .related-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .related-products-section h2 {
    font-size: 1.5rem;
  }
  
  .related-products-grid .product-img {
    height: 200px;
  }
  
  .related-products-grid .product-name {
    font-size: 0.9375rem;
    padding: var(--space-md) var(--space-md) var(--space-xs);
  }
  
  .related-products-grid .product-price {
    font-size: 1.125rem;
    padding: 0 var(--space-md) var(--space-md);
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .products-hero {
    padding: 1.5rem 0.75rem 1.25rem;
  }

  .products-title {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
  }

  .products-subtitle {
    font-size: 0.8125rem;
  }
  
  .search-container {
    padding: 0.75rem 0.5rem;
  }
  
  #search-bar {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 0.875rem;
    background-position: 0.75rem center;
  }

  /* Extra small screen adjustments for header search */
  .header-search-container #search-bar {
    font-size: 0.8125rem;
  }

  .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;
    transform: translateY(-50%);
    top: 50%;
  }
  
  /* 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;
  }
  
  /* Product page optimizations for extra small screens */
  .product-detail-page {
    padding: var(--space-md) var(--space-sm);
  }
  
  .product-container {
    padding: var(--space-lg);
    border-radius: 12px;
  }
  
  .product-image {
    height: 320px;
  }
  
  .thumbnail-btn {
    width: 70px;
    height: 70px;
  }
  
  .product-info h1 {
    font-size: 1.5rem;
  }
  
  .product-price {
    font-size: 1.5rem;
  }
  
  .product-description {
    font-size: 0.9375rem;
  }
  
  .breadcrumb {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
  }
  
  .trust-badges {
    padding: var(--space-md);
  }
  
  .trust-badge {
    padding: var(--space-sm);
  }
  
  .trust-badge i {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .trust-badge span {
    font-size: 0.875rem;
  }
  
  .related-products-grid {
    grid-template-columns: 1fr;
  }
  
  .related-products-grid .product-img {
    height: 240px;
  }
  
  .related-products-section {
    margin-top: 2rem;
  }
  
  .quantity-selector {
    padding: 0.125rem;
  }
  
  .quantity-btn {
    width: 36px;
    height: 36px;
  }
  
  #quantity {
    width: 50px;
    font-size: 1rem;
  }
  
  .product-actions .CartBtn {
    height: 50px;
    font-size: 1rem;
  }
}

/* ========================================
   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;
}

/* Product cards with Arabic content */
.product-card:has(.product-name:lang(ar)) .product-name,
.product-card:has([dir="rtl"]) .product-name {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 600;
  line-height: 1.6;
}

.product-card:has(.product-description:lang(ar)) .product-description,
.product-card:has([dir="rtl"]) .product-description {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  line-height: 1.7;
}

/* 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;
}

/* Category labels and navigation */
.category-item:lang(ar),
.filter-title:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 600;
}

/* Cart items with Arabic product names */
.cart-item-name:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 600;
  line-height: 1.6;
}

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

.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;
}

/* Ensure proper alignment for mixed content */
.product-card {
  text-align: start;
}

/* RTL adjustments for product cards */
[dir="rtl"] .product-card,
.product-card:has([dir="rtl"]) {
  text-align: right;
}

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

/* 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; }
  
  /* Fix cart item overlap with delete button on mobile for all languages */
  .cart-item-info {
    /* Ensure there's always space for the delete button on both sides */
    padding-inline-end: 3rem !important;
  }
  
  /* Fix cart item name overlap with delete button on mobile for RTL */
  .cart-item-name[lang="ar"],
  .cart-item-name[dir="rtl"] {
    max-width: 100%; /* Ensure text doesn't overflow into button area */
  }
  
  /* RTL-specific cart item info padding - use logical properties */
  [dir="rtl"] .cart-item-info {
    padding-inline-start: 3rem !important;
    padding-inline-end: 0 !important;
  }
  
  /* Adjust delete button position for RTL */
  [dir="rtl"] .cart-item-remove {
    right: auto;
    left: 1rem; /* Position on left for RTL */
  }
  
  /* Fallback for browsers without :has() support */
  .cart-item-name[lang="ar"] ~ .cart-item-remove,
  .cart-item-name[dir="rtl"] ~ .cart-item-remove {
    right: auto;
    left: 1rem;
  }
}

/* Product detail page Arabic support */
.product-detail-name:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

.product-detail-description:lang(ar) {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  line-height: 1.8;
}

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

/* --- Loading States (Skeleton Loaders) --- */
.skeleton-loader {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
  width: 100%;
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--card-border) 30%, transparent);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.skeleton-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(90deg, 
    color-mix(in srgb, var(--card-border) 15%, transparent) 0%, 
    color-mix(in srgb, var(--card-border) 25%, transparent) 50%, 
    color-mix(in srgb, var(--card-border) 15%, transparent) 100%);
  background-size: 200% 100%;
  border-radius: 12px;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-text {
  height: 1rem;
  background: linear-gradient(90deg, 
    color-mix(in srgb, var(--card-border) 20%, transparent) 0%, 
    color-mix(in srgb, var(--card-border) 30%, transparent) 50%, 
    color-mix(in srgb, var(--card-border) 20%, transparent) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-top: 1rem;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
  margin-top: 0.5rem;
}

.skeleton-button {
  width: 100%;
  height: 2.5rem;
  background: linear-gradient(90deg, 
    color-mix(in srgb, var(--primary-color) 30%, transparent) 0%, 
    color-mix(in srgb, var(--primary-color) 40%, transparent) 50%, 
    color-mix(in srgb, var(--primary-color) 30%, transparent) 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  margin-top: 1rem;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- 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: left;
}

.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) {
  .skeleton-loader {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .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;
  }
}
