/* Custom Tailwind CSS Styles — Car Option Premium Theme */

/* RTL Support */
html[dir="rtl"] { direction: rtl; }

/* ── Scrollbar (overridden by premium-theme but kept for fallback) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0B0B0C; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #FF8A00; }

/* ── Material Symbols filled ── */
.material-symbols-outlined.fill-current {
  font-variation-settings: 'FILL' 1;
}

/* ── Global smooth transitions (GPU-safe props only) ── */
*, *::before, *::after {
  transition-property: color, background-color, border-color,
    opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* ── Focus styles ── */
input:focus, select:focus, textarea:focus { outline: none; }

/* ── Skeleton loading (dark) ── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    #1D1F22 25%, #23262A 50%, #1D1F22 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Product card action visibility ── */
.product-card:hover .product-actions {
  opacity: 1;
  transform: translateX(0);
}
.product-actions {
  opacity: 0;
  transform: translateX(0.5rem);
}

/* ── Product card lift ── */
.product-card { transition: all 0.3s ease; }
.product-card:hover {
  box-shadow: 0 0 28px rgba(255,138,0,0.2), 0 16px 48px rgba(0,0,0,0.55);
  transform: translateY(-6px);
}

/* ── Persian numbers ── */
.persian-nums { font-feature-settings: "ss01"; }

/* ── Button glow ── */
.btn-glow { transition: all 0.2s ease; }
.btn-glow:hover {
  box-shadow: 0 4px 24px rgba(255,138,0,0.35), 0 0 40px rgba(255,138,0,0.12);
}

/* ── Accent color helpers ── */
.text-accent   { color: #FF8A00 !important; }
.bg-accent     { background: #FF8A00 !important; }
.border-accent { border-color: #FF8A00 !important; }

/* ── Glass card helper ── */
.glass-card {
  background: rgba(29,31,34,0.8);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
}

/* ── Orange divider line ── */
.divider-accent {
  height: 1px;
  background: linear-gradient(to right, transparent, #FF8A00, transparent);
  opacity: 0.35;
}

/* ══════════════════════════════════════════════════════════════
   Scroll-Reveal  —  عناصر قبل از اسکرول پنهان، بعد آشکار می‌شن
   ══════════════════════════════════════════════════════════════ */

/* ── State پیش‌فرض همه scroll-animate ها: پنهان ── */
.scroll-animate {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity  0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-fade {
  opacity: 0;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-animate-fade.is-visible { opacity: 1; }

.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity  0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-animate-scale.is-visible { opacity: 1; transform: scale(1); }

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity  0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-animate-left.is-visible  { opacity: 1; transform: translateX(0); }

.scroll-animate-right {
  opacity: 0;
  transform: translateX(24px);
  transition:
    opacity  0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-animate-right.is-visible { opacity: 1; transform: translateX(0); }

/* ── Product card در داخل grid: fade+up با stagger از JS ── */
.product-cards-container .product-card {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity  0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.product-cards-container .product-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero Section: محتوا از پایین fade-up می‌کنه ── */
[data-hero] .hero-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity  0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-hero].hero-loaded .hero-reveal { opacity: 1; transform: translateY(0); }

/* delay های hero */
[data-hero] .hero-reveal:nth-child(1) { transition-delay: 0.08s; }
[data-hero] .hero-reveal:nth-child(2) { transition-delay: 0.22s; }
[data-hero] .hero-reveal:nth-child(3) { transition-delay: 0.36s; }
[data-hero] .hero-reveal:nth-child(4) { transition-delay: 0.48s; }
[data-hero] .hero-reveal:nth-child(5) { transition-delay: 0.58s; }
[data-hero] .hero-reveal:nth-child(6) { transition-delay: 0.68s; }

/* ── کاهش انیمیشن برای کاربران که reduced-motion دارن ── */
@media (prefers-reduced-motion: reduce) {
  .scroll-animate,
  .scroll-animate-fade,
  .scroll-animate-scale,
  .scroll-animate-left,
  .scroll-animate-right,
  .product-cards-container .product-card,
  [data-hero] .hero-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
