/* =========================================================
   CY9 — Store Design System (Dark Mode / Light Purple)
   ========================================================= */

:root {
  --bg: #0d0b14;
  --bg-alt: #131022;
  --surface: #17142a;
  --surface-2: #1e1a35;
  --border: #2b2547;
  --text: #f1eefc;
  --text-dim: #a7a0c4;
  --text-faint: #7b7398;

  --purple: #b48cff;
  --purple-light: #d9c8ff;
  --purple-dark: #8a5cf6;
  --purple-glow: rgba(180, 140, 255, 0.35);

  --success: #5be6a4;
  --danger: #ff6b81;
  --warning: #ffc857;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px var(--purple-glow);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  scroll-behavior: smooth;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(138, 92, 246, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(180, 140, 255, 0.12), transparent 40%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > .site-footer { margin-top: auto; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #14101f;
  box-shadow: 0 8px 24px var(--purple-glow);
}
.btn-primary:hover { box-shadow: 0 10px 32px var(--purple-glow); }
.btn-outline {
  background: transparent;
  color: var(--purple-light);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--purple); background: rgba(180, 140, 255, 0.08); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--purple); }
.btn-danger { background: rgba(255, 107, 129, 0.14); color: var(--danger); border-color: rgba(255,107,129,0.3); }
.btn-danger:hover { background: rgba(255, 107, 129, 0.22); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
}
.brand .logo-mark {
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px var(--purple-glow));
}
.brand span.accent { color: var(--purple-light); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.15s ease;
  position: relative;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; bottom: -18px;
  width: 100%; height: 2px;
  background: var(--purple);
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.user-chip .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #14101f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-chip span { font-size: 14px; font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(180, 140, 255, 0.12);
  border: 1px solid rgba(180, 140, 255, 0.3);
  color: var(--purple-light);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}
.badge-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.hero h1 {
  font-size: 52px;
  line-height: 1.12;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.5px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 17.5px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; }
.hero-stats div strong { display: block; font-size: 26px; font-weight: 800; color: var(--purple-light); }
.hero-stats div span { font-size: 13px; color: var(--text-faint); }

.hero-visual {
  position: relative;
  height: 420px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow), var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-visual::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 50%, var(--purple-glow), transparent 60%);
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
.hero-visual .glass-card {
  position: relative;
  z-index: 2;
  width: 78%;
  background: rgba(23, 20, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(6px);
}
.hero-visual .glass-card h4 { margin: 0 0 6px; font-size: 15px; color: var(--purple-light); }
.hero-visual .glass-card p { margin: 0 0 16px; font-size: 13px; color: var(--text-dim); }
.hero-visual .mini-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 10px 0; border-top: 1px solid var(--border); }
.hero-visual .mini-row:first-of-type { border-top: none; }

