/* === Base Overrides === */
:root {
  --background: #F7F8FC;
  --foreground: #0D2137;
  --card: #FFFFFF;
  --muted: #E4E7EF;
  --muted-foreground: #5C6478;
  --accent: #10C07A;
  --border: rgba(13,33,55,0.07);
  --secondary: #EEF0F6;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: #10C07A;
  color: #fff;
}

/* === Scroll Animation === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
.animate-on-scroll[data-direction="left"] {
  transform: translateX(50px);
}
.animate-on-scroll[data-direction="left"].visible {
  transform: translateX(0);
}
.animate-on-scroll[data-direction="right"] {
  transform: translateX(-50px);
}
.animate-on-scroll[data-direction="right"].visible {
  transform: translateX(0);
}

/* Stagger children */
.stagger-container > * {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.stagger-container.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-container.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-container.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-container.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-container.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-container.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-container.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* === Floating Animation === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.animate-float {
  animation: float 4s ease-in-out infinite;
}
.animate-float-slow {
  animation: float 5s ease-in-out infinite 1s;
}

/* === Pulse Animation === */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(4.5); opacity: 0; }
}
.animate-pulse-ring {
  animation: pulse-ring 3.5s ease-out infinite;
}
.animate-pulse-ring:nth-child(2) { animation-delay: 1.15s; }
.animate-pulse-ring:nth-child(3) { animation-delay: 2.3s; }

/* === Glow Orb === */
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.6; }
}
.glow-orb {
  animation: glow-pulse 6s ease-in-out infinite;
}

/* === 3D Cube === */
@keyframes cube-rotate {
  0% { transform: rotateX(18deg) rotateY(0deg); }
  100% { transform: rotateX(378deg) rotateY(360deg); }
}
.cube-3d {
  animation: cube-rotate 5s linear infinite;
  transform-style: preserve-3d;
}

/* === Core Glow === */
@keyframes core-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}
.core-glow {
  animation: core-pulse 2s ease-in-out infinite;
}

/* === Orbital Ring Rotation === */
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes ring-spin-reverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* === Particle Float === */
@keyframes particle-float {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-18px); opacity: 1; }
}

/* === Scan Line === */
@keyframes scan-line {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}
.scan-line {
  animation: scan-line 5s linear infinite;
}

/* === Stream Dash === */
@keyframes stream-dash {
  from { stroke-dashoffset: 120; }
  to { stroke-dashoffset: 0; }
}

/* === Dot Pulse === */
@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; r: 3; }
  50% { opacity: 1; r: 4.8; }
}

/* === Badge Float + Enter === */
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes badge-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Terminal Blink === */
@keyframes blink-cursor {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
.terminal-blink {
  animation: blink-cursor 1.5s ease-in-out infinite;
}

/* === CountUp placeholder === */
.count-up {
  display: inline-block;
}

/* === Active Nav indicator (header) === */
.nav-active-bg {
  background: #10C07A;
}

/* === Mobile menu === */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}
.mobile-menu.open {
  max-height: 500px;
  opacity: 1;
}

/* === FAQ Accordion === */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22,1,0.36,1), padding 0.3s ease;
}
.faq-item.active .faq-answer {
  max-height: 500px;
}
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}
.faq-chevron {
  transition: transform 0.3s ease;
}

/* === Pricing Toggle === */
.billing-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
}
.billing-toggle .toggle-knob {
  position: absolute;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: right 0.3s cubic-bezier(0.22,1,0.36,1);
  right: 28px;
}
.billing-toggle.active {
  background: #10C07A;
}
.billing-toggle.active .toggle-knob {
  right: 2px;
}
.billing-toggle:not(.active) {
  background: rgba(255,255,255,0.1);
}

/* === Tab Active (Pricing) === */
.store-tab {
  position: relative;
}
.store-tab.active {
  color: white;
}
.store-tab.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, #0D2137, #10C07A);
  border-radius: 0.5rem;
  z-index: 0;
}
.store-tab span {
  position: relative;
  z-index: 1;
}

/* === Store type badges (template cards) === */
.sell { background: rgba(16,192,122,0.12); color: #10C07A; border: 1px solid rgba(16,192,122,0.25); }
.booking { background: rgba(13,33,55,0.08); color: #0D2137; border: 1px solid rgba(13,33,55,0.12); }
.rental { background: rgba(99,102,241,0.12); color: #6366f1; border: 1px solid rgba(99,102,241,0.25); }

/* === Grid Pattern SVG === */
.grid-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
}

/* === WooCommerce Checkout / Order-Pay === */
.woocommerce-checkout,
.woocommerce-order-pay {
  background: #f9fafb;
}

#payment {
  background: transparent;
  border: none;
  box-shadow: none;
}

#payment .payment_methods {
  display: none;
}

.woocommerce .amount {
  font-family: 'Tajawal', sans-serif;
  font-weight: 600;
}

/* WooCommerce notices */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
  list-style: none;
  padding: 14px 20px;
  margin: 0 0 1.5rem;
  border-radius: 0.75rem;
  font-size: 14px;
  line-height: 1.7;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.woocommerce-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.woocommerce-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.woocommerce-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.woocommerce-error li,
.woocommerce-message li {
  list-style: none;
}

/* Hide WC defaults on order-pay */
.woocommerce-order-pay .woocommerce-form-login-toggle,
.woocommerce-order-pay .woocommerce-form-coupon-toggle {
  display: none;
}

/* === Reduce Motion === */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .stagger-container > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .animate-float,
  .animate-float-slow,
  .animate-pulse-ring,
  .glow-orb,
  .cube-3d,
  .core-glow,
  .scan-line,
  .terminal-blink {
    animation: none !important;
  }
}
