/**
 * ItemFix storefront theme
 * Primary blue #2563EB · light ground · Poppins
 * Loaded after app.css
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

[data-theme="light"] {
  --bg-base: #f1f1f1;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #fafafa;
  --bg-input: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(37, 99, 235, 0.45);
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --accent-lime: #2563EB;
  --accent-cyan: #2563EB;
  --accent-glow: rgba(37, 99, 235, 0.28);
  --accent-cyan-glow: rgba(37, 99, 235, 0.18);
  --gradient-brand: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  --gradient-hero: none;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 4px 16px rgba(37, 99, 235, 0.25);
  --success: #28a745;
  --warning: #ff932e;
  --danger: #ff6666;
  --info: #85c3ff;
  --header-bg: #ffffff;
  --overlay: rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --container: 1440px;
  --brand-primary: #2563EB;
  --brand-primary-rgb: 37, 99, 235;
  --brand-ground: #f1f1f1;
  --brand-topbar: #1f1f1f;
}

[data-theme="dark"] {
  --bg-base: #121212;
  --bg-elevated: #1c1c1c;
  --bg-surface: #222;
  --bg-surface-hover: #2a2a2a;
  --bg-input: #1a1a1a;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(37, 99, 235, 0.55);
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --text-muted: #9a9a9a;
  --header-bg: #1c1c1c;
  --brand-topbar: #0a0a0a;
  --brand-ground: #121212;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body {
  font-family: var(--font-body);
  background: var(--brand-ground);
  color: var(--text-primary);
}

[data-theme="dark"] body,
html[data-theme="dark"] body {
  background: var(--bg-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--brand-primary); }
a:hover { color: #1D4ED8; }

.btn-primary,
.btn.btn-primary {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none;
}
.btn-primary:hover,
.btn.btn-primary:hover {
  background: #1D4ED8 !important;
  border-color: #1D4ED8 !important;
  filter: none;
  box-shadow: var(--shadow-glow);
}

.btn-secondary,
.btn.btn-secondary {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 10px;
}
.btn-secondary:hover,
.btn.btn-secondary:hover {
  background: var(--bg-surface-hover) !important;
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary) !important;
}
.btn-ghost,
.btn.btn-ghost {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}
.btn-ghost:hover,
.btn.btn-ghost:hover {
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  background: rgba(var(--brand-primary-rgb), 0.1) !important;
}

/* ---------- Header (ItemFix) ---------- */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.is-topbar {
  background: var(--brand-topbar);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.35rem 0;
}
.is-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.is-topbar a { color: rgba(255,255,255,0.85); }
.is-topbar a:hover { color: var(--brand-primary); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary) !important;
  text-decoration: none;
  flex-shrink: 0;
  max-width: 220px;
}
.logo img,
img.site-logo {
  height: 42px !important;
  width: auto !important;
  max-width: 180px !important;
  max-height: 42px !important;
  object-fit: contain;
  display: block;
}
.logo .accent { color: var(--brand-primary); }
.logo-mark {
  display: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.main-nav > a,
.nav-dropdown > a {
  color: var(--text-primary) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.main-nav > a:hover,
.main-nav > a.active,
.nav-dropdown > a:hover {
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary) !important;
}

.header-search {
  flex: 1;
  max-width: 360px;
  background: var(--brand-ground);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.header-search input {
  background: transparent;
  color: var(--text-primary);
}
.header-search svg { color: var(--text-muted); }

.icon-btn {
  color: var(--text-primary);
  border-radius: 10px;
}
.icon-btn:hover {
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
}
.cart-badge {
  background: var(--brand-primary);
  color: #fff;
}

/* ---------- Home: Popular games ---------- */
.is-popular {
  padding: 1.5rem 0 0.5rem;
}
.is-popular-title {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  text-align: center;
}
.is-popular-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
@media (max-width: 992px) {
  .is-popular-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 576px) {
  .is-popular-grid { grid-template-columns: repeat(2, 1fr); }
}

.is-game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
  color: var(--text-primary) !important;
  transition: transform 0.2s ease;
}
.is-game-tile:hover { transform: translateY(-3px); }
.is-game-tile img,
.is-game-tile .is-game-fallback {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-elevated);
}
.is-game-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--gradient-brand);
  color: #fff;
}
.is-game-tile span {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Banner strip (wide + short) ---------- */
.is-banner {
  padding: 0.75rem 0 0.25rem;
}
.is-banner-link {
  display: block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.is-banner-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
}
.is-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 110px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}
@media (max-width: 640px) {
  .is-banner img { max-height: 84px; }
}

/* ---------- Hero slider (FoxEpin-style) ---------- */
.is-hero-slider {
  padding: 1rem 0 0.25rem;
}
.is-slider {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0b1220;
}
.is-slider-track {
  position: relative;
  width: 100%;
}
.is-slide {
  display: none;
  position: relative;
}
.is-slide.is-active {
  display: block;
}
.is-slide-link {
  display: block;
  color: inherit;
  text-decoration: none !important;
}
.is-slide img {
  display: block;
  width: 100%;
  height: clamp(180px, 28vw, 420px);
  object-fit: cover;
  object-position: center;
}
.is-slide-caption {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  max-width: min(70%, 420px);
}
.is-slide-caption strong {
  font-size: 1.15rem;
  font-weight: 800;
}
.is-slide-caption span {
  font-size: 0.9rem;
  opacity: 0.9;
}
.is-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.is-slider-nav:hover { background: rgba(37, 99, 235, 0.9); }
.is-slider-nav.is-prev { left: 12px; }
.is-slider-nav.is-next { right: 12px; }
.is-slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.is-slider-dots button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.is-slider-dots button.is-active {
  background: #fff;
  width: 22px;
}

