/* ══════════════════════════════════════════════
   Amwaas Furniture Store - Main Styles
   Green / Gold / White Theme
   ══════════════════════════════════════════════ */

:root {
  --black: #1d3628;        /* deep green — headings & dark surfaces */
  --dark: #16281d;         /* darker green — nav / top bar */
  --green: #3f7a4e;        /* primary green accent */
  --green-light: #8fbd9f;
  --gray: #6e8a7c;         /* muted text */
  --gray-light: #c6d6cc;   /* light text on dark green */
  --gray-lighter: #eaf1ec; /* soft light surface */

  /* Base tone: warm ivory — a middle ground between the deep green and pure white */
  --ivory: #f6f3ec;
  --ivory-2: #efeade;
  --surface: #fdfbf7;       /* raised panels sit brighter than the page */
  --white: #f6f3ec;         /* kept as alias so every existing usage shifts to ivory */
  --gold: #e9b514;         /* vivid gold */
  --gold-light: #f2cd62;
  --gold-dark: #bd8f0e;
  --red: #dc2626;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(29,54,40,0.08);
  --shadow-lg: 0 8px 30px rgba(29,54,40,0.12);
  --transition: all 0.3s ease;
  --font: 'Cairo', sans-serif;

  /* Responsive tokens */
  --gutter: 20px;          /* container side padding */
  --gap: 20px;             /* grid gap */
  --section-y: 60px;       /* vertical section padding */
  --tap: 44px;             /* minimum touch target (Apple HIG / WCAG) */
  --header-h: 64px;        /* sticky header offset for anchor jumps */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* منع تكبير النص تلقائياً على iOS داخل الحقول */
input, textarea, select, button { font-size: max(16px, 1em); }

a { text-decoration: none; color: inherit; }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* Tap highlight */
a, button, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }

/* ══════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100px;
  right: 12px;
  z-index: 2000;
  background: var(--gold);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

/* ══════════════════════════════════════════════
   HEADER / NAVBAR
   ══════════════════════════════════════════════ */
