/* ============================================
   Khedar — Design System & Styles
   Font: Outfit | Fresh, organic e-commerce
   ============================================ */

:root {
  /* Colors — organic, fresh */
  --color-primary: #2d6a4f;
  --color-primary-dark: #1b4332;
  --color-primary-light: #40916c;
  --color-secondary: #40916c;
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  --gradient-primary-reverse: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  --color-accent: #95d5b2;
  --color-accent-soft: #d8f3dc;
  
  --color-text: #1a1a1a;
  --color-text-muted: #5c6b6a;
  --color-text-light: #8b9b9a;
  
  --color-bg: #faf9f6;
  --color-bg-card: #ffffff;
  --color-border: #e8ebe9;
  
  --color-badge: #e63946;
  --color-badge-bio: #2d6a4f;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-outfit: 'Outfit', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* Layout */
  --max-width: 1280px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition: 0.2s ease;
}

/* Skip to main content — visible on focus for accessibility */
.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-md);
  z-index: 9999;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: var(--space-md);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skip-link {
    transition: none;
  }
}

body {
  font-family: var(--font-outfit);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

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

[dir="rtl"] .header-inner,
[dir="rtl"] .nav.nav-desktop,
[dir="rtl"] .nav-links,
[dir="rtl"] .product-footer,
[dir="rtl"] .footer-main,
[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ========== Layout ========== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ========== Header & Navigation ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header-bar {
  background: #fff;
}

@media (min-width: 769px) {
  .header.is-scrolled .header-bar {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }
}

.header .container {
  position: relative;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--color-primary);
}

.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  display: block;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--color-primary);
  background: var(--color-accent-soft);
}

.nav-links a.active {
  color: var(--color-primary);
  font-weight: 600;
}

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

.lang-switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-switch a {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition);
}

.lang-switch a.active {
  background: var(--color-primary);
  color: white;
}

.lang-switch a:not(.active):hover {
  background: var(--color-accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-outfit);
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-accent-soft);
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition);
  text-decoration: none;
}

.cart-btn:hover {
  background: var(--color-accent);
}

.cart-btn .count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: var(--color-badge);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Hero Section (Hero1 style, Khedar green theme) ========== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a1612;
  color: white;
  overflow: hidden;
}

.hero-1-gradients {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-1-blobs {
  position: absolute;
  width: 40rem;
  height: 25rem;
  filter: blur(4rem);
  opacity: 0.5;
  border-radius: 50%;
}

.hero-1-blobs--1 {
  top: -40rem;
  right: -30rem;
  transform: rotate(-20deg) skew(-40deg);
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, var(--color-accent) 50%, var(--color-primary-light) 100%);
}

.hero-1-blobs--2 {
  top: -50rem;
  right: -50rem;
  transform: rotate(-20deg) skew(-40deg);
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, var(--color-primary-light) 50%, var(--color-primary) 100%);
}

.hero-1-blobs--3 {
  top: -60rem;
  right: -60rem;
  width: 50rem;
  height: 35rem;
  transform: rotate(-20deg) skew(-40deg);
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, var(--color-primary) 100%);
}

.hero-1-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.hero-1-inner {
  max-width: 56rem;
  margin: 0 auto;
}

.hero-1-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.hero-1-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: #1a2520;
  border-radius: 9999px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
}

.hero-1-badge-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: #0a1612;
  border-radius: 50%;
}

.hero-1-title {
  font-size: clamp(var(--text-3xl), 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-1-subtitle {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-2xl);
}

.hero-1-search-wrap { position: relative; max-width: 36rem; width: 100%; margin: 0 auto var(--space-2xl); }
.hero-1-search {
  display: flex;
  align-items: center;
  background: #1a2520;
  border-radius: 9999px;
  padding: var(--space-sm);
  width: 100%;
}
.hero-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-xs);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}
.hero-search-suggestions a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.hero-search-suggestions a:last-child { border-bottom: none; }
.hero-search-suggestions a:hover { background: rgba(45, 106, 79, 0.08); }
.hero-search-suggestions img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.hero-search-suggestions .suggestion-name { flex: 1; font-weight: 500; }
.hero-search-suggestions .suggestion-price { color: var(--color-primary); font-weight: 600; font-size: var(--text-sm); }