/* ---------- Ads / Banner Strip ---------- */
.ads-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 16px 0;
  overflow: hidden;
}
.ads-strip .track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: scroll-left 26s linear infinite;
}
.ads-strip .track span {
  font-size: 14px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ads-strip .track span i { color: var(--purple); font-size: 12px; }
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Homepage testimonials marquee (all store reviews) ---------- */
.testimonials-section { padding-bottom: 40px; }
.testimonials-marquee {
  overflow: hidden;
  padding: 10px 0 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.testimonials-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: scroll-left 50s linear infinite;
}
.testimonials-marquee:hover .testimonials-track { animation-play-state: paused; }
.testimonial-card {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.testimonial-stars { color: var(--purple-light); font-size: 14px; display: flex; gap: 2px; }
.testimonial-comment {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.7;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.testimonial-footer { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #14101f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.testimonial-name { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.testimonial-product { font-size: 11.5px; color: var(--text-faint); }
html[dir="rtl"] .testimonials-track { animation-direction: reverse; }

/* Static (non-scrolling) testimonial layout, used when there are too few
   reviews for a seamless marquee loop to look right (avoids visible repeats).
   Cards sit in a single row, side by side, sharing the available width evenly
   (no wrapping to a new line, no single leftover card stranded below). */
.testimonials-static {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 20px;
}
.testimonials-static .testimonial-card { width: 100%; flex: none; }
@media (max-width: 900px) {
  .testimonials-static { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .testimonials-static { grid-template-columns: 1fr; }
}

/* ---------- Purchases page: product cards (distinct from Bills table) ---------- */
.purchases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.purchase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.purchase-card:hover { border-color: rgba(180,140,255,0.4); transform: translateY(-3px); }
.purchase-card-media { position: relative; height: 150px; background: var(--surface-2); }
.purchase-card-media img { width: 100%; height: 100%; object-fit: cover; }
.purchase-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 30px; }
.purchase-card-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(91,230,164,0.15);
  border: 1px solid rgba(91,230,164,0.35);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
html[dir="rtl"] .purchase-card-badge { left: auto; right: 10px; }
.purchase-card-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.purchase-card-body h3 { margin: 0; font-size: 15px; color: var(--text); line-height: 1.4; }
.purchase-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); }
.purchase-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.purchase-card-body .btn { margin-top: auto; }

.promo-banner {
  margin: 60px auto 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(138,92,246,0.22), rgba(180,140,255,0.08));
  border: 1px solid var(--border);
  padding: 34px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.promo-banner h3 { margin: 0 0 6px; font-size: 22px; }
.promo-banner p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- Section Headings ---------- */
.section { padding: 80px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}
.section-head .tag {
  color: var(--purple-light);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.section-head h2 { font-size: 32px; margin: 0; font-weight: 800; }
.section-head p { color: var(--text-dim); margin: 8px 0 0; max-width: 480px; }

/* ---------- Product Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px); border-color: var(--purple); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.card .thumb {
  height: 170px;
  background: linear-gradient(140deg, var(--surface-2), var(--bg-alt));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: inherit;
}
.card .badge-gallery-count {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(13,11,20,0.75);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
html[dir="rtl"] .card .badge-gallery-count { right: auto; left: 10px; }

.star-rating { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.star-rating-stars { display: inline-flex; gap: 2px; color: var(--purple-light); font-size: 14px; }
.star-rating-count { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.star-rating.lg .star-rating-stars { font-size: 20px; }
.star-rating.lg .star-rating-count { font-size: 14px; }

/* ---------- Reviews Section (product page) — matches homepage testimonials ---------- */
.reviews-section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.reviews-section .section-head { margin-bottom: 32px; }

.review-form-card {
  background: linear-gradient(160deg, rgba(138,92,246,0.1), var(--surface));
  border: 1.5px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: 0 0 0 4px rgba(138,92,246,0.08);
}
.review-form-card h3 { margin: 0 0 4px; font-size: 17px; color: var(--text); }
.review-form-card > p { margin: 0 0 20px; font-size: 13.5px; color: var(--text-dim); }

.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}
.star-input input { display: none; }
.star-input label {
  font-size: 30px;
  color: var(--border);
  cursor: pointer;
  transition: color 0.12s ease;
}
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: var(--purple-light);
}

.review-list { display: flex; flex-direction: column; gap: 18px; }
.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

/* Product page reviews now reuse the .testimonials-marquee / .testimonial-card
   styles defined below (same continuous scrolling design as the homepage). */
.review-item-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.review-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #14101f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.review-item-meta { flex: 1; min-width: 0; }
.review-item-name { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 14.5px; flex-wrap: wrap; }
.verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  color: var(--success);
  background: rgba(91,230,164,0.1);
  border: 1px solid rgba(91,230,164,0.25);
  padding: 2px 8px;
  border-radius: 999px;
}
.review-item-date { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.review-item-stars { color: var(--purple-light); font-size: 14px; display: flex; gap: 2px; flex-shrink: 0; }
.review-item-comment { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.7; }

html[dir="rtl"] .star-input { flex-direction: row; }

.post-purchase-review {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.post-purchase-review h4 { margin: 0 0 6px; font-size: 15.5px; color: var(--text); }
.post-purchase-review p { margin: 0 0 16px; font-size: 13px; color: var(--text-dim); }
.post-purchase-review textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}
.post-purchase-review textarea:focus { outline: none; border-color: var(--purple); }
.post-purchase-review .star-input label { font-size: 26px; }

.card .live-demo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--purple-light);
}
.card .live-demo-link:hover { text-decoration: underline; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .no-image { color: var(--text-faint); font-size: 13px; }
.card .badge-cat {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(13,11,20,0.75);
  border: 1px solid var(--border);
  color: var(--purple-light);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card .badge-featured {
  position: absolute;
  top: 12px; right: 12px;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #14101f;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .lang { font-size: 12px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.card h3 { margin: 0; font-size: 17px; }
.card p.desc { color: var(--text-dim); font-size: 13.5px; line-height: 1.5; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .footer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.card .price { font-size: 19px; font-weight: 800; color: var(--purple-light); }

/* ---------- Filters ---------- */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filters-bar form { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.filters-bar select, .filters-bar input[type="text"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.filters-bar input[type="text"] { flex: 1; min-width: 180px; }
.filters-bar select:focus, .filters-bar input:focus { outline: none; border-color: var(--purple); }
.pill-tabs { display: flex; gap: 8px; }
.pill-tabs a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.pill-tabs a.active { background: var(--purple); color: #14101f; border-color: var(--purple); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 64px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-grid h4 { font-size: 14px; margin: 0 0 16px; color: var(--text); }
.footer-grid p { color: var(--text-dim); font-size: 14px; line-height: 1.7; max-width: 320px; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul li a { color: var(--text-dim); font-size: 14px; }
.footer-grid ul li a:hover { color: var(--purple-light); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}
.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.social-row a:hover { border-color: var(--purple); color: var(--purple-light); }

/* ---------- Forms (auth pages) ---------- */
.auth-wrap {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 8px; font-size: 26px; font-weight: 800; }
.auth-card p.sub { color: var(--text-dim); margin: 0 0 28px; font-size: 14.5px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-glow); }

/* Password field with show/hide eye toggle */
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
html[dir="rtl"] .password-field input { padding-right: 14px; padding-left: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.password-toggle:hover { color: var(--purple-light); background: rgba(180,140,255,0.08); }
html[dir="rtl"] .password-toggle { right: auto; left: 6px; }
.field-check { display: flex; align-items: center; gap: 10px; }
.field-check input { width: auto; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--purple); }
.checkbox-row label { font-size: 14px; color: var(--text-dim); margin: 0; }
.form-error {
  background: rgba(255,107,129,0.1);
  border: 1px solid rgba(255,107,129,0.3);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
}
.form-success {
  background: rgba(91,230,164,0.1);
  border: 1px solid rgba(91,230,164,0.3);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
}
.auth-alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-dim); }
.auth-alt a { color: var(--purple-light); font-weight: 600; }

/* ---------- Product detail ---------- */
.product-detail { padding: 60px 0 100px; display: grid; grid-template-columns: 1fr 380px; gap: 48px; }
.product-media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); height: 420px; display: flex; align-items: center; justify-content: center; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product-thumb-btn {
  width: 72px; height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.product-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb-btn:hover { opacity: 1; }
.product-thumb-btn.active { border-color: var(--purple); opacity: 1; }

.zoom-hint {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(13,11,20,0.75);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.product-media { position: relative; }
.product-media:hover .zoom-hint { opacity: 1; }
html[dir="rtl"] .zoom-hint { right: auto; left: 12px; }

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 4, 10, 0.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--purple); color: var(--purple-light); }
html[dir="rtl"] .lightbox-close { right: auto; left: 28px; }
.product-info h1 { font-size: 30px; margin: 0 0 12px; }
.product-info .meta-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.product-info .meta-row span {
  background: var(--surface-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-dim);
}
.buy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.buy-box .price-tag { font-size: 34px; font-weight: 800; color: var(--purple-light); margin-bottom: 4px; }
.buy-box .price-note { color: var(--text-faint); font-size: 13px; margin-bottom: 24px; }
.buy-box .pay-methods { display: flex; flex-direction: column; gap: 12px; }
.buy-box ul.included { margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.buy-box ul.included li { font-size: 13.5px; color: var(--text-dim); display: flex; gap: 8px; align-items: center; }
.buy-box ul.included li i { color: var(--success); font-size: 15px; }
.description-block {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.description-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.description-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--purple-light);
  flex-shrink: 0;
}
.description-header h3 { margin: 0; font-size: 17px; color: var(--text); font-weight: 800; }
.description-body {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.instructions-block {
  margin-top: 32px;
  background: linear-gradient(160deg, rgba(138,92,246,0.1), rgba(23,20,42,1));
  border: 1.5px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 0 0 4px rgba(138,92,246,0.08);
}
.instructions-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.instructions-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #14101f;
  flex-shrink: 0;
  box-shadow: 0 6px 18px var(--purple-glow);
}
.instructions-header h3 { margin: 0 0 4px; font-size: 18px; color: var(--text); font-weight: 800; }
.instructions-header p { margin: 0; font-size: 13px; color: var(--purple-light); font-weight: 600; }
.instructions-body {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.no-refund-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 20px;
}
.no-refund-notice i { color: var(--danger); font-size: 17px; margin-top: 1px; flex-shrink: 0; }
.no-refund-notice strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; }
.no-refund-notice p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Responsive ---------- */

/* Tablets / small laptops */
@media (max-width: 960px) {
  .hero { padding: 80px 0 60px; }
  .hero .container { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { height: 300px; order: -1; }
  .hero h1 { font-size: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .product-detail { grid-template-columns: 1fr; gap: 32px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}

/* Large phones / small tablets (portrait) */
@media (max-width: 768px) {
  .container { padding: 0 18px; }
  .site-header .inner { height: 64px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 18px 16px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
  }
  .main-nav a:last-child { border-bottom: none; }
  .main-nav a.active::after { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { padding: 10px 14px; }

  .hero h1 { font-size: 32px; }
  .hero p.lead { font-size: 15.5px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-stats { justify-content: space-between; gap: 12px; }
  .hero-stats div strong { font-size: 21px; }

  .promo-banner { flex-direction: column; align-items: stretch; text-align: center; padding: 26px; }
  .promo-banner .btn { width: 100%; }

  .support-contact-card { flex-direction: column; align-items: stretch; text-align: center; }
  .support-contact-actions { flex-direction: column; }
  .support-contact-actions .btn { width: 100%; }
  .faq-item summary { font-size: 14px; }

  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head h2 { font-size: 26px; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar form { flex-direction: column; align-items: stretch; }
  .pill-tabs { flex-wrap: wrap; }

  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .buy-box { padding: 20px; }
  .product-media { height: 260px; }

  .auth-card { padding: 28px 22px; }
}

/* Phones */
@media (max-width: 480px) {
  .brand { font-size: 19px; }
  .brand .logo-mark { font-size: 22px; }
  .hero { padding: 60px 0 40px; }
  .hero h1 { font-size: 26px; }
  .hero-visual { height: 240px; }
  .hero-visual .glass-card { width: 92%; padding: 18px; }
  .badge-pill { font-size: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .card .thumb { height: 150px; }
  .price-tag { font-size: 28px !important; }
  .header-actions { gap: 8px; }
  .header-actions .btn-sm { font-size: 12.5px; padding: 9px 10px; }
  .user-chip span { display: none; }
}

/* ---------- RTL (Arabic) Overrides ---------- */
html[dir="rtl"] .main-nav a.active::after { left: auto; right: 0; }
html[dir="rtl"] .card .badge-cat { left: auto; right: 12px; }
html[dir="rtl"] .card .badge-featured { right: auto; left: 12px; }
html[dir="rtl"] .toggle-switch .slider::before { left: auto; right: 3px; }
html[dir="rtl"] .toggle-switch input:checked + .slider::before { transform: translate(-20px, -50%); }
html[dir="rtl"] table.data-table th { text-align: right; }
html[dir="rtl"] .bi-arrow-right,
html[dir="rtl"] .bi-arrow-left { display: inline-block; transform: scaleX(-1); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
}
.lang-switch:hover { border-color: var(--purple); color: var(--text); }

/* ---------- Legal pages (Terms / Privacy) ---------- */
.legal-page { padding-top: 60px; padding-bottom: 90px; }
.legal-title { font-size: 32px; font-weight: 800; margin: 10px 0 6px; }
.legal-updated { color: var(--text-faint); font-size: 13px; margin-bottom: 28px; }
.legal-intro { color: var(--text-dim); font-size: 15px; line-height: 1.8; margin-bottom: 28px; }
.legal-section { margin-bottom: 26px; }
.legal-section h3 { font-size: 17px; margin: 0 0 10px; color: var(--text); }
.legal-section p { color: var(--text-dim); font-size: 14.5px; line-height: 1.8; margin: 0; }
.legal-highlight {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(255, 107, 129, 0.08);
  border: 1px solid rgba(255, 107, 129, 0.3);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 32px;
}
.legal-highlight i { color: var(--danger); font-size: 22px; margin-top: 2px; flex-shrink: 0; }
.legal-highlight strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.legal-highlight p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.7; }

/* ---------- FAQ / Support page ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 20px;
  transition: border-color 0.15s ease;
}
.faq-item:hover { border-color: rgba(180,140,255,0.4); }
.faq-item summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '\002B';
  margin-inline-start: auto;
  font-size: 20px;
  color: var(--text-faint);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--purple-light); }
.faq-item p { margin: 0 0 20px; color: var(--text-dim); font-size: 14px; line-height: 1.8; }
.faq-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--purple-light);
  background: rgba(180,140,255,0.12);
  border: 1px solid rgba(180,140,255,0.25);
  padding: 4px 10px;
  border-radius: 999px;
}
.faq-badge-warn { color: var(--danger); background: rgba(255,107,129,0.12); border-color: rgba(255,107,129,0.3); }
.faq-item.faq-highlight { border-color: rgba(255,107,129,0.35); }

.support-contact-card {
  margin-top: 40px;
  background: linear-gradient(120deg, rgba(138,92,246,0.18), rgba(180,140,255,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.support-contact-card h3 { margin: 0 0 6px; font-size: 19px; color: var(--text); }
.support-contact-card p { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.support-contact-actions { display: flex; gap: 12px; flex-wrap: wrap; }
