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

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Cairo:wght@400;600;700&display=swap');

html[lang="ar"] {
  font-family: 'Cairo', sans-serif;
}

html[lang="en"] {
  font-family: 'Inter', sans-serif;
}

/* CSS Variables & Theming */
:root {
  /* Light Theme */
  --bg-color: #ffffff;
  --bg-secondary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent-color: #3b82f6; /* Tech Blue */
  --accent-hover: #2563eb;
  --border-color: #e5e7eb;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --header-bg: rgba(255, 255, 255, 0.8);
  --backdrop-blur: blur(12px);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  --bg-color: #0f1115;
  --bg-secondary: #161b22;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --border-color: #374151;
  --card-bg: #1f2937;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(15, 17, 21, 0.8);
}

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

html {
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  border-color: #ffffff !important;
  z-index: 2;
}

.light-mode .color-swatch.active {
  border-color: #000000 !important;
}

.dark-mode .color-swatch {
  border-color: #4b5563;
}

.light-mode .color-swatch {
  border-color: #d1d5db;
}

.color-swatch.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  overflow: hidden;
}

.color-swatch.out-of-stock::before,
.color-swatch.out-of-stock::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 142%; /* Diagonal of a square is ~1.414 times the side */
  height: 2px;
  background-color: white;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  z-index: 5;
}

.color-swatch.out-of-stock::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.color-swatch.out-of-stock::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* For white swatches, use dark bars for contrast */
.white-swatch.out-of-stock::before,
.white-swatch.out-of-stock::after {
  background-color: #374151;
  box-shadow: none;
}

/* Specific contrast helpers */
.color-swatch.white-swatch {
  border-color: #9ca3af !important;
}
.light-mode .color-swatch.white-swatch {
  border-color: #6b7280 !important;
}

.color-swatch.black-swatch {
  border-color: #6b7280 !important;
}
.dark-mode .color-swatch.black-swatch {
  border-color: #9ca3af !important;
}