/* ---------- Section game products ---------- */
.is-section {
  padding: 1.75rem 0;
}
.is-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.is-section-head h2 {
  font-size: 1.35rem;
  margin: 0;
}
.is-section-head p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.is-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* ---------- Product card ItemFix ---------- */
.product-card.is-card,
.is-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .is-card {
  background: var(--bg-surface);
}
.is-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.is-card .card-image {
  position: relative;
  aspect-ratio: 1;
  background: #f7f7f7;
  overflow: hidden;
}
.is-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.is-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  z-index: 2;
}
.is-card .card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.is-card .product-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}
.is-card .product-card-title a {
  color: var(--text-primary) !important;
}
.is-card .product-card-desc { display: none; }
.is-card .product-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
.is-card .product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.is-card .product-price-old {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.35rem;
}
.is-card .btn-sm {
  width: 100%;
  justify-content: center;
}

.badge-sale,
.badge-featured {
  background: var(--brand-primary);
  color: #fff;
}

/* ---------- Platforms strip ---------- */
.is-platforms {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.is-platforms h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}
.is-platforms .lead {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.is-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.is-platform-tabs a {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
}
.is-platform-tabs a:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary) !important;
  background: rgba(var(--brand-primary-rgb), 0.12);
}
.is-platform-tabs a.active {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
}

/* ---------- Why / SEO block ---------- */
.is-seo {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
}
.is-seo h2,
.is-seo h3 {
  color: var(--text-primary);
}
.is-seo h2 { font-size: 1.25rem; }
.is-seo ol {
  list-style: decimal;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}
.is-seo li { margin-bottom: 0.4rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: #1f1f1f;
  color: rgba(255,255,255,0.75);
  margin-top: 3rem;
  padding: 3rem 0 1.5rem;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--brand-primary); }
.site-footer .logo { color: #fff !important; }
.site-footer h4 { color: #fff; font-size: 0.95rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- Hide old hero on home when fox layout ---------- */
.page-home .hero {
  display: none;
}
.page-home .main-content {
  padding-top: 0;
}

/* ---------- Cards / forms polish ---------- */
.card {
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.2);
}

.compare-fab {
  background: var(--brand-primary);
  color: #fff;
}

/* Extra modules (campaigns, giveaways, pvp) — ItemFix */
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--brand-primary);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.ui-icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ui-icon-lg { width: 28px; height: 28px; }
.empty-icon { display:flex; align-items:center; justify-content:center; margin:0 auto 12px; width:56px; height:56px; border-radius:14px; background:rgba(37,99,235,.12); color:#2563EB; }
.nav-dropdown > a .ui-icon { width: 14px; height: 14px; }

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
}
.page-loader.is-on { display: flex; }
.page-loader-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #2563EB;
  animation: if-spin .7s linear infinite;
}
@keyframes if-spin { to { transform: rotate(360deg); } }

.error-page {
  text-align: center;
  padding: 4rem 1rem 5rem;
}
.error-page .error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--brand-primary);
  opacity: .9;
}
.error-page h1 { margin: 0.5rem 0 0.75rem; }
.error-search .header-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 1rem;
}
.error-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
}

img[loading="lazy"] { content-visibility: auto; }

/* ---------- Dark mode contrast fixes (white-on-white) ---------- */
[data-theme="dark"] .card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .box,
[data-theme="dark"] .alert,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .nav-dropdown-menu {
  background: var(--bg-elevated) !important;
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success),
[data-theme="dark"] .chip,
[data-theme="dark"] .tag,
[data-theme="dark"] .badge:not(.badge-sale):not(.badge-featured),
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span,
[data-theme="dark"] .tab,
[data-theme="dark"] .tabs a,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .category-chip {
  background: var(--bg-surface-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn.btn-primary,
[data-theme="dark"] .pagination a.active,
[data-theme="dark"] .tabs a.active {
  background: var(--brand-primary) !important;
  color: #fff !important;
  border-color: var(--brand-primary) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .table,
[data-theme="dark"] .data-table {
  color: var(--text-primary);
}
[data-theme="dark"] .table th,
[data-theme="dark"] .data-table th {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
[data-theme="dark"] .table td,
[data-theme="dark"] .data-table td {
  border-color: var(--border);
}

[data-theme="dark"] .is-section-head h2,
[data-theme="dark"] .is-popular-title,
[data-theme="dark"] .product-card-title,
[data-theme="dark"] .product-card-title a {
  color: var(--text-primary) !important;
}

/* ---------- Light mode contrast fixes ---------- */
[data-theme="light"] body,
[data-theme="light"] .main-content {
  color: var(--text-primary);
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .page-title,
[data-theme="light"] .section-title {
  color: var(--text-primary) !important;
}

[data-theme="light"] .site-header,
[data-theme="light"] .site-header .logo,
[data-theme="light"] .main-nav > a,
[data-theme="light"] .nav-dropdown > a,
[data-theme="light"] .icon-btn,
[data-theme="light"] .header-search input {
  color: var(--text-primary) !important;
}

[data-theme="light"] .main-nav > a,
[data-theme="light"] .nav-dropdown > a {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success),
[data-theme="light"] .btn-ghost,
[data-theme="light"] .btn-secondary {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="light"] .form-control::placeholder,
[data-theme="light"] input::placeholder {
  color: var(--text-muted) !important;
}

[data-theme="light"] .card,
[data-theme="light"] .product-card,
[data-theme="light"] .panel,
[data-theme="light"] .empty-state {
  background: var(--bg-elevated) !important;
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="light"] .text-muted,
[data-theme="light"] .lead {
  color: var(--text-muted) !important;
}

