/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #FFC845;
  --gold-dark: #e6ad1f;
  --dark: #060912;
  --dark2: #0d1326;
  --dark3: #141b34;
  --card: #11172c;
  --border: #232b4a;
  --text: #eef1fb;
  --text-muted: #8c93b8;
  --green: #2bd980;
  --red: #ff4d6d;
  --blue: #4d9fff;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; }

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 9, 18, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.sidebar-toggle-btn {
  display: none;
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px 10px 38px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--text-muted); }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.logo-icon { font-size: 24px; }
.logo-accent { color: var(--gold); }

nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--dark3);
}

.nav-link.active { color: var(--gold); }

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #060912 0%, #0d1330 50%, #131a3e 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,200,69,0.10) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,200,69,0.12);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,200,69,0.25);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 520px;
}

.accent { color: var(--gold); }

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 440px;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  gap: 16px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: center;
  min-width: 110px;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== TICKER ===== */
.ticker-wrap {
  background: var(--gold);
  overflow: hidden;
  padding: 10px 0;
}

.ticker {
  display: flex;
  gap: 0;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}

.ticker span {
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 0 48px;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== BEST SELLERS PINNED SECTION ===== */
.bestsellers-section {
  padding: 48px 0 16px;
  background: linear-gradient(180deg, rgba(255,200,69,0.06), transparent);
  border-bottom: 1px solid var(--border);
}

.bestsellers-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ===== PAGE LAYOUT (pinned sidebar + scrolling content) ===== */
.page-wrap {
  display: flex;
  align-items: flex-start;
}

.page-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
}

.sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.cat-list {
  list-style: none;
  padding: 8px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.cat-item:hover { background: var(--dark3); color: var(--text); }

.cat-item.active {
  background: rgba(255,200,69,0.12);
  color: var(--gold);
  font-weight: 700;
}

.cat-item-icon { font-size: 16px; width: 20px; text-align: center; }
.cat-item-label { flex: 1; }
.cat-item-count {
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 100px;
  color: var(--text-muted);
}

.cat-item.active .cat-item-count {
  background: rgba(255,200,69,0.2);
  color: var(--gold);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
}

/* ===== SORT SELECT ===== */
.sort-select {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

/* ===== LOAD MORE ===== */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.load-more-btn {
  background: var(--card);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 32px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover { background: var(--gold); color: #000; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s;
  z-index: 200;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===== CARD BADGE / CATEGORY LABEL ===== */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--gold);
  color: #000;
}

.card-category {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== PRODUCT SECTIONS ===== */
main { padding: 56px 0; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

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

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: rgba(255,200,69,0.4);
}

.product-card a {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}

.card-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  overflow: hidden;
  background: linear-gradient(135deg, #141b34, #1d2547);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s;
  position: relative;
  z-index: 1;
  background: #fff;
}

.card-img-wrap img[data-failed] {
  display: none;
}

.product-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-stars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }

.star-count {
  font-size: 12px;
  color: var(--text-muted);
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}

.price-current {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.amazon-btn {
  background: var(--gold);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.amazon-btn:hover {
  background: var(--gold-dark);
  transform: scale(1.03);
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-small { font-size: 12px; opacity: 0.7; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar-toggle-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    width: 260px;
    z-index: 200;
    border-radius: 0;
    transition: left 0.25s;
    overflow-y: auto;
  }
  .sidebar-header { display: flex; }
  body.sidebar-open .sidebar { left: 0; }
  body.sidebar-open .sidebar-overlay { display: block; }
  .search-wrap { order: 3; flex: 1 1 100%; max-width: none; }
  .header-badge { display: none; }
}

@media (max-width: 768px) {
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero-stats { width: 100%; }
  .stat-card { flex: 1; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-img-wrap { height: 140px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .sort-select { width: 100%; }
}