.hero-1-search-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.hero-1-search-sparkle {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-accent);
  transition: background 0.2s;
  flex-shrink: 0;
}

.hero-1-search-sparkle:hover {
  background: #2a3528;
}

.hero-1-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  padding: 0 var(--space-md);
  font-size: var(--text-base);
  font-family: var(--font-outfit);
}

.hero-1-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.hero-1-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 36rem;
  margin: 0 auto;
}

.hero-1-pill {
  display: inline-block;
  background: #1a2520;
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-sm) var(--space-md);
  border-radius: 9999px;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.hero-1-pill:hover {
  background: #2a3528;
  color: white;
}

/* ========== Hero Compact (40vh for inner pages) ========== */
.hero-compact {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1612;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-compact-gradients {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-compact-blob {
  position: absolute;
  width: 30rem;
  height: 20rem;
  filter: blur(4rem);
  opacity: 0.4;
  border-radius: 50%;
}

.hero-compact-blob--1 {
  top: -15rem;
  right: -20rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, var(--color-accent) 100%);
}

.hero-compact-blob--2 {
  bottom: -10rem;
  left: -15rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, var(--color-primary) 100%);
}

.hero-compact-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero-compact-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.hero-compact-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-base);
}

[dir="rtl"] .hero-1-pills {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-1-search {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-1-search-input {
  text-align: right;
}

/* ========== Categories ========== */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

.category-card span {
  font-weight: 600;
  font-size: var(--text-lg);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========== Category Tabs (browse by category) ========== */
.category-tabs-wrapper {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  position: relative;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-card);
  border-radius: 9999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
}

.category-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 9999px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.25s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
  cursor: pointer;
  border: none;
  background: transparent;
}

.category-tab:hover {
  color: var(--color-primary);
  transform: scale(1.05);
}

.category-tab:active {
  transform: scale(0.97);
}

.category-tab.is-active {
  color: var(--color-primary);
  font-weight: 600;
}

.category-tab[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: 600;
}

.category-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg);
  flex-shrink: 0;
}

.category-tab-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tab-indicator {
  position: absolute;
  bottom: var(--space-sm);
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 9999px;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.category-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Category tabs — products grid & load more */
.category-tabs-products {
  padding-top: var(--space-2xl);
  min-height: 200px;
}

.category-tabs-products-grid {
  margin-bottom: var(--space-xl);
}

.category-tabs-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0;
}

.category-tabs-load-more-wrap .btn {
  min-width: 180px;
}

