@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #110e0b;
  --surface: #1a1613;
  --header-bg: #f4ede0;
  --header-text: #14110e;
  --text-light: #f4ede0;
  --muted: #8a8475;
  --line: rgba(255, 255, 255, 0.12);
  --line-header: rgba(20, 17, 14, 0.12);
  --amber: #f5840a;
  --amber-dark: #d97003;
  --green: #10b981;
  --red: #e0245e;
  --display: 'Bebas Neue', cursive, sans-serif;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image: repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 18px);
  color: var(--text-light);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mono { font-family: var(--font-mono); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; display: block; }

/* ================= HEADER CONTRASTADO CLARO ================= */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--line-header);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.brand-link { display: flex; align-items: center; gap: 10px; }
.ps-logo { height: 36px; max-width: 120px; object-fit: contain; }

.brand-text strong {
  font-family: var(--display);
  font-size: 22px;
  color: var(--header-text);
  display: block;
  line-height: 1;
}

.brand-text em {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--amber-dark);
  font-style: normal;
  letter-spacing: 0.1em;
}

.nav-links { display: flex; gap: 8px; }
.nav-item {
  font-size: 13px;
  font-weight: 700;
  color: #5a5448;
  padding: 6px 14px;
  border-radius: 6px;
}
.nav-item.active, .nav-item:hover { color: #fff; background: var(--amber); }

.head-actions { display: flex; align-items: center; gap: 8px; }

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(245, 132, 10, 0.6);
  background: rgba(245, 132, 10, 0.12);
  color: var(--amber-dark);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.cart-count {
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-header);
  background: #fff;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--header-text);
}

/* ================= FILTROS RÁPIDOS ================= */
.quick-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 14px 10px 6px;
  overflow-x: auto;
}
.quick-chips::-webkit-scrollbar { display: none; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chip.active, .chip:hover {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
  font-weight: 700;
}

/* ================= HOME & CARRUSEL ================= */
.home-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 50px;
}

.carousel-section {
  margin-bottom: 35px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 14px;
}
.section-header h2 { font-size: 26px; color: var(--text-light); }

