/* ═══════════════════════════════════════════════════
   Kingflix.store - Design System & Dark Theme
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --primary: #6C5CE7;
  --primary-hover: #7C6CF7;
  --primary-glow: rgba(108, 92, 231, 0.3);
  --primary-light: rgba(108, 92, 231, 0.15);

  --bg: #0B0F19;
  --bg-2: #0E1225;
  --surface: #111827;
  --surface-2: #172033;
  --surface-3: #1E293B;
  --surface-hover: #1a2744;

  --text: #FFFFFF;
  --text-2: #E2E8F0;
  --muted: #9CA3AF;
  --muted-2: #6B7280;

  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(108, 92, 231, 0.4);

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.15);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-primary: 0 4px 20px rgba(108, 92, 231, 0.3);

  --navbar-h: 70px;
  --container-w: 1200px;
  --sidebar-w: 260px;

  --transition: 200ms ease;
  --transition-slow: 300ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--primary-hover);
}

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

/* ─── Container ─── */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ─── Navbar ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-h);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.navbar-brand:hover {
  color: var(--text);
}

.navbar-brand img {
  height: 36px;
}

.navbar-brand .brand-text {
  background: linear-gradient(135deg, var(--primary), #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.navbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px 0 42px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

.navbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.navbar-search input::placeholder {
  color: var(--muted-2);
}

.navbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 16px;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.search-result-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.search-result-item .result-name {
  font-weight: 600;
  font-size: 14px;
}

.search-result-item .result-category {
  font-size: 12px;
  color: var(--muted);
}

/* Navbar Links */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text);
  background: var(--surface);
}

/* Navbar Auth */
.navbar-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Mobile Menu Toggle */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-body {
  padding: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-muted {
  background: rgba(156, 163, 175, 0.15);
  color: var(--muted);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: var(--muted-2);
}

textarea.form-control {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Section ─── */
.section {
  padding: 40px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.section-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Hero Banner Carousel ─── */
.hero-section {
  margin-top: calc(var(--navbar-h) + 20px);
  position: relative;
}

.hero-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-carousel .slides {
  display: flex;
  transition: transform 500ms ease;
}

.hero-carousel .slide {
  min-width: 100%;
  aspect-ratio: 2.3 / 1;
  position: relative;
}

.hero-carousel .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-carousel .slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  padding: 40px;
  text-align: center;
}

.hero-carousel .slide-placeholder h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.hero-carousel .slide-placeholder p {
  font-size: 16px;
  opacity: 0.9;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.carousel-nav:hover {
  background: var(--primary);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.carousel-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

/* ─── Popular Products ─── */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.popular-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.popular-card:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.popular-card img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.popular-card .popular-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.popular-card .popular-publisher {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Category Tabs ─── */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}

.category-tab:hover {
  color: var(--text);
  border-color: var(--border-2);
}

.category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Product Grid ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.15);
  color: var(--text);
}

.product-card .product-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
}

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

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

.product-card .product-info {
  padding: 10px 12px 14px;
}

.product-card .product-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-publisher {
  font-size: 11px;
  color: var(--muted);
}

/* ─── Trust / Feature Section ─── */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.trust-card .trust-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.trust-card .trust-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.trust-card .trust-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Reviews ─── */
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.review-name {
  font-weight: 600;
  font-size: 14px;
}

.review-product {
  font-size: 12px;
  color: var(--muted);
}

.review-stars {
  color: #F59E0B;
  font-size: 14px;
  margin-bottom: 8px;
}

.review-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ─── FAQ ─── */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--surface-hover);
}

.faq-question .faq-chevron {
  transition: transform var(--transition);
  font-size: 16px;
  color: var(--muted);
}

.faq-item.active .faq-question .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.faq-item.active .faq-answer {
  padding: 0 20px 16px;
  max-height: 500px;
}

.faq-answer p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Footer ─── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .footer-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-brand .footer-logo span {
  background: linear-gradient(135deg, var(--primary), #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand .footer-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 300px;
}

.footer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-2);
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
}