.header {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.header-top {
  background: var(--dark);
  padding: 6px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-top a { color: var(--gray-light); transition: var(--transition); }
.header-top a:hover { color: var(--white); }
.header-top-right, .header-top-left { display: flex; gap: 16px; align-items: center; }
.header-top-right i { margin-left: 4px; font-size: 0.75rem; }

.header-main {
  padding: 14px 0;
}
.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}
.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.logo-img {
  height: 64px;
  max-width: 220px;
  object-fit: contain;
}
.logo span { color: var(--gold); }

.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 10px 44px 10px 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.search-bar input::placeholder { color: var(--gray); }
.search-bar input:focus { border-color: var(--gold); background: rgba(255,255,255,0.12); }
.search-bar button {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gold);
  border: none;
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-actions a, .header-actions button {
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  position: relative;
  transition: var(--transition);
}
.header-actions a:hover, .header-actions button:hover { color: var(--gold); }
.header-actions i { font-size: 1.2rem; }
.cart-link { position: relative; }
.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--gold);
  color: var(--white);
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Navigation */
.nav {
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.nav .container {
  display: flex;
  gap: 0;
}
.nav a {
  padding: 12px 20px;
  color: var(--gray-light);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover, .nav a.active {
  color: var(--white);
  border-bottom-color: var(--gold);
  background: rgba(255,255,255,0.05);
}
.nav .admin-link {
  color: var(--gold);
  border-left: 1px solid rgba(255,255,255,0.1);
}

/* Drawer-only pieces */
.nav-head { display: none; }
.nav-backdrop { display: none; }
.nav-cart { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--tap);
  height: var(--tap);
  padding: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ══════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  min-height: 92dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  background-color: #111111;
  transition: transform 0.1s linear;
  will-change: transform;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.7) 40%,
    rgba(0,0,0,0.3) 100%
  );
}
.hero-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C5A572;
  opacity: 0.15;
  animation: heroFloat 12s infinite ease-in-out;
}
.hero-particles span:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; animation-duration: 14s; }
.hero-particles span:nth-child(2) { top: 60%; left: 20%; animation-delay: 2s; width: 4px; height: 4px; }
.hero-particles span:nth-child(3) { top: 30%; right: 15%; animation-delay: 4s; animation-duration: 16s; }
.hero-particles span:nth-child(4) { bottom: 20%; right: 25%; animation-delay: 1s; width: 8px; height: 8px; opacity: 0.08; }
.hero-particles span:nth-child(5) { bottom: 35%; left: 40%; animation-delay: 3s; width: 5px; height: 5px; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.3); }
}
.hero-container {
  position: relative;
  z-index: 2;
}
.hero-content {
  max-width: 650px;
  padding: 80px 0;
  animation: heroFadeIn 1s ease-out;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
  display: inline-block;
  background: rgba(197,165,114,0.15);
  border: 1px solid rgba(197,165,114,0.3);
  color: #C5A572;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}
.hero-title {
  font-size: 3.4rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.hero-line {
  width: 80px;
  height: 4px;
  background: #C5A572;
  border-radius: 2px;
  margin-bottom: 32px;
  animation: heroLineGrow 1s ease-out 0.3s both;
}
@keyframes heroLineGrow {
  from { width: 0; }
  to { width: 80px; }
}
.btn-hero {
  padding: 16px 40px;
  font-size: 1.05rem;
  box-shadow: 0 8px 32px rgba(197,165,114,0.3);
}
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: heroFadeIn 1s ease-out 0.6s both;
}
.hero-scroll span {
  color: var(--gray-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, #C5A572, transparent);
  animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}
@media (max-width: 768px) {
  .hero { min-height: 75vh; }
  .hero-title { font-size: 2.2rem; }
  .hero-content { padding: 40px 0; }
  .btn-hero { padding: 14px 32px; font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .hero { min-height: 65vh; }
  .hero-title { font-size: 1.8rem; }
}
/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,175,55,0.35); }
.btn-white { background: var(--surface); color: var(--black); }
.btn-white:hover { background: var(--ivory-2); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid var(--gray-light); color: var(--black); }
.btn-outline:hover { border-color: var(--black); background: var(--black); color: var(--white); }
.btn-black { background: var(--black); color: var(--white); }
.btn-black:hover { background: var(--dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.btn-sm { padding: 10px 20px; font-size: 0.82rem; }
.btn-xs { padding: 6px 14px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:active { transform: translateY(0) scale(0.98); }

/* ══════════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════════ */
.section { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--black);
}
.section-title p {
  color: var(--gray);
  margin-top: 8px;
}
.section-title .line {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ══════════════════════════════════════════════
   CATEGORIES
   ══════════════════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-lighter);
  aspect-ratio: 4/3;
  display: flex;
  align-items: flex-end;
  transition: var(--transition);
  cursor: pointer;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-card-bg i {
  font-size: 3rem;
  color: rgba(255,255,255,0.1);
}
.category-card-info {
  position: relative;
  z-index: 2;
  padding: 20px;
  width: 100%;
  background: linear-gradient(transparent, rgba(22,40,29,0.85));
}
.category-card-info h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.category-card-info span {
  color: var(--gold);
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════════
   PRODUCTS
   ══════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-lighter);
  transition: var(--transition);
  position: relative;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-lighter);
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--black);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.product-badge.sale { background: var(--red); }
.product-actions {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(transparent, rgba(22,40,29,0.7));
  transition: var(--transition);
}
.product-card:hover .product-actions { bottom: 0; }
.product-actions button, .product-actions a {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: var(--surface);
  color: var(--black);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.product-actions button:hover, .product-actions a:hover {
  background: var(--gold);
  color: var(--white);
  transform: scale(1.1);
}

/* الأجهزة اللمسية: لا يوجد hover — أظهر الأزرار دائماً */
@media (hover: none), (pointer: coarse) {
  .product-actions {
    bottom: 0;
    background: linear-gradient(transparent, rgba(22,40,29,0.55));
  }
  .product-card:hover { transform: none; }
  .category-card:hover, .subcat-card:hover, .feature-card:hover { transform: none; }
  .btn:hover, .product-actions button:hover, .product-actions a:hover { transform: none; }
}
.product-info {
  padding: 16px;
}
.product-category {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 4px;
}
.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-prices {
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-dark);
}
.product-old-price {
  font-size: 0.85rem;
  color: var(--gray);
  text-decoration: line-through;
}
.product-discount {
  background: #fef2f2;
  color: var(--red);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════
   OFFERS BANNER
   ══════════════════════════════════════════════ */
.offers-section { background: var(--black); color: var(--white); }
.offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.offer-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  padding: 32px;
  background-size: cover;
  background-position: center;
}
.offer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(22,40,29,0.92) 0%, rgba(29,54,40,0.55) 100%);
}
.offer-card-content {
  position: relative;
  z-index: 2;
}
.offer-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.offer-card p {
  color: var(--gray-light);
  margin-bottom: 16px;
}
.offer-discount {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════
   FEATURES
   ══════════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.feature-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-lighter);
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--gold); }
.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gray-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.3rem;
  color: var(--black);
  transition: var(--transition);
}
.feature-card:hover .feature-icon { background: var(--black); color: var(--white); }
.feature-card h4 { margin-bottom: 8px; font-weight: 700; }
.feature-card p { font-size: 0.85rem; color: var(--gray); }

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.footer {
  background: var(--black);
  color: var(--gray-light);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 16px;
}
.footer-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-logo span { color: var(--gold); }
.footer p { font-size: 0.9rem; line-height: 1.8; }
.footer ul li {
  margin-bottom: 8px;
}
.footer ul a {
  font-size: 0.9rem;
  transition: var(--transition);
}
.footer ul a:hover { color: var(--gold); padding-right: 4px; }
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--gold); color: var(--white); }
.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
}

