/* ============================================================
   ShopLux — Custom CSS (complements Tailwind CDN)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --secondary:    #8b5cf6;
  --accent:       #10b981;
  --wa-green:     #25d366;
  --transition:   0.3s ease;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; }

/* ---------- Loading Screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 2rem;
}
.loader-logo span { color: #a5b4fc; }
.loader-ring {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-dots {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
}
.loader-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: bounce 1.2s infinite ease-in-out;
}
.loader-dots span:nth-child(2) { animation-delay: .2s; }
.loader-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
  40%           { transform: scale(1.0); opacity: 1; }
}

/* ---------- Header ---------- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: box-shadow var(--transition), background var(--transition);
}
#site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.12);
}

/* Search input focus glow */
#search-input:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
  outline: none;
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 80% 40%, rgba(139,92,246,.35) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(99,102,241,.25) 0%, transparent 55%);
}
.hero-float {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}

/* ---------- Product Cards ---------- */
.product-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(99,102,241,.18);
}
.product-card .card-img-wrap { overflow: hidden; }
.product-card .card-img-wrap img {
  transition: transform 0.5s ease;
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.product-card:hover .card-img-wrap img {
  transform: scale(1.08);
}

/* Shimmer skeleton */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Modal ---------- */
#product-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#product-modal.active {
  display: flex;
}
#modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
#modal-box {
  position: relative;
  background: #fff;
  border-radius: 1.25rem;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  scrollbar-width: thin;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#modal-box::-webkit-scrollbar { width: 6px; }
#modal-box::-webkit-scrollbar-track { background: #f1f5f9; }
#modal-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ---------- WhatsApp Button ---------- */
.btn-whatsapp {
  background: var(--wa-green);
  color: #fff;
  transition: background var(--transition), transform 0.15s;
}
.btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-1px);
}

/* ---------- Category Filter ---------- */
.cat-btn {
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.cat-btn.active,
.cat-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Scrollbar (global) ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #a5b4fc; border-radius: 4px; }

/* ---------- Footer ---------- */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background var(--transition), transform var(--transition);
}
.social-icon:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* ---------- Animations ---------- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Back to Top ---------- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px; height: 46px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 90;
  border: none;
  font-size: 1.1rem;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ---------- No results ---------- */
#no-results {
  display: none;
}
#no-results.show {
  display: flex;
}

/* ---------- Price badge ---------- */
.discount-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  #modal-box { border-radius: .75rem; }
  .product-card .card-img-wrap img { height: 180px; }
}