/* ─── Mobile Menu (Offcanvas) ─── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1001;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 1002;
  transition: right var(--transition-slow);
  overflow-y: auto;
  padding: 20px;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.mobile-menu-links {
  list-style: none;
}

.mobile-menu-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu-links a:hover {
  color: var(--primary);
}

.mobile-menu-auth {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Order / Variant Selection ─── */
.variant-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.variant-item {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.variant-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.variant-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.variant-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.variant-price {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

/* ─── Payment Methods ─── */
.payment-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

.payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.payment-item:hover {
  border-color: var(--border-hover);
}

.payment-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-item .payment-name {
  font-weight: 600;
  font-size: 14px;
}

.payment-item .payment-fee {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Order Summary ─── */
.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}

/* ─── Invoice ─── */
.invoice-card {
  max-width: 600px;
  margin: calc(var(--navbar-h) + 30px) auto 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.invoice-header {
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  padding: 24px;
  text-align: center;
}

.invoice-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.invoice-header .invoice-number {
  font-size: 14px;
  opacity: 0.9;
}

.invoice-body {
  padding: 24px;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.invoice-row .label {
  color: var(--muted);
}

.invoice-row .value {
  font-weight: 600;
  text-align: right;
}

/* ─── Status Animations ─── */
.status-success {
  text-align: center;
  padding: 30px;
}

.status-success .checkmark {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success-bg);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: popIn 0.5s ease;
}

.status-processing {
  text-align: center;
  padding: 30px;
}

.status-processing .spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Auth Pages ─── */
.auth-container {
  max-width: 440px;
  margin: calc(var(--navbar-h) + 40px) auto 40px;
  padding: 0 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Dashboard Layout ─── */
.dashboard-layout {
  margin-top: var(--navbar-h);
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

.dashboard-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: var(--navbar-h);
  bottom: 0;
  overflow-y: auto;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}

.sidebar-menu a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.sidebar-menu a.active {
  color: var(--primary);
  background: var(--primary-light);
  border-right: 3px solid var(--primary);
}

.dashboard-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px;
}

/* ─── Dashboard Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 4px;
}

/* ─── Table ─── */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tr:hover td {
  background: var(--surface-2);
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-h) + 12px);
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-warning {
  background: var(--warning);
  color: #000;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Skeleton Loader ─── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

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

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--surface);
  color: var(--text);
}

.pagination .active {
  background: var(--primary);
  color: #fff;
}

/* ─── Meteor Background ─── */
#meteorCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hidden { display: none; }
.page-wrapper { padding-top: calc(var(--navbar-h) + 20px); min-height: 100vh; }

/* ─── Responsive ─── */
@media (max-width: 1199px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .popular-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .navbar-links,
  .navbar-auth {
    display: none;
  }

  .navbar-toggle {
    display: block;
  }

  .navbar-search {
    max-width: none;
    flex: 1;
  }

  .hero-carousel .slide {
    aspect-ratio: 16 / 9;
  }

  .popular-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .variant-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-title {
    font-size: 18px;
  }

  .container {
    padding: 0 12px;
  }

  .hero-section {
    margin-top: calc(var(--navbar-h) + 12px);
  }

  .section {
    padding: 24px 0;
  }

  .auth-card {
    padding: 24px;
  }

  .dashboard-sidebar {
    display: none;
  }

  .dashboard-content {
    margin-left: 0;
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card .stat-value {
    font-size: 18px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .carousel-nav {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .product-card .product-info {
    padding: 8px 8px 10px;
  }

  .product-card .product-name {
    font-size: 12px;
  }

  .popular-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .popular-card {
    padding: 10px;
  }

  .popular-card img {
    width: 36px;
    height: 36px;
  }

  .popular-card .popular-name {
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════
   Auth Pages (Login, Register, Forgot Password)
   ═══════════════════════════════════════════════════ */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-h));
  padding: calc(var(--navbar-h) + 24px) 16px 40px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  display: inline-block;
  margin-bottom: 20px;
}

.auth-logo span {
  background: linear-gradient(135deg, var(--primary), #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 14px;
  color: var(--muted);
}

.auth-form .form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-link-sm {
  font-size: 12px;
  font-weight: 400;
  color: var(--primary);
}

.input-icon {
  position: relative;
}

.input-icon > i:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 16px;
  pointer-events: none;
}

.input-icon input {
  padding-left: 42px;
}

.btn-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   Dashboard Navigation (Tab Bar)
   ═══════════════════════════════════════════════════ */
.dashboard-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.dashboard-nav::-webkit-scrollbar { display: none; }

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition);
}

.dashboard-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.dashboard-nav a.active {
  color: #fff;
  background: var(--primary);
}

/* ═══════════════════════════════════════════════════
   Stat Card (with icon)
   ═══════════════════════════════════════════════════ */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   List Item (for dashboard lists)
   ═══════════════════════════════════════════════════ */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  color: var(--text);
  text-decoration: none;
}

.list-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.list-item:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════
   Payment Radio (Deposit page)
   ═══════════════════════════════════════════════════ */
.payment-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.payment-radio:hover {
  border-color: var(--border-hover);
}

.payment-radio input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.payment-radio input[type="radio"]:checked + .payment-radio-label {
  color: var(--primary);
}

.payment-radio:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-radio-label {
  display: flex;
  justify-content: space-between;
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   Articles
   ═══════════════════════════════════════════════════ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.article-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.article-image {
  height: 180px;
  overflow: hidden;
  background: var(--surface-2);
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 40px;
  color: var(--muted-2);
}

.article-body {
  padding: 16px;
}

.article-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.article-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted-2);
}

.article-meta i {
  margin-right: 4px;
}

/* Article Content (detail page) */
.article-content.prose {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
}

.article-content.prose h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
}

.article-content.prose h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}

.article-content.prose p {
  margin-bottom: 16px;
}

.article-content.prose ul,
.article-content.prose ol {
  margin: 12px 0;
  padding-left: 24px;
}

.article-content.prose li {
  margin-bottom: 8px;
}

.article-content.prose img {
  border-radius: var(--radius);
  margin: 16px 0;
}

.article-content.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}

.article-content.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.article-content.prose pre {
  background: var(--surface-2);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 16px 0;
}

/* ═══════════════════════════════════════════════════
   API Docs
   ═══════════════════════════════════════════════════ */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.method-get,
.method-post {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.method-get {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.method-post {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.api-endpoint code {
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Fira Code', 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

/* ═══════════════════════════════════════════════════
   Page Link (pagination)
   ═══════════════════════════════════════════════════ */
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ═══════════════════════════════════════════════════
   Responsive for new components
   ═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-nav {
    gap: 2px;
    padding: 3px;
  }

  .dashboard-nav a {
    padding: 8px 12px;
    font-size: 12px;
  }

  .dashboard-nav a i {
    display: none;
  }

  .auth-card {
    padding: 24px 20px;
  }
}