/* ══════════════════════════════════════════════
   PRODUCT DETAIL
   ══════════════════════════════════════════════ */
.product-detail { padding: 40px 0; }
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.product-gallery { position: relative; }
.product-main-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-lighter);
}
.product-main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.product-thumb {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.product-thumb.active, .product-thumb:hover { border-color: var(--gold); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.product-detail-category {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.product-detail-prices {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.product-detail-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--black);
}
.product-detail-old {
  font-size: 1.1rem;
  color: var(--gray);
  text-decoration: line-through;
}
.product-detail-desc {
  color: var(--gray);
  margin-bottom: 24px;
  line-height: 1.8;
}
.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--gray-lighter);
  border-radius: var(--radius);
}
.product-meta div { font-size: 0.9rem; }
.product-meta strong { color: var(--black); }
.qty-selector {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid var(--gray-light);
}
.qty-selector button {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--gray-lighter);
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: 800;
  transition: var(--transition);
  color: var(--black);
}
.qty-selector button:hover { background: var(--black); color: var(--white); }
.qty-selector input {
  width: 56px;
  height: 44px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--gray-light);
  border-right: 1px solid var(--gray-light);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
}
.product-detail-btns {
  display: flex;
  gap: 12px;
}

/* ══════════════════════════════════════════════
   CART
   ══════════════════════════════════════════════ */
.cart-page { padding: 40px 0; min-height: 60vh; }
.cart-page h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; }
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}
.cart-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--gray);
}
.cart-empty i { font-size: 4rem; margin-bottom: 16px; color: var(--gray-light); }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th {
  background: var(--gray-lighter);
  padding: 12px 16px;
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
}
.cart-table td { padding: 16px; border-bottom: 1px solid var(--gray-lighter); vertical-align: middle; }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--gray-lighter); flex: 0 0 auto; }
.cart-product-ph {
  width: 60px;
  height: 60px;
  background: var(--gray-lighter);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--gray);
}
.cart-product-name { font-weight: 600; font-size: 0.9rem; }
.cart-remove {
  color: var(--red);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 4px;
  width: var(--tap);
  height: var(--tap);
}
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  margin-left: auto;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.cart-summary-total {
  border-top: 2px solid var(--black);
  padding-top: 12px;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ══════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════ */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-lighter);
  padding: 40px 20px;
}
.auth-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-box h1 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.auth-box .subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--green);
}
.form-error {
  background: #fef2f2;
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

/* ══════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════ */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-info-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--gray-lighter);
  text-align: center;
}
.contact-info-card i { font-size: 1.5rem; color: var(--gold); margin-bottom: 12px; }
.contact-info-card h4 { margin-bottom: 4px; }
.contact-info-card p { color: var(--gray); font-size: 0.9rem; }

