/* ============================================
   Luxury Fashion E-commerce - Design System 2026
   ============================================ */

/* خطوط ليِل: Playfair Display للعناوين، Poppins للنص (مصدر: fonts.bunny.net مثل Leilfashion) */
@import url('https://fonts.bunny.net/css?family=playfair-display:400,500,600,700|poppins:300,400,500,600&display=swap');

:root {
  /* Light theme - Luxury feminine */
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-accent: #ff4fa3;
  --rose-gold: #b76e79;
  --soft-pink: #ff4fa3;
  --light-beige: #f5f0e8;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 40px rgba(255, 79, 163, 0.15);
  --gradient-hero: linear-gradient(135deg, rgba(255,79,163,0.08) 0%, rgba(183,110,121,0.06) 50%, transparent 100%);
  --gradient-btn: linear-gradient(135deg, #ff4fa3 0%, #b76e79 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(26, 26, 26, 0.9);
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-accent: #ff6bb5;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(255, 79, 163, 0.2);
  --glass-bg: rgba(26, 26, 26, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}
/* شريط تمرير أنيق */
@media (min-width: 768px) {
  html { scrollbar-width: thin; scrollbar-color: rgba(255, 79, 163, 0.4) var(--bg-secondary); }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg-secondary); }
  ::-webkit-scrollbar-thumb { background: rgba(255, 79, 163, 0.4); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 79, 163, 0.6); }
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography — مثل Leilfashion */
.font-display,
.font-heading {
  font-family: 'Playfair Display', serif;
}

h1, h2, h3, .heading-luxury {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Selection */
::selection {
  background: var(--soft-pink);
  color: white;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--soft-pink);
  outline-offset: 2px;
}

/* Trust Bar - ثابت الارتفاع لتفادي التداخل مع الهيدر */
.trust-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  height: 44px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.trust-bar > div {
  flex: 1;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.trust-bar > div::-webkit-scrollbar { display: none; }

/* Navigation - يبدأ تحت Trust Bar مباشرة */
.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

body.has-trust-bar .nav-wrap {
  top: 44px;
}
.nav-wrap a.font-display:first-child {
  letter-spacing: 0.15em;
}

/* المحتوى يبدأ تحت Trust Bar + الهيدر (44px + 64px / 80px) */
body.has-trust-bar main {
  padding-top: 108px;
}
@media (min-width: 768px) {
  body.has-trust-bar main {
    padding-top: 124px;
  }
}

.nav-link {
  position: relative;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.nav-link:hover { opacity: 0.85; color: var(--soft-pink); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--soft-pink);
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; right: auto; left: 0; }
.nav-link.active { font-weight: 600; color: var(--soft-pink); }
.nav-link.active::after { width: 100%; right: auto; left: 0; }

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  background: var(--soft-pink);
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-count:empty,
.cart-count[data-count="0"] { display: none; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 90px;
  left: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 997;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--soft-pink); color: white; border-color: var(--soft-pink); }

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1002;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Prose max-width for readability */
.prose-readable,
.prose p,
.product-detail-tabs .prose,
.contact .glass-card p,
#faq .glass-card p,
#shipping p,
#privacy p { max-width: 65ch; }

.nav-wrap.nav-scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .nav-wrap.nav-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.mega-menu.mega-menu--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-secondary);
  padding: 5rem 1.5rem 2rem;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  overflow-y: auto;
}

.mobile-menu.mobile-menu--open {
  transform: translateX(0);
}

/* Hero */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to left, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
}

[data-theme="dark"] .hero-overlay {
  background: linear-gradient(to left, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 40%, transparent 70%);
}

/* فاصل بصري بين الأقسام */
.section-divider {
  border-top: 1px solid var(--border-color);
  position: relative;
}
.section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--soft-pink), transparent);
  opacity: 0.6;
}

/* Countdown */
.countdown-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  min-width: 70px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

/* Theme toggle icons */
.theme-icon--sun { display: none; }
.theme-icon--moon { display: block; }
[data-theme="dark"] .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* شاشة الترحيب */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.welcome-screen.welcome-screen--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.welcome-screen__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--bg-primary) 0%, var(--light-beige) 40%, rgba(255, 79, 163, 0.06) 100%);
}
[data-theme="dark"] .welcome-screen__bg {
  background: linear-gradient(160deg, var(--bg-primary) 0%, #1a1518 50%, rgba(255, 79, 163, 0.08) 100%);
}
.welcome-screen__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  animation: welcomeFadeIn 1s ease;
}
@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.welcome-screen__logo {
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}
.welcome-screen__tagline {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}
.welcome-screen__btn {
  padding: 0.875rem 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.welcome-screen__btn {
  box-shadow: 0 4px 20px rgba(255, 79, 163, 0.25);
}
.welcome-screen__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.welcome-screen__auto {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  min-height: 1.5em;
}
body.has-welcome-screen { overflow: hidden; }

/* نبضة أيقونة السلة عند الإضافة */
.cart-link-pulse {
  animation: cartPulse 0.5s ease;
}
@keyframes cartPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* الوضع الداكن: تباين كروت وتخفيف التوهج */
[data-theme="dark"] .product-card {
  background: rgba(30, 30, 32, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .product-card__action-btn:hover {
  box-shadow: 0 4px 20px rgba(255, 79, 163, 0.25);
}
[data-theme="dark"] .back-to-top:hover,
[data-theme="dark"] .toast.show { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
