/* base.css */
:root {
  --font-sans: "Space Grotesk", sans-serif;
  --font-display: "Oxanium", "Space Grotesk", sans-serif;
  --font-arabic: "Noto Sans Arabic", "Space Grotesk", sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
  --container-width: 1200px;
  --nav-height: 120px;
}

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

html {
  height: 100%;
  position: relative;
  overflow-x: hidden;
}

img {
  -webkit-user-drag: none;
  -user-drag: none;
  max-width: 100%;
  display: block;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  position: relative;
  font-family: var(--font-sans);
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.5s ease, color 0.5s ease;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

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

html[dir="rtl"] .eyebrow,
html[dir="rtl"] .section-title,
html[dir="rtl"] .btn,
html[dir="rtl"] .chip {
  letter-spacing: normal;
  text-transform: none;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

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

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--surface-1);
  color: var(--text-color);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px var(--shadow-color);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 1200;
  cursor: pointer;
}

html[dir="rtl"] .back-to-top {
  right: auto;
  left: 20px;
}

.floating-cart {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 20px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid var(--cart-border, rgba(122, 61, 255, 0.45));
  background: var(--cart-bg, linear-gradient(145deg, #9f6bff, #6a31e6));
  color: var(--cart-fore, #fdfbff);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px var(--cart-shadow, rgba(54, 26, 122, 0.45));
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, bottom 0.2s ease, box-shadow 0.2s ease;
  z-index: 1200;
  animation: cart-pulse 2.6s ease-in-out infinite;
}

html[dir="rtl"] .floating-cart {
  right: auto;
  left: 20px;
}

.floating-cart:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.floating-cart.is-bumping {
  animation: cart-bump 0.55s ease;
}

.floating-cart.is-bumping .cart-count {
  animation: cart-badge-bump 0.55s ease;
}

.floating-cart .cart-count {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--cart-badge-bg, #ffffff);
  color: var(--cart-badge-fore, #5b2ed6);
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 18px rgba(16, 8, 32, 0.3);
  border: 2px solid var(--cart-badge-border, rgba(255, 255, 255, 0.95));
  letter-spacing: 0.04em;
}

@keyframes cart-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08) rotate(-3deg);
  }
  60% {
    transform: scale(0.98) rotate(2deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes cart-badge-bump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes cart-pulse {
  0% {
    box-shadow: 0 14px 28px var(--cart-shadow, rgba(54, 26, 122, 0.35)), 0 0 0 rgba(0, 0, 0, 0);
    border-color: var(--cart-border, rgba(122, 61, 255, 0.35));
  }
  50% {
    box-shadow: 0 22px 50px var(--cart-shadow-strong, rgba(54, 26, 122, 0.55)), 0 0 18px var(--cart-glow, rgba(161, 110, 255, 0.45));
    border-color: var(--cart-border-strong, rgba(161, 110, 255, 0.75));
  }
  100% {
    box-shadow: 0 14px 28px var(--cart-shadow, rgba(54, 26, 122, 0.35)), 0 0 0 rgba(0, 0, 0, 0);
    border-color: var(--cart-border, rgba(122, 61, 255, 0.35));
  }
}

[data-theme="dark"] .floating-cart {
  --cart-bg: linear-gradient(145deg, #ff7ad9, #ff4fb9);
  --cart-border: rgba(255, 255, 255, 0.6);
  --cart-border-strong: rgba(255, 255, 255, 0.92);
  --cart-fore: #ffffff;
  --cart-shadow: rgba(255, 79, 185, 0.35);
  --cart-shadow-strong: rgba(255, 79, 185, 0.55);
  --cart-glow: rgba(255, 169, 228, 0.6);
  --cart-badge-bg: #ffffff;
  --cart-badge-fore: #b71d7e;
  --cart-badge-border: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .floating-cart {
  --cart-bg: linear-gradient(145deg, #b58bff, #7b45ff);
  --cart-border: rgba(35, 14, 70, 0.5);
  --cart-border-strong: rgba(35, 14, 70, 0.85);
  --cart-fore: #ffffff;
  --cart-shadow: rgba(83, 42, 170, 0.35);
  --cart-shadow-strong: rgba(83, 42, 170, 0.5);
  --cart-glow: rgba(143, 92, 255, 0.6);
  --cart-badge-bg: #ffffff;
  --cart-badge-fore: #6a31e6;
  --cart-badge-border: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 90px;
  }

  .floating-cart {
    bottom: 90px;
  }
}

body.show-back-to-top .floating-cart {
  bottom: 86px;
}

@media (max-width: 768px) {
  body.show-back-to-top .floating-cart {
    bottom: 150px;
  }
}

.back-to-top:hover {
  border-color: var(--accent-color);
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

[data-theme="light"] .back-to-top.show {
  border-color: #120d24;
}

[data-theme="dark"] .back-to-top.show {
  border-color: #ffffff;
}

.page-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  position: relative;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

.main-content {
  position: relative;
  z-index: 1;
  transition: transform 0.5s ease;
  flex: 1 0 auto;
}

.container {
  width: min(var(--container-width), 92vw);
  margin: 0 auto;
}


/* Light Theme */
[data-theme="light"] {
  --background-color: #f6f1ff;
  --text-color: #2a1f45;
  --video-desc-color: #6f6690;
  --border-color: rgba(122, 61, 255, 0.12);
  --footer-bg: #f2ebff;
  --footer-text: #6f6690;

  --link-color: #7a3dff;
  --link-hover: #5c2ed4;
  --active-bg: #2a1f45;
  --active-text: #f6f1ff;
  --expired-bg: #e2d3ff;
  --expired-text: #2a1f45;

  --secondary-bg: #ffffff;
  --secondary-text: #7f7798;
  --secondary-text-brand: #9a92b4;

  --accent-color: #d83dff;
  --accent-hover: #a55fff;

  --button-bg: #7a3dff;
  --button-text: #fdfbff;
  --button-hover: #6a31e6;

  --success-bg: #cdbdff;
  --success-text: #2a1f45;
  --warning-bg: #e2d3ff;
  --warning-text: #2a1f45;
  --error-bg: #f1eaff;
  --error-text: #2a1f45;
  --running-bg: #d9ccff;
  --running-text: #2a1f45;

  --shadow-color: rgba(94, 58, 168, 0.12);
  --text-muted: #6f6690;

  --surface-1: #ffffff;
  --surface-2: #f7f2ff;
  --surface-3: #efe8ff;

  --blue-glow: rgba(167, 111, 255, 0.14);
  --purple-glow: rgba(199, 161, 255, 0.18);
  --ring-color: rgba(122, 61, 255, 0.26);
  --header-bg: rgba(246, 241, 255, 0.94);
  --banner-overlay: rgba(18, 12, 36, 0.28);
  --banner-text: #fdfbff;
}

/* Dark Theme */
[data-theme="dark"] {
  --background-color: #140b2a;
  --text-color: #f2ecff;
  --video-desc-color: #c8bfe8;
  --border-color: rgba(255, 255, 255, 0.08);
  --footer-bg: #1a1234;
  --footer-text: #c8bfe8;

  --link-color: #d8b5ff;
  --link-hover: #ffffff;
  --active-bg: #b779ff;
  --active-text: #140b2a;
  --expired-bg: #8a4bff;
  --expired-text: #f2ecff;

  --secondary-bg: #1a1234;
  --secondary-text: #c8bfe8;
  --secondary-text-brand: #efe6ff;

  --accent-color: #b779ff;
  --accent-hover: #e3c5ff;

  --button-bg: #8a4bff;
  --button-text: #f5efff;
  --button-hover: #b779ff;

  --success-bg: #b38dff;
  --success-text: #140b2a;
  --warning-bg: #d8b5ff;
  --warning-text: #140b2a;
  --error-bg: #8a4bff;
  --error-text: #f2ecff;
  --running-bg: #cda7ff;
  --running-text: #140b2a;

  --shadow-color: rgba(140, 75, 255, 0.35);
  --text-muted: #c8bfe8;

  --surface-1: #1a1234;
  --surface-2: #231845;
  --surface-3: #2b1f52;

  --blue-glow: rgba(150, 96, 255, 0.28);
  --purple-glow: rgba(199, 161, 255, 0.3);
  --ring-color: rgba(140, 75, 255, 0.55);
  --header-bg: rgba(26, 18, 52, 0.84);
  --banner-overlay: rgba(10, 6, 22, 0.5);
  --banner-text: #f5efff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn.primary {
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 12px 30px var(--shadow-color);
}

.btn.primary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

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

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

.btn-signin {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--text-color);
}

.btn-signin:hover {
  background: var(--surface-2);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn.outline {
  background: transparent;
  color: var(--accent-color);
  border-color: var(--accent-color);

}

.btn.outline:hover {
  color: var(--button-text);
  background: var(--accent-color);
}



.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border: 1px solid var(--border-color);
  background: var(--surface-3);
  color: var(--text-color);
}

/* Sections */
.section-heading {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 620px;
}

/* Animations */
.reveal {
  opacity: 0;
  animation: rise 0.8s ease forwards;
  animation-delay: var(--delay, 0s);
}

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

/* Floating Buttons (optional utility) */
.floating-buttons {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.floating-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--button-bg);
  color: var(--button-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px var(--shadow-color);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  font-size: 20px;
}

.floating-btn:hover {
  background-color: var(--button-hover);
}

.floating-btn i {
  font-size: 24px;
}

.floating-btn.top-btn {
  display: none;
}

.floating-btn.top-btn.show {
  opacity: 1;
  visibility: visible;
}

.floating-left {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.floating-btn.cart-btn {
  background-color: var(--button-bg);
  color: var(--button-text);
  position: relative;
}

.floating-btn.cart-btn:hover {
  background-color: var(--button-hover);
}

.cart-badge {
  position: absolute;
  bottom: -3px;
  right: -4px;
  background-color: var(--accent-color);
  color: var(--text-color);
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  box-shadow: 0 0 4px var(--shadow-color);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