/* ══════════════════════════════════════════════
   SUBCATEGORY SLIDER
   ══════════════════════════════════════════════ */
.subcat-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.subcat-slider {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 4px;
  flex: 1;
}
.subcat-slider::-webkit-scrollbar { display: none; }
.subcat-card {
  flex: 0 0 180px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(31,73,51,0.06);
  transition: var(--transition);
  text-decoration: none;
  color: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--gray-lighter);
}
.subcat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(31,73,51,0.14);
  border-color: var(--gold);
}
.subcat-card-img {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--gray-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
}
.subcat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.subcat-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.subcat-card-name {
  padding: 14px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.subcat-arrow {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gray-light);
  background: var(--surface);
  color: var(--black);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}
.subcat-arrow:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
@media (max-width: 768px) {
  .subcat-card { flex: 0 0 150px; }
  .subcat-card-img { height: 110px; }
  .subcat-arrow { width: 36px; height: 36px; font-size: 0.85rem; }
}

/* ══════════════════════════════════════════════
   CATEGORY HERO SECTIONS
   ══════════════════════════════════════════════ */
.category-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.category-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(22,40,29,0.86) 0%, rgba(29,54,40,0.6) 100%);
  z-index: 1;
}
.category-hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 600px;
}
.category-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 16px;
}
.category-hero-content h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--gold);
}
.category-hero-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.category-hero-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 30px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}
.category-hero-sub:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.category-hero-sub small {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-right: 4px;
}
.cat-hero-rtl .category-hero-content {
  margin-right: auto;
  margin-left: 0;
  text-align: right;
}
@media (max-width: 768px) {
  .category-hero { min-height: 300px; }
  .category-hero-content h2 { font-size: 1.5rem; }
  .category-hero-sub { padding: 8px 14px; font-size: 0.8rem; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   Overrides from largest → smallest.
   Breakpoints:
     1600px  xlarge desktop
     1280px  large desktop
     1024px  small desktop / large tablet
      900px  nav switches to drawer
      768px  tablet
      600px  large phone
      480px  phone
      360px  small phone
      landscape phone (max-height: 500px)
   ══════════════════════════════════════════════════════════════ */

/* ── ≥1600px: شاشة كبيرة ── */
@media (min-width: 1600px) {
  body { font-size: 17px; }
  .container { max-width: 1440px; }
  .products-grid { gap: 24px; }
  .categories-grid { gap: 24px; }
}

/* ── ≥1280px ── */
@media (min-width: 1280px) {
  .container { max-width: 1320px; }
}

/* ── ≤1024px ── */
@media (max-width: 1024px) {
  :root {
    --gap: 16px;
    --section-y: 48px;
  }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .product-detail-grid { gap: 28px; }
  .section-title { margin-bottom: 28px; }
  .section-title h2 { font-size: 1.6rem; }
  .offer-card { padding: 28px; min-height: 200px; }
  .contact-grid { gap: 28px; }
}

/* ══════════════════════════════════════════════════════════════
   ≤900px — القائمة تتحوّل إلى Drawer
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    z-index: 1200;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
    box-shadow: -8px 0 30px rgba(0,0,0,0.35);
    border-top: 0;
  }
  .nav.open { transform: translateX(0); visibility: visible; }

  .nav .container {
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 100%;
  }
  .nav a {
    padding: 0 20px;
    min-height: var(--tap);
    display: flex;
    align-items: center;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-inline-end: 3px solid transparent;
  }
  .nav a:hover, .nav a.active { border-bottom-color: transparent; }
  .nav a.active { border-inline-end-color: var(--gold); }
  .nav .nav-cart {
    display: flex;
    gap: 10px;
    margin-top: auto;
    background: var(--black);
    color: var(--gold);
    font-weight: 700;
  }

  .nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--black);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 10px 12px 10px 20px;
  }
  .nav-head-title {
    color: var(--gold);
    font-weight: 800;
    font-size: 1.05rem;
  }
  .nav-close {
    width: var(--tap);
    height: var(--tap);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius);
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1100;
    animation: navFade 0.25s ease;
  }
  .nav-backdrop[hidden] { display: none; }
  @keyframes navFade { from { opacity: 0; } to { opacity: 1; } }

  body.nav-open { overflow: hidden; }

  /* زر الهامبرغر يتحوّل لعلامة X */
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ══════════════════════════════════════════════════════════════
   ≤768px — تابلت
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --gap: 14px;
    --section-y: 40px;
    --tap: 46px;
    --header-h: 58px;
  }

  .header-top { display: none; }
  .header-main { padding: 10px 0; }
  .header-main .container {
    flex-wrap: wrap;
    gap: 12px;
    row-gap: 10px;
  }

  .logo { order: 1; font-size: 1.25rem; gap: 9px; }
  .logo-icon { width: 36px; height: 36px; font-size: 1rem; }
  .logo-img { height: 42px; max-width: 150px; }

  .header-actions { order: 2; margin-inline-start: auto; gap: 14px; }
  .header-actions a, .header-actions button { min-width: 44px; min-height: var(--tap); }
  .header-actions span { font-size: 0.68rem; }
  .header-actions i { font-size: 1.15rem; }

  /* البحث ينزل لسطر خاص به بدل أن يختفي */
  .search-bar {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    margin: 0;
  }
  .search-bar input { padding: 11px 44px 11px 16px; }

  .section { padding: var(--section-y) 0; }
  .section-title { margin-bottom: 24px; }
  .section-title h2 { font-size: 1.4rem; }
  .section-title p { font-size: 0.9rem; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .offers-grid { grid-template-columns: 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .contact-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 28px; }
  .footer { padding-top: 40px; }

  .feature-card { padding: 22px 14px; }
  .feature-icon { width: 50px; height: 50px; font-size: 1.1rem; margin-bottom: 12px; }
  .feature-card p { font-size: 0.8rem; }

  .offer-card { min-height: 180px; padding: 24px; }
  .offer-card h3 { font-size: 1.2rem; }

  .category-hero { min-height: 240px; }
  .category-hero-content h2 { font-size: 1.4rem; }
  .category-hero-icon { width: 52px; height: 52px; font-size: 1.25rem; }
  .category-hero-sub { padding: 8px 14px; font-size: 0.8rem; }

  .subcat-card { flex: 0 0 140px; }
  .subcat-card-img { height: 100px; }
  .subcat-arrow { width: 36px; height: 36px; font-size: 0.85rem; }

  .product-detail { padding: 24px 0; }
  .product-detail-info h1 { font-size: 1.35rem; }
  .product-detail-price { font-size: 1.5rem; }
  .product-meta { grid-template-columns: 1fr; gap: 8px; padding: 14px; }

  /* السلة: جدول → كروت */
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 8px 4px;
  }
  .cart-table td { border: none; padding: 8px 12px; }
  .cart-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 2px;
  }
  .cart-table td:empty { display: none; }
  .cart-product img { width: 52px; height: 52px; }
  .cart-product-ph { width: 52px; height: 52px; }
  .cart-summary { max-width: none; padding: 20px; }
  .cart-page { padding: 24px 0; }
  .cart-page h1 { font-size: 1.35rem; margin-bottom: 18px; }
  .cart-empty { padding: 40px 0; }

  .cart-layout { grid-template-columns: 1fr; gap: 20px; }
  .contact-cards { grid-template-columns: 1fr; gap: 12px; margin-bottom: 28px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .contact-info-card { padding: 18px; }

  .auth-page { padding: 24px var(--gutter); min-height: auto; }
  .auth-box { padding: 28px 22px; }
  .auth-box h1 { font-size: 1.25rem; }
  .checkout-box { padding: 20px 16px !important; }

  .btn { padding: 13px 26px; font-size: 0.95rem; }
  .btn-sm { padding: 11px 20px; }
  .btn-xs { padding: 9px 16px; }
  .product-detail-btns { flex-direction: column; }
  .product-detail-btns .btn { width: 100%; }

  .form-group input, .form-group textarea, .form-group select { padding: 12px 14px; }
}