[dir="rtl"] .category-tabs {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  .category-tabs-wrapper {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-md) 0 var(--space-lg);
    margin: 0 calc(-1 * var(--space-lg));
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
  .category-tabs {
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: var(--space-xs);
    padding: var(--space-xs);
  }
  .category-tab {
    flex: 0 0 auto;
    padding: var(--space-sm) var(--space-sm);
    gap: 8px;
    font-size: var(--text-xs);
    line-height: 1.1;
    min-height: 52px;
  }
  .category-tab-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .category-tab-label {
    max-width: 92px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .category-tab-indicator {
    bottom: 4px;
    height: 2px;
  }
  .category-tabs-products {
    padding-top: var(--space-xl);
  }
}

/* ========== Products — Card Design (Outfit) ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-xl);
  font-family: var(--font-outfit);
}

.product-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  font-family: var(--font-outfit);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(45, 106, 79, 0.12);
  border-color: var(--color-accent);
}

.product-content {
  position: relative;
  z-index: 1;
}

.product-image-link {
  display: block;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, #e8ebe9 100%);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

/* Multiple images: stack and show one at a time (hover cycle) */
.product-image img.product-card-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.product-image img.product-card-img.is-visible {
  position: relative;
  opacity: 1;
}
.product-image img.product-card-img[src=""],
.product-image img.product-card-img:not([src]) {
  opacity: 0;
  min-height: 100%;
}

.product-image img[src=""],
.product-image img:not([src]) {
  opacity: 0;
  min-height: 100%;
}

.product-card:hover .product-image img.is-visible,
.product-card:hover .product-image img:not(.product-card-img) {
  transform: scale(1.06);
}

/* Wishlist toggle button */
.wishlist-toggle {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.wishlist-toggle:hover {
  background: white;
  color: var(--color-primary);
  transform: scale(1.05);
}
.wishlist-toggle.is-active {
  color: #dc2626;
  background: rgba(255,255,255,0.95);
}
.header-wishlist-btn {
  padding: var(--space-xs) var(--space-sm);
  font-size: 1.25rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.header-wishlist-btn:hover { color: var(--color-primary); }

.product-badge {
  position: absolute;
  top: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-family: var(--font-outfit);
  letter-spacing: 0.02em;
}

.product-badge--bio {
  left: var(--space-md);
  background: var(--color-badge-bio);
  color: white;
}

.product-badge--new {
  left: var(--space-md);
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
}

.product-badge--new + .product-badge--bio {
  top: calc(var(--space-md) + 1.5rem);
}

.product-badge--sale {
  right: var(--space-md);
  left: auto;
  background: var(--color-badge);
  color: white;
}

.product-badge--rupture {
  left: var(--space-md);
  background: #6b7280;
  color: white;
}

.product-badge--low-stock {
  left: auto;
  right: var(--space-md);
  bottom: var(--space-md);
  top: auto;
  background: #b45309;
  color: white;
  font-size: var(--text-xs);
}

.product-price-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
}

.product-price-original {
  text-decoration: line-through;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.product-price-unit {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.product-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  font-family: var(--font-outfit);
}

.product-content h3 {
  font-family: var(--font-outfit);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  line-height: 1.3;
}

.product-content h3 a {
  color: inherit;
  transition: color var(--transition);
}
.product-content h3 a:hover {
  color: var(--color-primary);
}

.product-unit {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  font-family: var(--font-outfit);
}

/* Normal / Bio variant toggle on cards and product page */
.product-variant-toggle {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
}
.variant-btn {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  font-family: var(--font-outfit);
  font-weight: 500;
  border: none;
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.variant-btn:hover {
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
.variant-btn.is-active {
  background: var(--color-primary);
  color: #fff;
}

/* Quantity selector — input wide enough for grams (e.g. 1000, 50000) */
.product-qty {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-outfit);
}

.qty-unit-label,
.qty-unit-select {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: 0 var(--space-sm);
  font-family: var(--font-outfit);
  flex-shrink: 0;
}

.qty-unit-switch {
  font-size: var(--text-sm);
  font-family: var(--font-outfit);
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0 var(--space-xs);
  min-width: 2.5em;
}

.qty-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-outfit);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.qty-btn:hover {
  background: var(--color-primary);
  color: white;
}

.qty-btn:first-child { border-radius: 0; }
.qty-btn:last-child { border-radius: 0; }

.qty-input {
  flex: 1 1 auto;
  min-width: 72px;
  width: 0;
  height: 38px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-family: var(--font-outfit);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  padding: 0 var(--space-xs);
  box-sizing: border-box;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { opacity: 1; }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.product-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-outfit);
}

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

.add-to-cart-btn {
  min-width: 42px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  font-family: var(--font-outfit);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--transition);
  overflow: hidden;
}

.add-to-cart-btn svg {
  flex-shrink: 0;
}

/* On hover, show "Add to cart" label next to icon (cards) */
.add-to-cart-btn-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width var(--transition), opacity var(--transition);
}
.add-to-cart-btn:hover {
  width: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  background: var(--color-primary);
  color: white;
}
.add-to-cart-btn:hover .add-to-cart-btn-label {
  max-width: 10em;
  opacity: 1;
}