.color-swatch.swatch-sm {
  width: 18px;
  height: 18px;
  border-width: 1px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Force LTR for specific classes */
.en-text, .price, .phone-number, .ltr-text {
  direction: ltr !important;
  display: inline-block;
  unicode-bidi: isolate;
}

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

ul {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Layout & Grid */
.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* Button Normalization */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Header & Navbar */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--header-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.header-hidden {
  transform: translateY(-100%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0;
  direction: ltr;
  unicode-bidi: isolate;
}

.logo-img {
  height: 40px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
  margin-right: 0.5rem;
}

.nav-brand span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: var(--bg-secondary);
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--accent-color);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transform: translate(25%, -25%);
}

[dir='rtl'] .badge {
  right: auto;
  left: 0;
  transform: translate(-25%, -25%);
}

.mobile-menu-btn {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: #1f2937;
  color: #ffffff;
  border: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.quantity-btn:hover {
  background-color: #3b82f6;
  color: #ffffff;
}

.light-mode .quantity-btn {
  background-color: #e5e7eb;
  color: #111827;
  border: 1px solid #d1d5db;
}

.light-mode .quantity-btn:hover {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

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

/* Inputs */
.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

select.input-field option {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

/* Hero Section */
.hero {
  padding: 2rem 0;
  display: flex;
  align-items: center;
  min-height: 75vh;
  background: radial-gradient(circle at 50% 50%, var(--bg-secondary) 0%, var(--bg-color) 100%);
  position: relative;
  overflow: hidden;
}

.hero-content {
  flex: 1;
  max-width: 700px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions .btn-primary {
  padding: 1.15rem 2.75rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.hero-actions .btn-outline {
  padding: 1rem 2.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-search {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 450px;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.hero-search input {
  flex: 1;
  border: none;
  background: none;
  padding: 0.5rem;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
}

.hero-search button {
  color: var(--text-secondary);
  font-size: 1.25rem;
  padding: 0.5rem;
}

.hero-search button:hover {
  color: var(--accent-color);
}

.hero-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

[data-theme='dark'] .hero-glow {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, rgba(96, 165, 250, 0) 70%);
}

@keyframes pulseGlow {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.hero-visual {
  position: relative;
  height: 450px;
  display: none; /* Hidden by default to prevent layout shift, JS will show it */
  justify-content: center;
  align-items: center;
  flex: 1;
}

.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: absolute;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
}

.hero-card img {
  width: 100%;
  height: 280px;
  object-fit: cover; /* Some spools look better contained, but cover works if the aspect ratio is close */
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 1.5rem;
  background: white; /* Give a white bg to the spool image if it's transparent */
}

.hero-card-info {
  padding: 0 0.5rem;
}

.primary-card {
  width: 420px;
  z-index: 3;
  animation: floatPrimary 6s ease-in-out infinite;
}

.primary-card:hover {
  animation-play-state: paused;
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 35px 60px -15px rgba(59, 130, 246, 0.3);
}

@keyframes floatPrimary {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.product-card {
  width: 100%;
  background-color: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--accent-color);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.product-badge.coming-soon {
  background: #f59e0b; /* Orange */
}

.product-badge.stock-out {
  background: #ef4444; /* Red */
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--accent-color);
}

.color-swatch.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.color-swatch.out-of-stock::after {
  content: '\f00d';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
  color: #ef4444;
  position: absolute;
  text-shadow: 0 0 2px white;
}

.color-swatch.swatch-sm {
  width: 18px;
  height: 18px;
}

.color-swatch.swatch-sm.out-of-stock::after {
  font-size: 8px;
}

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


.product-image {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background-color: #f8fafc;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

[data-theme='dark'] .product-image {
  background-color: #111827;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

[data-theme='dark'] .product-image img {
  mix-blend-mode: normal;
}

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

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

.product-category {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.product-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.product-specs span strong {
  color: var(--text-primary);
  font-weight: 500;
}

.product-price-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  margin-top: auto;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-color);
}

.product-price.discounted {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: line-through;
  opacity: 0.7;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  margin-top: auto;
  align-items: center;
}

/* Full width button when qty/quick-add hidden */
.product-actions.full-btn {
  grid-template-columns: 1fr;
}

.btn-quick-add {
  flex: 0 0 50px;
  height: 45px;
  background: var(--bg-secondary);
  color: var(--accent-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}

.btn-quick-add:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

[data-theme='dark'] .btn-quick-add {
  background: #374151;
  border-color: #4b5563;
  color: #60a5fa;
}

[data-theme='dark'] .btn-quick-add:hover {
  background: var(--accent-color);
  color: white;
}

.card-qty-selector {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  height: 45px;
}

.card-qty-selector button {
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  border: none;
  background: transparent;
  cursor: pointer;
}

.card-qty-selector button:hover {
  background: var(--border-color);
  color: var(--accent-color);
}

.card-qty-selector input {
  flex: 1;
  min-width: 30px;
  height: 100%;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  padding: 0;
}

[data-theme='dark'] .card-qty-selector {
  background: #1f2937;
  border-color: #374151;
}

[data-theme='dark'] .card-qty-selector button:hover {
  background: #374151;
}

/* Categories Section */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
}

.category-card {
  height: 120px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-card span {
  position: relative;
  z-index: 1;
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  padding: 5rem 0 2rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

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

.footer-brand {
  margin-bottom: 1rem;
}

.footer-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.footer-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

[dir='rtl'] .footer-links a:hover {
  transform: translateX(-5px);
}

.contact-item {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-label {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.contact-actions {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.contact-action {
  color: var(--accent-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.contact-action:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.whatsapp-action {
  color: #25d366;
}

.whatsapp-action:hover {
  color: #128c7e;
}

.instagram-action {
  color: #e4405f;
  font-weight: 600;
}

.instagram-action:hover {
  color: #c13584;
}

.instagram-action i {
  font-size: 1.25rem;
  background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Social Icons Row */
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.social-icon:hover {
  transform: translateY(-3px);
  color: white;
  border-color: transparent;
}

.social-icon.instagram:hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.social-icon.whatsapp:hover {
  background: #25d366;
}

.footer-bottom {
  text-align: center;
  color: var(--text-secondary);
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

[dir='rtl'] #toast-container {
  right: auto;
  left: 2rem;
}

.toast {
  background-color: var(--card-bg);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--accent-color);
  transform: translateX(120%);
  animation: slideIn 0.3s forwards, fadeOut 0.3s forwards 3s;
}

.toast.success { border-color: var(--success-color); }
.toast.error { border-color: var(--danger-color); }

[dir='rtl'] .toast {
  border-left: none;
  border-right: 4px solid var(--accent-color);
  transform: translateX(-120%);
}

[dir='rtl'] .toast.success { border-color: var(--success-color); }
[dir='rtl'] .toast.error { border-color: var(--danger-color); }

@keyframes slideIn {
  to { transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(20px); }
}

/* Page Headers */
.page-header {
  background-color: var(--bg-secondary);
  padding: 4rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  html, body {
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
  }

  .nav {
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
  }

  .nav-brand {
    font-size: 1.2rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .nav-brand img {
    height: 30px;
  }

  .user-dropdown {
    position: fixed !important;
    top: 4.5rem !important;
    right: 1rem !important;
    left: 1rem !important;
    width: auto !important;
    z-index: 9999 !important;
    margin-top: 0 !important;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .lang-toggle {
    display: flex;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .nav-links {
    display: none;
  }
  
  .nav-actions {
    gap: 0.25rem;
  }

  .icon-btn {
    padding: 0.35rem;
    font-size: 1.15rem;
  }

  .nav-brand {
    font-size: 1.2rem;
    gap: 0.35rem;
  }

  .logo-img {
    height: 32px;
  }
  
  .mobile-menu-btn {
    display: block;
    margin-left: 0.25rem;
  }
  
  .section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
    align-items: center;
  }

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

  .section-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .hero {
    flex-direction: column;
    padding: 3rem 0;
    text-align: center;
    min-height: auto;
    gap: 2rem;
  }
  
  .hero-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }
  
  .hero-actions {
    justify-content: center;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    flex: 1;
    max-width: 160px;
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .secondary-card {
    display: none;
  }
  
  .primary-card {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    animation: none;
    transform: none;
  }

  .hero-visual {
    height: auto;
    padding: 1rem 0;
    width: 100%;
  }

  .hero-card img {
    height: 200px;
    margin-bottom: 1rem;
  }

  .hero-card-info h3 {
    font-size: 1.25rem;
  }
  
  .product-grid, 
  .products-grid, 
  .featured-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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

  .product-image {
    /* Inherit square aspect ratio from main style to prevent shift */
  }

  .product-image img {
    padding: 8px;
  }

  .product-info {
    padding: 8px 10px;
  }

  .product-name {
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 2px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-category {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .desktop-only {
    display: none;
  }

  .product-price {
    font-size: 15px;
    margin-top: auto;
  }

  /* Improved Product Card Actions for Mobile */
  .product-actions {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }

  .card-qty-selector {
    height: 40px;
    grid-column: span 1;
    min-width: 100px;
  }

  .card-qty-selector button {
    width: 35px;
  }

  .btn-quick-add {
    height: 40px;
    flex: 0 0 45px;
    width: 45px;
    grid-column: span 1;
  }

  .product-actions .btn-primary {
    grid-column: span 2;
    min-height: 40px !important;
    width: 100%;
    margin-top: 0.25rem;
  }

  .product-actions.full-btn .btn-primary {
    grid-column: span 2;
  }

  .product-card .btn {
    padding: 0.5rem;
    font-size: 12px;
    border-radius: 8px;
    margin-top: 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-card {
    padding: 1.5rem 1rem;
    font-size: 1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-section {
    text-align: center;
  }

  .contact-actions {
    justify-content: center;
  }

  .page-header {
    padding: 1.5rem 0;
  }

  .page-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .search-input {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
  }

}

.page-header {
  padding: 4rem 0 2rem;
  background-color: var(--bg-color);
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Products Page Sidebar & Filters */
.products-layout {
  display: block;
  padding: 2rem 0;
  position: relative;
}

.mobile-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition);
}

.mobile-filter-toggle:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.filter-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: var(--transition);
}

.filter-label:hover {
  color: var(--accent-color);
}

.filter-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Sidebar as Drawer on all screens */
.sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--card-bg);
  z-index: 1000;
  padding: 2rem;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

[dir='ltr'] .sidebar {
  right: auto;
  left: -320px;
}

.sidebar.active {
  right: 0;
}

[dir='ltr'] .sidebar.active {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.products-content {
  width: 100%;
}

.products-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  background: var(--card-bg);
  padding: 1.5rem 2rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.results-info {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.search-bar {
  width: 100%;
}

.search-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 45px;
  transition: var(--transition);
}

.search-container:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-container input {
  background: transparent;
  border: none;
  width: 100%;
  color: var(--text-primary);
  outline: none;
  font-weight: 500;
}

/* Custom Checkbox */
.filter-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.filter-label input[type="checkbox"]:checked {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.filter-label input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: white;
  font-size: 0.7rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1.5rem;
  background: var(--card-bg);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.results-info {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-bar {
  flex: 1;
  margin-bottom: 0 !important;
}

.search-container {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.search-container:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.search-container i {
  position: absolute;
  left: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3.25rem !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 1rem;
  outline: none;
}


@media (max-width: 992px) {
  .products-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-radius: 24px 24px 0 0;
    padding: 2rem 1.5rem 3rem;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    max-height: 80vh;
    overflow-y: auto;
    border: none;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.2);
  }

  .sidebar.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
.product-wishlist.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.product-wishlist.active i {
  color: white;
}

/* User Dropdown */
.user-menu-container {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 0.5rem;
  margin-top: 0.75rem;
  z-index: 2000;
  display: none;
  animation: slideIn 0.3s ease;
}

.user-dropdown.active {
  display: block;
}

.dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.dropdown-header strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.dropdown-header span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: calc(var(--radius) / 2);
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--accent-color);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

.logout-btn {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 calc(var(--radius) / 2) calc(var(--radius) / 2);
  color: var(--danger-color);
}

.logout-btn:hover {
  background: #fff1f2;
  color: var(--danger-color);
}

[data-theme='dark'] .logout-btn:hover {
  background: #450a0a;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Admin Gallery Reordering */
.gallery-item-admin {
  transition: var(--transition);
}

.gallery-item-admin:hover .gallery-item-actions {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
}

.gallery-item-actions button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
}

.gallery-item-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-item-actions button:hover:not(:disabled) {
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .hero-content {
    text-align: center;
    margin: 0 auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-search {
    margin-left: auto;
    margin-right: auto;
  }
}