/* ══════════════════════════════════════════════════════════════
   ≤600px — موبايل كبير
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  :root {
    --gutter: 14px;
    --gap: 12px;
    --section-y: 34px;
  }

  .hero { min-height: 70vh; }
  .hero-content { padding: 44px 0; }
  .hero-title { font-size: 2rem; }
  .hero-badge { padding: 7px 18px; font-size: 0.78rem; margin-bottom: 18px; }
  .hero-line { margin-bottom: 24px; }
  .btn-hero { padding: 15px 32px; font-size: 1rem; }
  .hero-scroll { display: none; }

  .section-title h2 { font-size: 1.28rem; }
  .section-title p { font-size: 0.85rem; }

  .features-grid { grid-template-columns: 1fr; }

  .qty-selector button { width: var(--tap); height: var(--tap); }
  .qty-selector input { height: var(--tap); width: 52px; }

  .footer-social a { width: var(--tap); height: var(--tap); }
  .footer-bottom { padding: 16px 0; font-size: 0.78rem; }
}

/* ══════════════════════════════════════════════════════════════
   ≤480px — موبايل
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  :root {
    --gutter: 12px;
    --gap: 10px;
    --section-y: 28px;
  }

  .products-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .category-card { aspect-ratio: 16/10; }

  .hero { min-height: 62vh; }
  .hero-title { font-size: 1.7rem; }

  .logo { font-size: 1.1rem; }
  .logo-icon { width: 32px; height: 32px; font-size: 0.9rem; }
  .header-actions { gap: 10px; }
  /* على الشاشات الضيقة نخفي النصوص ونبقي الأيقونات فقط */
  .header-actions a > span:not(.cart-count) { display: none; }
  .header-actions i { font-size: 1.25rem; }

  .product-detail-info h1 { font-size: 1.2rem; }
  .product-detail-price { font-size: 1.35rem; }
  .product-thumbs { gap: 6px; }
  .product-thumb { width: 58px; height: 58px; }

  .auth-box { padding: 24px 18px; }
  .cart-empty i { font-size: 3rem; }
}