.carousel-controls { display: flex; gap: 6px; }
.c-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
}
.c-nav-btn:hover { background: var(--amber); color: #000; }

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 14px;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-card {
  scroll-snap-align: start;
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.badge-carousel {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.card-thumb {
  width: 100%;
  height: 240px;
  max-height: 240px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.artist-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber);
  font-weight: 700;
  text-transform: uppercase;
}

.album-label {
  font-size: 17px;
  line-height: 1.1;
  margin: 3px 0 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-label { font-size: 14px; font-weight: 700; color: #fff; }

.btn-view {
  font-size: 11px;
  font-weight: 800;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 4px 10px;
  border-radius: 6px;
}
.btn-view:hover { background: var(--amber); color: #000; }

/* ================= GRILLA FORMATOS ================= */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.format-tile {
  aspect-ratio: 1/1;
  border-radius: 8px;
  background: #14110e;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  font-family: var(--display);
  font-size: 16px;
  color: #fff;
}

.format-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.format-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85));
  z-index: 1;
}

.format-tile span { position: relative; z-index: 2; }

/* ================= VITRINA VERTICAL (PRODUCTO & CATEGORÍA) ================= */
.feed-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 30px;
  display: flex;
  justify-content: center;
}

.feed-scroll {
  width: 100%;
  max-width: 490px;
  height: min(78vh, 720px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  border-radius: 20px;
  background: #000;
  position: relative;
  scrollbar-width: none;
  border: 1px solid var(--line);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}
.feed-scroll::-webkit-scrollbar { display: none; }

.slide-wrap {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  perspective: 1200px;
}

.flip-stage {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flip-stage.state-0 { transform: rotateY(0deg); }
.flip-stage.state-1 { transform: rotateY(180deg); }
.flip-stage.state-2 { transform: rotateY(360deg); }
.flip-stage.state-3 { transform: rotateY(540deg); }

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
}

.face-front { z-index: 2; transform: rotateY(0deg); }
.face-back { transform: rotateY(180deg); z-index: 1; background: #f4ede0; }

.front-layer, .back-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.35s ease;
}

.front-layer img, .back-layer img,
.front-layer video, .back-layer video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.front-layer iframe, .back-layer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.flip-stage.state-0 .layer-cover { opacity: 1; pointer-events: auto; z-index: 2; }
.flip-stage.state-0 .layer-artwork,
.flip-stage.state-0 .layer-video,
.flip-stage.state-0 .layer-tracks { opacity: 0; pointer-events: none; }

.flip-stage.state-1 .layer-video { opacity: 1; pointer-events: auto; z-index: 5; background: #000; }
.flip-stage.state-1 .layer-tracks { opacity: 0; pointer-events: none; }

.flip-stage.state-2 .layer-artwork { opacity: 1; pointer-events: auto; z-index: 4; background: #000; }
.flip-stage.state-2 .layer-cover { opacity: 0; pointer-events: none; }

.flip-stage.state-3 .layer-tracks { opacity: 1; pointer-events: auto; z-index: 5; background: #f4ede0; }
.flip-stage.state-3 .layer-video { opacity: 0; pointer-events: none; }

.badge-store {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.badge-store.badge-available, .badge-carousel.badge-available { background: var(--green); color: #fff; }
.badge-store.badge-new, .badge-carousel.badge-new { background: var(--amber); color: #000; }
.badge-store.badge-restock, .badge-carousel.badge-restock { background: #3b82f6; color: #fff; }
.badge-store.badge-out_of_stock, .badge-carousel.badge-out_of_stock { background: #ef4444; color: #fff; }

.card-info-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 80px 16px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 25%, rgba(0,0,0,0.96) 80%, #000 100%);
  color: #fff;
  z-index: 8;
}

.artist-txt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 2px;
}

.title-txt {
  font-family: var(--display);
  font-size: 34px;
  line-height: 0.98;
  margin: 2px 0 8px;
  text-transform: uppercase;
  text-shadow: 0 3px 10px rgba(0,0,0,0.8);
  padding-right: 50px;
}

.tags-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tag-pill {
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.25);
  color: #e8e2d4;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.tag-pill.cond { border-color: rgba(245, 132, 10, 0.5); color: var(--amber); }

.price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px; }
.price-row b { font-family: var(--display); font-size: 32px; color: var(--amber); }
.price-row span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.cta-row { display: flex; gap: 8px; padding-right: 50px; }

.btn-orange-shop {
  flex: 1;
  background: linear-gradient(180deg, #f7931e 0%, #f37703 100%);
  color: #fff;
  border: none;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(245, 132, 10, 0.45);
}
.btn-orange-shop:active { transform: scale(0.96); }

.btn-disabled {
  background: #4a453e !important;
  color: #8a8475 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-dark-preview {
  background: rgba(20, 17, 14, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-dark-preview.playing { background: var(--amber); color: #000; border-color: var(--amber); }

.rail-actions {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 12;
}

.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}
.rail-btn:active { transform: scale(0.92); }
.rail-btn.liked { color: var(--red); border-color: var(--red); }

/* ================= BOTÓN PLAY INTERACTIVO DE VIDEO ================= */
.video-play-overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 140px;
  height: 140px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
  cursor: pointer;
}

.play-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--amber);
  color: #000;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 25px rgba(245, 132, 10, 0.6);
  transition: transform 0.2s ease;
}

.play-icon-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.video-play-overlay:hover .play-icon-circle {
  transform: scale(1.1);
}

/* ================= TRACKLIST REVERSO ================= */
.layer-tracks { padding: 18px; display: flex; flex-direction: column; color: #14110e; }
.back-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.back-eyebrow { font-size: 9px; color: var(--amber-dark); font-weight: 700; letter-spacing: 0.1em; }
.back-title { font-size: 24px; line-height: 1.05; margin-top: 2px; }
.back-ref { font-size: 10px; color: var(--muted); }
.back-close-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.08); border: none; font-size: 14px; display: grid; place-items: center; }

.back-cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cond-card { background: #fff; border: 1px solid rgba(0,0,0,0.1); padding: 6px 10px; border-radius: 6px; }
.cond-card small { display: block; font-size: 8.5px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.cond-card b { font-size: 13px; color: var(--amber-dark); }

.tracklist-container { flex: 1; overflow-y: auto; background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.track-item { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 12px; }
.track-n { color: var(--muted); width: 18px; }
.track-t { flex: 1; font-weight: 600; }
.track-l { font-size: 10px; color: var(--muted); }