/* ===========================
   ShopX - Main CSS
   Color Palette: Dark Navy + Purple/Violet Gradient
   =========================== */

:root {
  --primary: #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark: #6D28D9;
  --secondary: #EC4899;
  --secondary-light: #F472B6;
  --accent: #06B6D4;
  --accent2: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;

  --bg-dark: #0F0F1A;
  --bg-card: #181828;
  --bg-card2: #1E1E32;
  --bg-input: #252538;
  --border-color: rgba(124, 58, 237, 0.2);

  --text-primary: #F1F1FF;
  --text-secondary: #9B9BC0;
  --text-muted: #6B6B8A;

  --gradient-main: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  --gradient-hero: linear-gradient(135deg, #0F0F1A 0%, #1A0A2E 50%, #0D1A2E 100%);
  --gradient-card: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(236,72,153,0.08) 100%);
  --gradient-glow: radial-gradient(circle at center, rgba(124,58,237,0.3) 0%, transparent 70%);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(124,58,237,0.3);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --nav-height: 75px;
  --top-bar-height: 64px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; object-fit: cover; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

/* ===== APP LOADER ===== */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-main);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderPulse 1.5s ease-in-out infinite;
  box-shadow: var(--shadow-glow);
}

.loader-icon ion-icon {
  font-size: 40px;
  color: white;
}

