/* ========================================
   Shop Na Ali — Design System
   Dark Mode + Neon Accents
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Variables --- */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.1);

  /* Neon Accents */
  --accent-primary: #00ff88;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #ff6b35;
  --accent-primary-glow: rgba(0, 255, 136, 0.3);
  --accent-secondary-glow: rgba(139, 92, 246, 0.3);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --text-accent: var(--accent-primary);

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;
  --gap-2xl: 48px;
  --gap-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-primary-glow);
  --shadow-glow-purple: 0 0 20px var(--accent-secondary-glow);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-glass-border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--gap-lg);
}

.header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.header__logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.header__search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header__search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-normal);
}

.header__search input::placeholder {
  color: var(--text-muted);
}

.header__search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.header__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.header__links {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.header__tg-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.header__tg-link:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 171, 238, 0.4);
}

/* --- Main Layout --- */
.main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--gap-xl)) var(--gap-lg) var(--gap-3xl);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: var(--gap-2xl) 0;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 500;
  margin-bottom: var(--gap-md);
  animation: fadeInDown 0.6s ease;
}

.hero__badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--gap-md);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero__title .gradient-text {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* --- Stats Bar --- */
.stats {
  display: flex;
  justify-content: center;
  gap: var(--gap-xl);
  padding: var(--gap-lg) 0;
  margin-bottom: var(--gap-lg);
  animation: fadeInUp 0.6s ease 0.3s both;
}

.stats__item {
  text-align: center;
}

.stats__number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.stats__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Filters --- */
.filters {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-xl);
  overflow-x: auto;
  padding-bottom: var(--gap-sm);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 8px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
}

.filter-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  font-weight: 600;
}

/* --- Product Grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap-lg);
}

/* --- Product Card --- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  animation: fadeInUp 0.5s ease both;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.product-card__image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-card__image {
  transform: scale(1.05);
}

.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--accent-tertiary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-card__badge--hot {
  background: linear-gradient(135deg, #ff4444, #ff6b35);
}

.product-card__badge--new {
  background: linear-gradient(135deg, var(--accent-primary), #00cc6a);
  color: var(--bg-primary);
}

.product-card__body {
  padding: var(--gap-md);
}

.product-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--gap-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-sm);
}

.product-card__price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.product-card__price-old {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 400;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #fbbf24;
}

.product-card__orders {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-card__cta {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: var(--gap-sm);
  background: linear-gradient(135deg, var(--accent-primary), #00cc6a);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  text-decoration: none;
}

.product-card__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-primary-glow);
  color: var(--bg-primary);
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 380px;
  border-radius: var(--radius-lg);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--gap-3xl) var(--gap-lg);
  grid-column: 1 / -1;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--gap-md);
}

.empty-state__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--gap-sm);
}

.empty-state__text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--gap-2xl) var(--gap-lg);
  border-top: 1px solid var(--bg-glass-border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-secondary);
}

/* --- Product Page (product.html) --- */
.product-page {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--gap-xl)) var(--gap-lg) var(--gap-3xl);
  position: relative;
  z-index: 1;
}

.product-page__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--gap-lg);
  transition: color var(--transition-fast);
}

.product-page__back:hover {
  color: var(--accent-primary);
}

.product-page__card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.product-page__image-wrap {
  position: relative;
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-page__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 500px;
}

.product-page__content {
  padding: var(--gap-xl);
}

.product-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--gap-md);
  line-height: 1.3;
}

.product-page__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
}

.product-page__price {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-primary);
}

.product-page__price-old {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-page__discount {
  padding: 4px 12px;
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent-tertiary);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.product-page__info {
  display: flex;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  padding: var(--gap-md);
  background: var(--bg-glass);
  border-radius: var(--radius-md);
}

.product-page__info-item {
  text-align: center;
  flex: 1;
}

.product-page__info-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.product-page__info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-page__description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: var(--gap-xl);
}

.product-page__buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-primary), #00cc6a);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.product-page__buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-primary-glow);
  color: var(--bg-primary);
}

/* Timer */
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  padding: var(--gap-md);
  margin-bottom: var(--gap-lg);
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: var(--radius-md);
}

.timer__label {
  font-size: 0.85rem;
  color: var(--accent-tertiary);
  font-weight: 600;
}

.timer__digits {
  display: flex;
  gap: 4px;
}

.timer__unit {
  background: var(--bg-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 40px;
  text-align: center;
  color: var(--text-primary);
}

.timer__separator {
  color: var(--accent-tertiary);
  font-weight: 700;
  font-size: 1.1rem;
  align-self: center;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header__search {
    display: none;
  }

  .hero__title {
    font-size: 2rem;
  }

  .stats {
    gap: var(--gap-md);
  }

  .stats__number {
    font-size: 1.2rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
  }

  .product-card__body {
    padding: var(--gap-sm) var(--gap-sm) var(--gap-md);
  }

  .product-card__title {
    font-size: 0.8rem;
  }

  .product-card__price {
    font-size: 1rem;
  }

  .product-page__content {
    padding: var(--gap-lg);
  }

  .product-page__price {
    font-size: 1.8rem;
  }

  .product-page__info {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-sm);
  }

  .product-card__cta {
    font-size: 0.75rem;
    padding: 8px;
  }
}