.add-to-cart-btn--added {
  background: var(--color-primary) !important;
  color: white !important;
}

.buy-now-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-outfit);
  transition: all var(--transition);
}

.buy-now-btn:hover {
  background: var(--color-primary-dark);
}

/* Product page: clearly different Add to cart (primary) vs Buy now (secondary) */
.product-detail .buy-actions .btn.btn-primary.add-to-cart-btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--text-base);
  font-weight: 700;
  min-width: 160px;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.product-detail .buy-actions .btn.btn-primary.add-to-cart-btn-with-icon .add-to-cart-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-detail .buy-actions .btn.btn-primary.add-to-cart-btn-with-icon .add-to-cart-btn-icon svg {
  width: 20px;
  height: 20px;
}
.product-detail .buy-actions .btn.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.product-detail .buy-actions .buy-now-btn {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-base);
  font-weight: 600;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  min-width: 140px;
  min-height: 48px;
}
.product-detail .buy-actions .buy-now-btn:hover {
  background: var(--color-accent-soft);
  color: var(--color-primary);
}

/* Product page: buy-actions mobile handled by product.php inline styles */

/* Price alert trigger (product page only) */
.price-alert-trigger {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) 0;
  background: none;
  border: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-outfit);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: color var(--transition);
}

.price-alert-trigger:hover {
  color: var(--color-primary);
}

/* ========== Card variations ========== */

/* Compact card — smaller, dense grid; qty input still fits grams (1000, 5000, etc.) */
.product-card--compact .product-image { aspect-ratio: 4/3; }
.product-card--compact .product-content { padding: var(--space-md); }
.product-card--compact .product-content h3 { font-size: var(--text-base); }
.product-card--compact .product-qty { margin-bottom: var(--space-sm); }
.product-card--compact .product-qty .qty-btn { width: 32px; height: 32px; font-size: 1rem; }
.product-card--compact .product-qty .qty-input { min-width: 64px; height: 32px; font-size: var(--text-sm); }
.product-card--compact .product-price { font-size: var(--text-base); }
.product-card--compact .add-to-cart-btn { width: 36px; height: 36px; }
.product-card--compact .add-to-cart-btn svg { width: 18px; height: 18px; }
.product-card--compact .buy-now-btn { padding: var(--space-xs) var(--space-sm); font-size: var(--text-xs); }
.product-card--compact .product-unit { margin-bottom: var(--space-sm); font-size: var(--text-xs); }

/* Featured card — highlighted, larger, promo feel */
.product-card--featured {
  border: 2px solid var(--color-accent);
  position: relative;
}
.product-card--featured::before {
  content: 'Vedette';
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-badge);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-outfit);
  border-radius: var(--radius-sm);
  z-index: 2;
}
.product-card--featured .product-image { aspect-ratio: 1; }
.product-card--featured .product-price { font-size: var(--text-xl); }

/* Horizontal card — list view, image left */
.product-card--horizontal {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.product-card--horizontal .product-image-link { flex: 0 0 120px; }
.product-card--horizontal .product-image { aspect-ratio: 1; width: 120px; }
.product-card--horizontal .product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-sm);
}
.product-card--horizontal .product-footer { margin-top: auto; }
.product-card--horizontal .product-qty { margin-bottom: var(--space-sm); }
@media (max-width: 480px) {
  .product-card--horizontal { flex-direction: column; }
  .product-card--horizontal .product-image-link { flex: none; }
  .product-card--horizontal .product-image { width: 100%; aspect-ratio: 16/9; }
}