/* ══════════════════════════════════════════════════════════════
   ≤360px — موبايل صغير
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  :root {
    --gutter: 10px;
    --tap: 44px;
  }
  .hero-title { font-size: 1.45rem; }
  .section-title h2 { font-size: 1.15rem; }
  .btn { padding: 12px 20px; font-size: 0.88rem; }
  .btn-hero { padding: 14px 26px; font-size: 0.92rem; }
  .offer-card { padding: 20px; }
  .offer-discount { font-size: 1.05rem; padding: 5px 13px; }
}

/* ══════════════════════════════════════════════════════════════
   موبايل أفقي — ارتفاعات صغيرة
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vh; }
  .hero-content { padding: 32px 0; }
  .hero-title { font-size: 1.7rem; }
  .hero-scroll { display: none; }
  .auth-page { min-height: auto; padding: 20px var(--gutter); }
  .category-hero { min-height: 180px; }
}

/* ══════════════════════════════════════════════════════════════
   TAP TARGETS — كل عنصر تفاعلي ≥ 44px على أجهزة اللمس
   ══════════════════════════════════════════════════════════════ */
@media (hover: none), (pointer: coarse) {
  .btn,
  .btn-sm,
  .btn-xs,
  .btn-hero {
    min-height: var(--tap);
  }

  .logo { min-height: var(--tap); }
  .logo-icon { width: var(--tap); height: var(--tap); }

  .header-actions a,
  .header-actions button,
  .nav-toggle,
  .nav-close {
    min-width: var(--tap);
    min-height: var(--tap);
  }

  .search-bar button {
    width: var(--tap);
    height: var(--tap);
  }

  .product-name {
    padding: 9px 0;
    min-height: var(--tap);
    display: flex;
    align-items: center;
  }

  .product-actions button,
  .product-actions a,
  .subcat-arrow,
  .cart-remove,
  .qty-selector button,
  .qty-selector input,
  .footer-social a {
    width: var(--tap);
    height: var(--tap);
  }

  .footer ul a,
  .auth-box a,
  .cart-page a,
  .product-detail-info a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}
