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

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.1);
  --border: rgba(255,255,255,0.12);
  --text: #f5f5f5;
  --text-muted: rgba(255,255,255,0.5);
  --accent: #ffffff;
  --btn-primary-bg: #fff;
  --btn-primary-text: #000;
  --btn-primary-shadow: rgba(255,255,255,0.15);
  --card-overlay: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
  --card-bg: #111;
  --search-bg: rgba(0,0,0,0.7);
  --cart-backdrop: rgba(0,0,0,0.6);
  --glass-blur: 20px;
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: rgba(255,255,255,0.7);
  --surface-hover: rgba(255,255,255,0.9);
  --border: rgba(0,0,0,0.08);
  --text: #1a1a1a;
  --text-muted: rgba(0,0,0,0.4);
  --accent: #000000;
  --btn-primary-bg: #000;
  --btn-primary-text: #fff;
  --btn-primary-shadow: rgba(0,0,0,0.1);
  --card-overlay: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.35) 100%);
  --card-bg: #ddd;
  --search-bg: rgba(255,255,255,0.85);
  --cart-backdrop: rgba(0,0,0,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 72px;
}

/* ─── GLASS UTILITY ─── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
}

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

[data-theme="light"] .glass-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ─── NAV ─── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px;
  border-top: none; border-left: none; border-right: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: transform 0.3s ease;
}

.navbar.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.4rem; font-weight: 900; letter-spacing: 0.3em;
  text-decoration: none; color: var(--text);
}

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  text-decoration: none; color: var(--text-muted);
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.15em;
  transition: color 0.2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--text);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; gap: 12px; align-items: center; }

.icon-btn {
  background: none; border: none; color: var(--text);
  cursor: pointer; padding: 6px; border-radius: 8px;
  transition: background 0.2s; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-hover); }

.cart-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  font-size: 0.6rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-count.visible { transform: scale(1); }

/* ─── HERO ─── */
.hero {
  position: relative; height: 100vh; min-height: 600px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 100%);
  z-index: 1;
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.4) 100%);
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg video {
  width: 100%; height: 100%; object-fit: cover;
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 48px 64px;
  max-width: 640px; width: 90%;
}

.hero-tag {
  display: inline-block;
  font-size: 0.7rem; letter-spacing: 0.3em; font-weight: 500;
  color: var(--text-muted); margin-bottom: 20px;
  border: 1px solid var(--border);
  padding: 6px 16px; border-radius: 100px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -0.03em; margin-bottom: 16px;
}

.hero-content p {
  font-size: 1rem; color: var(--text-muted);
  font-weight: 300; letter-spacing: 0.05em; margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center;
  padding: 14px 32px; background: var(--btn-primary-bg); color: var(--btn-primary-text);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em;
  text-decoration: none; border: none; border-radius: 100px;
  cursor: pointer; transition: all 0.3s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--btn-primary-shadow); }

.btn-outline {
  display: inline-flex; align-items: center;
  padding: 14px 32px; background: transparent; color: var(--text);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em;
  text-decoration: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 100px;
  cursor: pointer; transition: all 0.3s ease;
}
.btn-outline:hover { border-color: var(--text); background: var(--surface-hover); }

/* ─── FILTERS ─── */
.filters-section { padding: 120px 24px 40px; }

.filters-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; border-radius: var(--radius);
  flex-wrap: wrap;
}

.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }

.filter-btn {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.7rem;
  font-weight: 500; letter-spacing: 0.1em;
  padding: 8px 16px; border-radius: 100px; cursor: pointer;
  transition: all 0.3s ease; font-family: inherit;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active {
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
}

.filter-sort select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px;
  border-radius: 100px; font-size: 0.7rem;
  font-family: inherit; letter-spacing: 0.1em;
  cursor: pointer; outline: none;
  transition: border-color 0.2s;
}
.filter-sort select:focus { border-color: var(--text); }
.filter-sort select option { background: var(--bg); color: var(--text); }

/* ─── PRODUCT GRID ─── */
.products {
  max-width: 1400px; margin: 0 auto; padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}

.product-card {
  position: relative; overflow: hidden;
  background: var(--card-bg); cursor: pointer;
  aspect-ratio: 3 / 4;
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.product-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.product-overlay {
  position: absolute; inset: 0;
  background: var(--card-overlay);
  opacity: 0; transition: opacity 0.4s ease;
}

.product-card:hover .product-overlay { opacity: 1; }

.product-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px; transform: translateY(8px);
  transition: transform 0.4s ease;
}

.product-card:hover .product-info { transform: translateY(0); }

.product-brand {
  font-size: 0.6rem; letter-spacing: 0.15em;
  color: var(--text-muted); margin-bottom: 4px;
}

.product-name {
  font-size: 0.85rem; font-weight: 500;
  margin-bottom: 4px;
}

.product-price {
  font-size: 0.8rem; font-weight: 600;
}