/* Pack card — vertical layout: image on top, content below */
.pack-card {
  background: linear-gradient(135deg, #1e3a2f 0%, var(--color-primary) 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: white;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  box-shadow: 0 10px 30px rgba(45, 106, 79, 0.16);
  border: 1px solid rgba(255,255,255,0.10);
  text-decoration: none;
}
.pack-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(45, 106, 79, 0.24);
}
.pack-card-image {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}
.pack-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pack-card-content {
  flex: 1;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.pack-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.pack-card-content h3 {
  font-size: var(--text-lg);
  margin: 0;
  line-height: 1.25;
}
.pack-card-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.pack-card-desc {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pack-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.78);
  flex-wrap: wrap;
}
.pack-card-savings {
  font-weight: 700;
  color: #d1fae5;
}
.pack-card-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.pack-card-price {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.pack-card-from {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  text-decoration: line-through;
}

/* Toggle "View contents" button */
.pack-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  align-self: flex-start;
}
.pack-card-toggle:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.pack-card-toggle-icon {
  transition: transform .25s ease;
  flex-shrink: 0;
}
.pack-card-toggle[aria-expanded="true"] .pack-card-toggle-icon {
  transform: rotate(180deg);
}

/* Expandable preview panel */
.pack-card-preview {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease, padding .25s ease;
  opacity: 0;
  background: rgba(0,0,0,0.12);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
}
.pack-card-preview[aria-hidden="false"] {
  max-height: 400px;
  opacity: 1;
  padding: var(--space-md);
}
.pack-card-preview-group {
  margin-bottom: var(--space-sm);
}
.pack-card-preview-group:last-child {
  margin-bottom: 0;
}
.pack-card-preview-cat {
  display: block;
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.pack-card-preview ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pack-card-preview li {
  font-size: var(--text-sm);
  padding: 3px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: rgba(255,255,255,0.92);
}
.pack-card-preview-qty {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  margin-left: var(--space-sm);
}

/* Two-button footer */
.pack-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}
.pack-card-cta {
  white-space: nowrap;
  border-width: 2px;
  padding: var(--space-sm) var(--space-md);
  min-height: 40px;
  font-size: var(--text-sm);
  flex: 1;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.pack-card-add {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
  font-weight: 700;
}
.pack-card-add:hover {
  background: #f0fdf4;
}
.pack-card-buy {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
  font-weight: 600;
}
.pack-card-buy:hover {
  background: rgba(255,255,255,0.14);
}

/* Links inside pack-card should inherit color */
.pack-card .pack-card-topline {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.pack-card .pack-card-image {
  display: block;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 480px) {
  .pack-card-image { height: 160px; }
  .pack-card-content { padding: var(--space-md) var(--space-lg); }
  .pack-card-price { font-size: var(--text-lg); }
  .pack-card-footer { flex-direction: row; }
  .pack-card-cta { padding: var(--space-sm) var(--space-sm); font-size: var(--text-xs); }
}

/* Grid variants */
.products-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}
.products-grid--horizontal {
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.products-grid--packs {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ========== Promo Banner ========== */
.promo-banner {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.promo-banner-text h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-sm);
}

.promo-banner-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-base);
}

.promo-banner .btn-outline {
  border-color: white;
  color: white;
}

.promo-banner .btn-outline:hover {
  background: white;
  color: var(--color-primary);
}

/* ========== Footer (Footer7-style layout) ========== */
.footer {
  background: var(--color-primary-dark);
  color: white;
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

@media (min-width: 1024px) {
  .footer-main {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3xl);
  }
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 360px;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: white;
}

.footer-logo-img {
  height: 32px;
  width: auto;
}

.footer-logo-text {
  font-size: var(--text-xl);
  font-weight: 700;
}

.footer-logo-text span {
  color: var(--color-accent);
}

.footer-brand-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  color: white;
}

.footer-logo-link:hover {
  color: white;
  opacity: 0.95;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin: 0;
}