.loader-text {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.loader-bar {
  width: 120px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.loader-progress {
  height: 100%;
  width: 0%;
  background: var(--gradient-main);
  border-radius: 99px;
  animation: loaderBar 1.8s ease forwards;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(124,58,237,0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(124,58,237,0.6); }
}

@keyframes loaderBar {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ===== APP WRAPPER ===== */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-dark);
  position: relative;
  padding-bottom: calc(var(--nav-height) + 16px);
  transition: opacity 0.6s ease;
}

/* ===== TOP BAR ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-bar-logo {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  color: var(--text-secondary);
}

.top-bar-btn:hover, .top-bar-btn:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(0.95);
}

.top-bar-btn ion-icon { font-size: 20px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: rgba(24, 24, 40, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 8px 12px;
  z-index: 200;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  position: relative;
  text-decoration: none;
}

.bottom-nav-item span:last-child {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.bottom-nav-item.active {
  color: var(--primary-light);
}

.bottom-nav-item.active .nav-icon-wrap {
  background: rgba(124, 58, 237, 0.15);
}

.nav-icon-wrap {
  width: 42px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: var(--transition);
  position: relative;
}

.nav-icon-wrap ion-icon { font-size: 22px; }

.nav-center-btn {
  width: 48px;
  height: 48px;
  background: var(--gradient-main);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  margin-top: -20px;
  color: white;
}

.nav-center-btn ion-icon { font-size: 24px; }

.cart-badge, .wishlist-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--secondary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
  animation: badgePop 0.3s var(--bounce);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ===== SECTION STYLES ===== */
.section { padding: 20px; }
.section-sm { padding: 12px 20px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title ion-icon {
  font-size: 20px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.section-link:hover { color: var(--secondary); }

/* ===== HERO BANNER ===== */
.hero-section {
  padding: 20px;
  padding-bottom: 0;
}

.hero-banner {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-bg-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(124,58,237,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.hero-bg-glow2 {
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-dots {
  position: absolute;
  top: 20px;
  left: 24px;
  display: flex;
  gap: 20px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.hero-dot.large {
  width: 40px;
  height: 8px;
  border-radius: 4px;
  background: var(--gradient-main);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  width: fit-content;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-title span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.hero-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-hero {
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  cursor: pointer;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.5);
  color: white;
}

.hero-stats {
  display: flex;
  gap: 20px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: white;
}

.hero-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SEARCH BAR ===== */
.search-section { padding: 16px 20px 8px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.search-bar ion-icon {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.search-input::placeholder { color: var(--text-muted); }

/* ===== CATEGORY CHIPS ===== */
.category-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 4px 4px 0;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.category-chip ion-icon { font-size: 16px; }

.category-chip.active,
.category-chip:hover {
  background: var(--gradient-main);
  border-color: transparent;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}

/* ===== CATEGORY CARDS (horizontal) ===== */
.cat-card-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 4px 0;
  scrollbar-width: none;
}
.cat-card-scroll::-webkit-scrollbar { display: none; }

.cat-card {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.cat-card:hover { transform: translateY(-4px); }

.cat-card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: var(--transition);
}

.cat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.cat-card.active .cat-card-icon,
.cat-card:hover .cat-card-icon {
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

/* ===== PRODUCT CARDS ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.4);
  box-shadow: var(--shadow-card);
}

.product-card:active { transform: scale(0.97); }

.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrap img { transform: scale(1.08); }

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gradient-main);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  z-index: 2;
}

.product-badge.sale { background: linear-gradient(135deg, #EF4444, #F97316); }
.product-badge.new { background: linear-gradient(135deg, #06B6D4, #3B82F6); }
.product-badge.hot { background: linear-gradient(135deg, #F59E0B, #EF4444); }

.product-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(15,15,26,0.7);
  backdrop-filter: blur(8px);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
  color: var(--text-muted);
}

.product-wishlist-btn:hover, .product-wishlist-btn.active {
  background: rgba(236,72,153,0.2);
  color: var(--secondary);
  transform: scale(1.1);
}

.product-wishlist-btn ion-icon { font-size: 16px; }

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  min-height: calc(13px * 1.4 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.rating-stars { color: var(--warning); font-size: 11px; display: flex; align-items: center; gap: 1px; }
.rating-stars ion-icon { font-size: 11px; }
.rating-value { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.rating-count { font-size: 10px; color: var(--text-muted); }

.product-price {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.price-current {
  font-size: 14px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.price-original {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  white-space: nowrap;
}

.price-discount {
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: rgba(16,185,129,0.12);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-add-btn {
  width: 32px;
  height: 32px;
  background: var(--gradient-main);
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.product-add-btn:hover { transform: scale(1.1); box-shadow: 0 4px 15px rgba(124,58,237,0.4); }
.product-add-btn:active { transform: scale(0.9); }

.product-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

/* ===== FLASH SALE ===== */
.flash-sale-banner {
  background: linear-gradient(135deg, #1A0A2E, #0D1A2E);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}

.flash-sale-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.flash-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
}

.flash-icon {
  font-size: 22px;
  color: var(--warning);
  animation: flashBlink 1s step-start infinite;
}

@keyframes flashBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.countdown-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card2);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 36px;
}

.countdown-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.countdown-sep {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  animation: sepBlink 1s step-start infinite;
}

@keyframes sepBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.flash-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.flash-scroll::-webkit-scrollbar { display: none; }

.flash-product-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--bg-card2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(239,68,68,0.2);
  text-decoration: none;
  display: block;
  transition: var(--transition);
}

.flash-product-card:hover { transform: translateY(-4px); border-color: rgba(239,68,68,0.5); }

.flash-product-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.flash-product-info { padding: 10px; }

.flash-product-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.flash-product-price { font-size: 13px; font-weight: 800; color: var(--secondary); }
.flash-product-original { font-size: 10px; color: var(--text-muted); text-decoration: line-through; }

.flash-product-progress {
  margin-top: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  height: 4px;
  overflow: hidden;
}

.flash-product-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #EF4444, #F59E0B);
  border-radius: 99px;
}

/* ===== BANNER CARDS ===== */
.banner-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.banner-scroll::-webkit-scrollbar { display: none; }

.promo-banner-card {
  flex-shrink: 0;
  width: 260px;
  height: 120px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}

.promo-banner-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}

.promo-banner-tag {
  font-size: 10px;
  font-weight: 700;
  color: white;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.promo-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}

/* ===== PRODUCT DETAIL ===== */
.detail-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-card2);
}

.detail-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.detail-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: rgba(15,15,26,0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  z-index: 10;
}

.detail-share-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(15,15,26,0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: var(--transition);
  z-index: 10;
}

.detail-content {
  padding: 24px 20px;
  padding-bottom: 120px;
}

.detail-category {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 12px;
}

.detail-price-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-price {
  font-size: 26px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.detail-original-price {
  font-size: 16px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.detail-discount-badge {
  background: rgba(16,185,129,0.12);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}

.detail-stats {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-stat {
  flex: 1;
  text-align: center;
}

.detail-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.detail-stat-divider {
  width: 1px;
  background: var(--border-color);
}

.detail-desc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  width: fit-content;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-card2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  transition: var(--transition);
  line-height: 1;
}

.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }
.qty-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

.detail-action-bar {
  position: fixed;
  bottom: calc(var(--nav-height));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 12px 20px;
  background: rgba(15, 15, 26, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  z-index: 100;
}

.btn-primary-pill {
  flex: 1;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.btn-primary-pill:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.5); }
.btn-primary-pill:active { transform: scale(0.97); }

.btn-outline-pill {
  background: var(--bg-card);
  color: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline-pill:hover { background: rgba(124,58,237,0.1); }

/* ===== CART ===== */
.cart-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.cart-item:hover { border-color: rgba(124,58,237,0.3); }

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; }

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-card2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  transition: var(--transition);
  line-height: 1;
}

.cart-qty-btn:hover { background: var(--primary); border-color: var(--primary); }
.cart-qty-val { font-size: 14px; font-weight: 700; color: var(--text-primary); min-width: 20px; text-align: center; }

.cart-delete-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.cart-delete-btn:hover { background: rgba(239,68,68,0.2); }
.cart-delete-btn ion-icon { font-size: 16px; }

.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.cart-summary-label { font-size: 14px; color: var(--text-secondary); }
.cart-summary-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.cart-summary-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.cart-summary-total-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-summary-total-value {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
}

.cart-empty-icon {
  width: 100px;
  height: 100px;
  background: var(--bg-card);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.empty-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.empty-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 400px;
}

.toast-item {
  background: var(--bg-card2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.4s var(--bounce);
  pointer-events: all;
}

.toast-item.hiding {
  animation: toastOut 0.3s ease forwards;
}

.toast-item.success { border-color: rgba(16,185,129,0.3); }
.toast-item.error { border-color: rgba(239,68,68,0.3); }

.toast-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.toast-icon-wrap.success { background: rgba(16,185,129,0.15); color: var(--success); }
.toast-icon-wrap.error { background: rgba(239,68,68,0.15); color: var(--danger); }
.toast-icon-wrap.info { background: rgba(124,58,237,0.15); color: var(--primary-light); }

.toast-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* ===== PROFILE ===== */
.profile-header {
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(236,72,153,0.15));
  border-bottom: 1px solid var(--border-color);
  padding: 30px 20px 20px;
  position: relative;
  overflow: hidden;
}

.profile-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  font-weight: 800;
  border: 3px solid rgba(255,255,255,0.2);
}

.profile-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}

.profile-name { font-size: 20px; font-weight: 800; text-align: center; color: var(--text-primary); margin-bottom: 4px; }
.profile-email { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 16px; }

.profile-stats-row {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.profile-stat {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
}

.profile-stat-val { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.profile-stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.profile-menu-section { padding: 16px 16px 110px; }

.menu-group {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.menu-group-title {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none;
  position: relative;
}

.menu-item:last-child { border-bottom: none; }

.menu-item:hover {
  background: rgba(124,58,237,0.07);
}
.menu-item:hover .menu-arrow {
  color: var(--primary-light);
  transform: translateX(3px);
}

.menu-item:active { background: rgba(124,58,237,0.13); }

.menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* text content block — must take remaining space */
.menu-item > div:not(.menu-icon) {
  flex: 1;
  min-width: 0;
}

.menu-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-arrow {
  font-size: 18px;
  color: var(--border-color);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s ease, color 0.2s ease;
}
.menu-badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--gradient-main);
  color: white;
  padding: 3px 9px;
  border-radius: 99px;
  flex-shrink: 0;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}

/* ===== WISHLIST ===== */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }
.scale-in { animation: scaleIn 0.4s var(--bounce); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* Stagger animation for cards */
.product-card:nth-child(1) { animation: slideUp 0.5s ease 0.05s both; }
.product-card:nth-child(2) { animation: slideUp 0.5s ease 0.1s both; }
.product-card:nth-child(3) { animation: slideUp 0.5s ease 0.15s both; }
.product-card:nth-child(4) { animation: slideUp 0.5s ease 0.2s both; }
.product-card:nth-child(5) { animation: slideUp 0.5s ease 0.25s both; }
.product-card:nth-child(6) { animation: slideUp 0.5s ease 0.3s both; }
.product-card:nth-child(7) { animation: slideUp 0.5s ease 0.35s both; }
.product-card:nth-child(8) { animation: slideUp 0.5s ease 0.4s both; }

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Shimmer skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Pulse ring */
.pulse-ring {
  animation: pulseRing 2s ease infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(124,58,237,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}

/* ===== PAGE TITLE BAR ===== */
.page-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.page-back-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
  font-size: 20px;
}

.page-back-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }

.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); flex: 1; }

/* ===== BADGE STYLES ===== */
.badge-primary {
  background: rgba(124,58,237,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(124,58,237,0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== MISC ===== */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseRing 2s ease infinite;
}

/* ===== PROMO STRIP ===== */
.promo-strip {
  background: var(--gradient-main);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  position: relative;
}

.promo-strip-text {
  white-space: nowrap;
  animation: scrollText 20s linear infinite;
}

@keyframes scrollText {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* Responsive */
@media (max-width: 380px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-title { font-size: 22px; }
}

/* ===== EXTRA ANIMATIONS ===== */
:root { --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.3); }
  70%  { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