.product-add {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-add { opacity: 1; transform: scale(1); }
.product-add:hover { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

/* ─── CART DRAWER ─── */
.cart-drawer {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end;
  pointer-events: none;
}

.cart-drawer.open { pointer-events: all; }

.cart-backdrop {
  position: absolute; inset: 0;
  background: var(--cart-backdrop);
  opacity: 0; transition: opacity 0.4s ease;
}

.cart-drawer.open .cart-backdrop { opacity: 1; }

.cart-panel {
  position: relative; width: 400px; max-width: 90vw;
  height: 100%; display: flex; flex-direction: column;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cart-drawer.open .cart-panel { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-size: 0.85rem; letter-spacing: 0.15em; font-weight: 600; }
.cart-header .icon-btn { font-size: 1.5rem; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }

.cart-empty {
  text-align: center; color: var(--text-muted);
  font-size: 0.85rem; margin-top: 40px;
}

.cart-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.3s ease forwards;
}

.cart-item-img {
  width: 72px; height: 96px; object-fit: cover; border-radius: 8px;
  background: var(--card-bg); flex-shrink: 0;
}

.cart-item-details { flex: 1; }
.cart-item-name { font-size: 0.8rem; font-weight: 500; margin-bottom: 2px; }
.cart-item-price { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }

.cart-item-qty {
  display: flex; align-items: center; gap: 10px;
}
.cart-item-qty button {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent; color: var(--text);
  cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.cart-item-qty button:hover { background: rgba(255,255,255,0.1); }
.cart-item-qty span { font-size: 0.8rem; min-width: 20px; text-align: center; }

.cart-item-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.7rem; letter-spacing: 0.05em;
  padding: 4px 0; transition: color 0.2s; align-self: flex-start;
}
.cart-item-remove:hover { color: #ff4444; }

.cart-footer {
  padding: 20px 24px; border-top: 1px solid var(--border);
}

.cart-total {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 16px;
}

.checkout-btn { width: 100%; justify-content: center; }

/* ─── SEARCH ─── */
.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 120px; gap: 24px;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease;
  background: var(--search-bg);
}

.search-overlay.open { pointer-events: all; opacity: 1; }

.search-panel {
  display: flex; align-items: center;
  width: 90%; max-width: 560px;
  padding: 4px 4px 4px 20px;
  border-radius: var(--radius);
}

.search-panel input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 1rem;
  font-family: inherit; outline: none;
}
.search-panel input::placeholder { color: var(--text-muted); }

.search-results {
  width: 90%; max-width: 560px;
  display: flex; flex-direction: column; gap: 2px;
}

.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 8px;
  background: var(--surface);
  cursor: pointer; transition: background 0.2s;
}
.search-result-item:hover { background: var(--surface-hover); }
.search-result-item img {
  width: 44px; height: 56px; object-fit: cover; border-radius: 4px;
}
.search-result-item div { font-size: 0.8rem; }
.search-result-item span { color: var(--text-muted); font-size: 0.7rem; }

/* ─── MUSIC PLAYER ─── */
.music-player {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  border-bottom: none; border-left: none; border-right: none;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.music-player.collapsed {
  transform: translateY(calc(100% - 4px));
}

.player-track {
  display: flex; align-items: center; gap: 12px;
  min-width: 180px;
}

.player-art {
  width: 44px; height: 44px; border-radius: 6px;
  object-fit: cover; background: var(--card-bg);
}

.player-info { min-width: 0; }
.player-title {
  font-size: 0.8rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-artist {
  font-size: 0.65rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-controls {
  display: flex; align-items: center; gap: 8px;
}

.player-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.player-btn:hover { color: var(--text); background: var(--surface-hover); }

.player-play {
  width: 36px; height: 36px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  border-radius: 50%;
}
.player-play:hover { background: var(--btn-primary-bg); color: var(--btn-primary-text); transform: scale(1.05); }

.shuffle-btn.active { color: var(--text); }
.shuffle-btn.active svg { stroke: var(--text); }

.player-progress {
  flex: 1; display: flex; align-items: center; gap: 10px;
  min-width: 120px;
}

.player-time {
  font-size: 0.65rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.progress-bar {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 4px; cursor: pointer; position: relative;
  transition: height 0.15s ease;
}
.progress-bar:hover { height: 6px; }

.progress-fill {
  height: 100%; width: 0%;
  background: var(--text); border-radius: 4px;
  transition: width 0.1s linear;
}

#closePlayer {
  font-size: 1.4rem; padding: 4px 8px;
  line-height: 1; color: var(--text-muted);
}
#closePlayer:hover { color: var(--text); }

@media (max-width: 768px) {
  .music-player {
    flex-wrap: wrap; gap: 8px; padding: 10px 16px;
  }
  .player-progress { order: -1; width: 100%; }
  .player-track { min-width: 0; flex: 1; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-content { padding: 32px 24px; }
  .products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1px; }
  .filters-inner { flex-direction: column; align-items: stretch; }
  .filter-group { justify-content: center; }
  .cart-panel { max-width: 100vw; border-radius: var(--radius) var(--radius) 0 0; }
}

@media (max-width: 480px) {
  .products { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions a { justify-content: center; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SELECTION ─── */
::selection { background: var(--surface-hover); color: var(--text); }