/* ====================================================
   MZStore — Storefront CSS
   Ultra-premium dark digital store theme
   ==================================================== */

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

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

:root {
  --brand-1: #7c3aed;
  --brand-2: #2563eb;
  --brand-3: #06b6d4;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #2563eb 60%, #06b6d4 100%);
  --gradient-soft: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(6,182,212,0.08) 100%);
  --bg-base: #07071a;
  --bg-elevated: #0d0d28;
  --bg-card: #111130;
  --bg-card-hover: #161642;
  --border: rgba(255,255,255,0.07);
  --border-brand: rgba(124,58,237,0.35);
  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  direction: rtl;
  position: relative;
}

/* ---- NOISE TEXTURE OVERLAY ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ====================================================
   TOP NAVIGATION BAR
   ==================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(7,7,26,0.8);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

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

/* ====================================================
   BUTTONS
   ==================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--border-brand); color: var(--text-1); }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(124,58,237,0.5);
  color: #a78bfa;
}
.btn-outline:hover { background: rgba(124,58,237,0.12); border-color: var(--brand-1); }

.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}
.btn-danger-ghost:hover { background: rgba(239,68,68,0.1); }

.btn-primary {
  background: var(--gradient);
  color: white;
  border: 1px solid transparent;
  font-weight: 700;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  border-radius: inherit;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,58,237,0.5); }
.btn-primary:active { transform: translateY(0); }

.btn-lg { padding: 13px 32px; font-size: 1rem; border-radius: 12px; }

/* ====================================================
   HERO SECTION
   ==================================================== */
.hero {
  position: relative;
  padding: 5rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
}

/* Glowing orbs */
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 8s ease-in-out infinite alternate;
}
.hero::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.7), transparent 70%);
  top: -200px; right: -100px;
}
.hero::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.5), transparent 70%);
  bottom: -150px; left: -80px;
  animation-delay: -4s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: #c4b5fd;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -1px;
}

.hero-gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* STATS STRIP */
.stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  max-width: 600px;
  margin: 2.5rem auto 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(10px);
}

.stat-item { text-align: center; }
.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 0.78rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ====================================================
   PRODUCTS SECTION
   ==================================================== */
.products-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

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

.section-title-group { }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a78bfa;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

/* ====================================================
   PRODUCT GRID & CARDS
   ==================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  border-color: var(--border-brand);
}

/* Card Image */
.card-media {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-media img { transform: scale(1.06); }

.card-media-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(6,182,212,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: rgba(124,58,237,0.35);
}

/* Stock Badge */
.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.stock-badge.in-stock {
  background: rgba(34,197,94,0.25);
  border: 1px solid rgba(34,197,94,0.4);
  color: #4ade80;
}

.stock-badge.out-of-stock {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

/* Delivery Badge */
.instant-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(250,204,21,0.2);
  border: 1px solid rgba(250,204,21,0.4);
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
}

/* Card Body */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.4;
}

.card-desc {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.card-footer {
  padding: 1.25rem;
  padding-top: 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.card-price {
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.card-price span {
  font-size: 0.8rem;
  font-weight: 600;
  background: none;
  -webkit-text-fill-color: var(--text-3);
  color: var(--text-3);
}

.btn-buy {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--gradient);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Tajawal', sans-serif;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn-buy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  border-radius: inherit;
}

.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,0.5); }

.btn-disabled {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  color: var(--text-3);
  border: 1px solid var(--border);
  cursor: not-allowed;
  font-family: 'Tajawal', sans-serif;
}

/* ====================================================
   EMPTY STATE
   ==================================================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
}
.empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.15;
}
.empty-state h3 { font-size: 1.2rem; color: var(--text-2); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; color: var(--text-3); }

/* ====================================================
   FEATURES SECTION
   ==================================================== */
.features-section {
  background: linear-gradient(180deg, transparent, rgba(124,58,237,0.05), transparent);
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #a78bfa;
  flex-shrink: 0;
}

.feature-text h4 { font-size: 0.95rem; font-weight: 800; color: var(--text-1); margin-bottom: 4px; }
.feature-text p { font-size: 0.8rem; color: var(--text-3); line-height: 1.5; }

/* ====================================================
   FOOTER
   ==================================================== */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: #a78bfa; }

.footer-border { border-top: 1px solid var(--border); }

/* ====================================================
   TRUST PILLS
   ==================================================== */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

.trust-pill i { font-size: 0.75rem; color: #a78bfa; }

/* ====================================================
   PULSE/GLOW ANIMATION ON CTA BUY
   ==================================================== */
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(124,58,237,0); }
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 768px) {
  .topbar-inner { padding: 0 1rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .products-section { padding: 2rem 1rem 4rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .stats-strip { gap: 1rem; }
  .stat-divider { display: none; }
  .footer { flex-direction: column; text-align: center; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* ====================================================
   CARD SHIMMER ENTERS
   ==================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card {
  animation: fadeInUp 0.5s ease both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(n+7) { animation-delay: 0.35s; }

/* Gradient border card glow (hover) */
.product-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--r-xl);
  background: var(--gradient);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.product-card:hover::after { opacity: 0.25; }