.footer-contact-mini {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.footer-contact-mini a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-contact-mini a:hover {
  color: white;
}

.footer-social {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.footer-social a:hover {
  color: white;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 767px) {
  .footer-links-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer-links-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: flex-start;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-copyright {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal-links a {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer-legal-links a:hover {
  color: white;
}

/* ========== Mobile Menu Toggle & Overlay ========== */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.menu-toggle:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  z-index: 99;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-overlay-inner {
  padding: var(--space-xl);
  min-height: 100%;
  transform-origin: top center;
  transition: transform 0.25s ease-out;
  width: 100%;
  box-sizing: border-box;
}

.nav-overlay:not(.is-open) .nav-overlay-inner {
  transform: scale(0.98);
}

.nav-overlay.is-open .nav-overlay-inner {
  transform: scale(1);
}

/* Mobile menu: single column so categories and actions stack vertically */
.nav-overlay .nav-mobile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.nav-mobile .nav-links {
  flex-direction: column;
  gap: 0;
  padding: 0;
  width: 100%;
  flex-shrink: 0;
}

.nav-mobile .nav-links li {
  border-bottom: 1px solid var(--color-border);
}

.nav-mobile .nav-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--space-lg);
  font-size: var(--text-lg);
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.nav-mobile .nav-links a:hover {
  background: var(--color-accent-soft);
  color: var(--color-primary);
}

.header-actions--stacked {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  gap: var(--space-md);
  flex-shrink: 0;
}

.header-actions--stacked .btn,
.header-actions--stacked .lang-switch {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

[dir="rtl"] .header-actions--stacked .btn,
[dir="rtl"] .header-actions--stacked .lang-switch {
  justify-content: center;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .nav-overlay {
    display: block;
  }
  .nav-overlay-inner {
    padding: var(--space-lg);
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
  }

  .header-inner .logo {
    min-width: 0;
    overflow: hidden;
  }
  .header-inner .logo-img {
    max-height: 36px;
    max-width: 140px;
    object-fit: contain;
  }
  .header-inner {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .footer-links-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    min-height: 65vh;
  }
  .hero-compact {
    min-height: 55vh;
    max-height: 65vh;
  }
  .promo-banner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  .category-card-overlay { padding: var(--space-md); }
  .category-card span { font-size: var(--text-base); }

  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .product-card { border-radius: var(--radius-md); }
  .product-content { padding: var(--space-md); }
  .product-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .section { padding: var(--space-xl) 0; }
  .section-header h2 { font-size: var(--text-xl); }
}

/* ========== Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.modal-content {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-content h3 {
  margin-bottom: var(--space-xs);
  font-size: var(--text-xl);
}

.modal-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

.price-alert-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.price-alert-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 500;
}

.price-alert-form input[type="number"],
.price-alert-form input[type="email"] {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-outfit);
  font-size: var(--text-base);
}

.modal-note {
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ========== Toast Notifications ========== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: var(--font-outfit);
  font-size: var(--text-sm);
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.toast--success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #059669;
}

.toast--error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #dc2626;
}

.toast--warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.toast--info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #2563eb;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

[dir="rtl"] .toast {
  transform: translateX(-120%);
}

[dir="rtl"] .toast--visible {
  transform: translateX(0);
}

[dir="rtl"] .toast--success,
[dir="rtl"] .toast--error,
[dir="rtl"] .toast--warning,
[dir="rtl"] .toast--info {
  border-left: none;
  border-right: 4px solid;
}

/* ========== Confirmation Modal ========== */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.confirm-modal--open {
  opacity: 1;
  visibility: visible;
}

.confirm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.confirm-modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.confirm-modal-title {
  margin-bottom: var(--space-md);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.confirm-modal-message {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

.confirm-modal-btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font-outfit);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.confirm-modal-cancel {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.confirm-modal-cancel:hover {
  background: var(--color-border);
}

.confirm-modal-ok {
  background: var(--color-primary);
  color: white;
}

.confirm-modal-ok:hover {
  background: var(--color-primary-dark);
}

/* Shared form input/select styling — use .form-input to avoid repeating inline styles */
.form-input,
input.form-input,
select.form-input,
textarea.form-input {
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
  font-family: var(--font-outfit);
  color: var(--color-text, #1a1a1a);
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  box-sizing: border-box;
}
.form-input:focus,
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: var(--color-primary, #2d6a4f);
}

/* Form compact layout — fields side by side on desktop */
.form-row { display: grid; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

/* ========== Reminder popups (cookie, cart) ========== */
.khedar-reminder {
  position: fixed;
  z-index: 10000;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-lg);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.khedar-reminder--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.khedar-reminder--cookie {
  background: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.khedar-reminder--cart {
  bottom: auto;
  top: 50%;
  left: 50%;
  right: auto;
  padding: 0;
  transform: translate(-50%, -50%) scale(0.95);
  max-width: 90vw;
  width: 380px;
}
.khedar-reminder--cart.khedar-reminder--visible {
  transform: translate(-50%, -50%) scale(1);
}
.khedar-reminder--cart .khedar-reminder-inner {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}
.khedar-reminder-inner { max-width: var(--max-width); margin: 0 auto; }
.khedar-reminder-title { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.khedar-reminder-text { margin-bottom: var(--space-lg); opacity: 0.95; font-size: var(--text-sm); }
.khedar-reminder-actions { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; }
.khedar-reminder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-outfit);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background 0.2s, color 0.2s;
}
.khedar-reminder-btn--primary { background: var(--color-primary); color: #fff; }
.khedar-reminder-btn--primary:hover { background: var(--color-primary-dark); color: #fff; }
.khedar-reminder-btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.khedar-reminder-btn--outline:hover { background: rgba(45, 106, 79, 0.08); }
.khedar-reminder-link {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
  font-size: var(--text-sm);
  margin-right: auto;
}
.khedar-reminder-link:hover { color: #fff; }
.khedar-reminder-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-xs);
}
.khedar-reminder-close:hover { color: var(--color-text); }

/* Back to top button */
.khedar-back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.4);
  transition: transform 0.2s, background 0.2s;
}
.khedar-back-to-top:hover { background: var(--color-primary-dark); transform: scale(1.05); }
[dir="rtl"] .khedar-back-to-top { right: auto; left: var(--space-xl); }

/* ========== Mobile-friendly: viewport, touch, overflow ========== */
/* Reduce tap highlight flash on touch devices; use theme color for consistency */
html {
  -webkit-tap-highlight-color: rgba(45, 106, 79, 0.15);
  tap-highlight-color: rgba(45, 106, 79, 0.15);
}
/* Prevent horizontal scroll from wide content (tables, grids) */
body {
  overflow-x: hidden;
}
/* Prevent zoom on input focus (iOS) — keep inputs at least 16px */
input.form-input,
select.form-input,
textarea.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
  font-size: max(1rem, 16px);
}

/* Safe area for notched devices */
.container {
  padding-left: max(var(--space-lg), env(safe-area-inset-left));
  padding-right: max(var(--space-lg), env(safe-area-inset-right));
}

/* Touch targets: minimum 44px for primary controls */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: var(--space-md) var(--space-xl);
  }
  .nav-mobile .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .lang-switch a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
  }
  .header-actions--stacked .btn,
  .header-actions--stacked .lang-switch {
    min-height: 44px;
  }
  .qty-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .add-to-cart-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .modal-close,
  .khedar-reminder-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .confirm-modal-actions .confirm-modal-btn {
    min-height: 44px;
    padding: var(--space-md) var(--space-lg);
  }
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    top: calc(var(--header-height) + var(--space-sm));
    max-width: none;
  }
  .toast {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .khedar-back-to-top {
    bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    right: max(var(--space-xl), env(safe-area-inset-right));
    width: 48px;
    height: 48px;
  }
  [dir="rtl"] .khedar-back-to-top {
    right: auto;
    left: max(var(--space-xl), env(safe-area-inset-left));
  }
  .hero-1-content {
    padding: var(--space-2xl) var(--space-md);
  }
  .hero-1-search-wrap {
    max-width: 100%;
  }
  .hero-1-pills {
    gap: var(--space-xs);
  }
  .hero-1-pill {
    padding: var(--space-sm) var(--space-md);
  }
  .section {
    padding: var(--space-2xl) 0;
  }
  .modal-content,
  .confirm-modal-content {
    margin: var(--space-md);
    max-height: calc(100vh - 2 * var(--space-md));
    overflow-y: auto;
  }
}

/* Horizontal scroll for any data table */
.table-wrap,
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Shared dashboard table responsiveness */
@media (max-width: 768px) {
  .admin-table-wrap,
  .table-wrap {
    margin: 0;
    padding: 0 0 var(--space-sm);
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    position: relative;
    isolation: isolate;
    contain: paint;
  }
  .admin-table,
  .client-dashboard-card table,
  .b2b-dashboard-card table,
  .client-dashboard-inner table,
  .b2b-dashboard-inner table {
    min-width: 680px;
    width: 100%;
    font-size: 0.82rem;
  }
  .admin-table th,
  .admin-table td,
  .client-dashboard-card th,
  .client-dashboard-card td,
  .b2b-dashboard-card th,
  .b2b-dashboard-card td,
  .client-dashboard-inner th,
  .client-dashboard-inner td,
  .b2b-dashboard-inner th,
  .b2b-dashboard-inner td {
    padding: var(--space-sm) var(--space-md);
    vertical-align: top;
  }
  .admin-table th,
  .client-dashboard-card th,
  .b2b-dashboard-card th,
  .client-dashboard-inner th,
  .b2b-dashboard-inner th {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .admin-table th:first-child,
  .admin-table td:first-child,
  .client-dashboard-card th:first-child,
  .client-dashboard-card td:first-child,
  .b2b-dashboard-card th:first-child,
  .b2b-dashboard-card td:first-child,
  .client-dashboard-inner th:first-child,
  .client-dashboard-inner td:first-child,
  .b2b-dashboard-inner th:first-child,
  .b2b-dashboard-inner td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    box-shadow: none;
    min-width: 120px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  [dir="rtl"] .admin-table th:first-child,
  [dir="rtl"] .admin-table td:first-child,
  [dir="rtl"] .client-dashboard-card th:first-child,
  [dir="rtl"] .client-dashboard-card td:first-child,
  [dir="rtl"] .b2b-dashboard-card th:first-child,
  [dir="rtl"] .b2b-dashboard-card td:first-child,
  [dir="rtl"] .client-dashboard-inner th:first-child,
  [dir="rtl"] .client-dashboard-inner td:first-child,
  [dir="rtl"] .b2b-dashboard-inner th:first-child,
  [dir="rtl"] .b2b-dashboard-inner td:first-child {
    left: auto;
    right: 0;
  }
  .admin-table th:first-child,
  .client-dashboard-card th:first-child,
  .b2b-dashboard-card th:first-child,
  .client-dashboard-inner th:first-child,
  .b2b-dashboard-inner th:first-child {
    z-index: 4;
    background: #f8fafc;
    min-width: 120px;
  }
  .admin-table td:first-child,
  .client-dashboard-card td:first-child,
  .b2b-dashboard-card td:first-child,
  .client-dashboard-inner td:first-child,
  .b2b-dashboard-inner td:first-child {
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.25;
  }
  .admin-table td,
  .client-dashboard-card td,
  .b2b-dashboard-card td,
  .client-dashboard-inner td,
  .b2b-dashboard-inner td {
    line-height: 1.35;
  }
  .admin-table input,
  .admin-table select,
  .client-dashboard-card input,
  .client-dashboard-card select,
  .b2b-dashboard-card input,
  .b2b-dashboard-card select,
  .client-dashboard-inner input,
  .client-dashboard-inner select,
  .b2b-dashboard-inner input,
  .b2b-dashboard-inner select {
    font-size: 0.88rem;
    min-height: 40px;
  }
}

/* Very small screens: tighter spacing */
@media (max-width: 360px) {
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .section {
    padding: var(--space-xl) 0;
  }
  .faq-page,
  .legal-page,
  .info-page,
  .confirmation-box {
    padding-left: 0;
    padding-right: 0;
  }
}
