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

:root {
  --red:       #d41515;
  --red-light: #fef0f0;
  --wa:        #25d366;
  --wa-dark:   #1da851;
  --ml:        #ffe600;
  --ml-dark:   #f0d800;
  --text:      #111111;
  --muted:     #888;
  --border:    #e5e5e5;
  --bg:        #ffffff;
  --surface:   #f7f7f7;
  --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.logo-name {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--text);
}
.logo-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 500;
}

.search-wrap {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#search::placeholder { color: #bbb; }
#search:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(212,21,21,.07);
  background: #fff;
}

/* ── Banner descuento ─────────────────────────────────────────────────────── */
.discount-banner {
  background: #f2fbf6;
  border-bottom: 1px solid #c8e8d8;
}
.discount-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.discount-text {
  font-size: 12.5px;
  color: #1a5c38;
  flex: 1;
  min-width: 200px;
}
.discount-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-wa-banner, .btn-mail-banner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  font-family: var(--font-body);
}
.btn-wa-banner svg, .btn-mail-banner svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-wa-banner   { background: var(--wa);  color: #fff; }
.btn-mail-banner { background: var(--red); color: #fff; }
.btn-wa-banner:hover, .btn-mail-banner:hover { opacity: .85; }

/* ── Filtros ──────────────────────────────────────────────────────────────── */
.filters-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 69px;
  z-index: 99;
}
.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-group select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 6px 28px 6px 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: var(--surface);
}
.filter-group select:focus { border-color: var(--red); }

.btn-reset {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-reset:hover { border-color: var(--red); color: var(--red); }

.result-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .3px;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 24px 20px;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  cursor: default;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Imagen — clickeable para abrir detalle */
.card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}

/* Badge "Nuevo" */
.badge-new {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--wa);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.card-img-inner {
  width: 100%;
  height: 100%;
  background: center/cover no-repeat var(--surface);
  transition: transform .4s ease;
}
.card-img-wrap:hover .card-img-inner { transform: scale(1.04); }

.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-placeholder svg { width: 48px; height: 48px; opacity: .12; }

.card-body {
  padding: 10px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.card-artist {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
  word-break: break-word;
}
.card-artist:hover { color: var(--red); }
.card-album {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.35;
  margin-top: 2px;
  word-break: break-word;
}
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 10px;
}
.card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.card-year {
  font-size: 11px;
  color: var(--muted);
}

/* Botones en la card */
.card-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.btn-card-direct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--wa);
  color: #fff;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: background .15s;
  text-decoration: none;
}
.btn-card-direct:hover { background: var(--wa-dark); }
.btn-card-direct svg { width: 13px; height: 13px; flex-shrink: 0; }

.btn-card-ml {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  background: var(--ml);
  color: #333;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: background .15s;
  text-decoration: none;
}
.btn-card-ml:hover { background: var(--ml-dark); }

/* ── Load more ────────────────────────────────────────────────────────────── */
.load-more-wrap {
  text-align: center;
  padding: 48px 0 16px;
}
.btn-load-more {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 40px;
  cursor: pointer;
  letter-spacing: .3px;
  transition: border-color .2s, color .2s;
}
.btn-load-more:hover { border-color: var(--text); }

/* ── Loading dots ─────────────────────────────────────────────────────────── */
.loading-indicator {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 24px;
}
.loading-indicator span {
  width: 7px; height: 7px;
  background: var(--border);
  border-radius: 50%;
  animation: bounce .9s infinite;
}
.loading-indicator span:nth-child(2) { animation-delay: .15s; }
.loading-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50%       { transform: translateY(-5px); opacity: 1; }
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover;
}
.footer-brand-text { display: flex; flex-direction: column; gap: 2px; }
.footer-brand-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.footer-brand-tagline {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .4px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.footer-contact a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  transition: color .15s;
}
.footer-contact a:hover { color: var(--text); }
.footer-contact svg { width: 15px; height: 15px; flex-shrink: 0; }

.footer-copy {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-discount-note {
  font-size: 12px;
  color: var(--wa-dark);
  font-weight: 600;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 860px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  animation: modal-in .22s ease;
  margin: auto;
}
@keyframes modal-in {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-gallery {
  display: flex;
  background: #f0f0f0;
  overflow-x: auto;
  max-height: 380px;
  scrollbar-width: thin;
}
.modal-gallery img {
  height: 380px;
  width: auto;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.modal-gallery-placeholder {
  width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.modal-gallery-placeholder svg { width: 80px; height: 80px; opacity: .1; }

.modal-info {
  padding: 30px 36px 40px;
}

.modal-artist {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.modal-title {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  padding-right: 40px;
  margin-bottom: 16px;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.modal-tags span {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  background: var(--surface);
  font-weight: 500;
}

.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
}
.modal-price {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.modal-price-direct {
  font-size: 14px;
  color: var(--wa-dark);
  font-weight: 600;
}

/* CTA compra directa */
.modal-cta-direct {
  background: #f3fdf7;
  border: 1.5px solid #b6e8cc;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.cta-label {
  font-size: 13px;
  color: #1a5c38;
  margin-bottom: 14px;
  font-weight: 500;
}
.cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-wa, .btn-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  flex: 1;
  min-width: 160px;
  border: none;
  text-decoration: none;
}
.btn-wa:hover, .btn-mail:hover { opacity: .88; transform: translateY(-1px); }
.btn-wa   { background: var(--wa);  color: #fff; }
.btn-mail { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-wa svg, .btn-mail svg { width: 17px; height: 17px; flex-shrink: 0; }

.modal-separator {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: #bbb;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.modal-separator::before, .modal-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 44px);
  height: 1px;
  background: var(--border);
}
.modal-separator::before { left: 0; }
.modal-separator::after  { right: 0; }

.btn-ml-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--ml);
  color: #333;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s;
  margin-bottom: 28px;
  text-decoration: none;
}
.btn-ml-modal:hover { background: var(--ml-dark); }

/* Condición Goldmine */
.modal-condition {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.condition-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
}
.condition-item .c-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 10px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.condition-item .c-value {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}

.modal-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.75;
  white-space: pre-wrap;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  max-height: 200px;
  overflow-y: auto;
}
.modal-desc:empty { display: none; }

/* ── Discos relacionados ──────────────────────────────────────────────────── */
.modal-related {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.modal-related-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.related-card {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--bg);
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.related-card-img {
  aspect-ratio: 1 / 1;
  background: center/cover no-repeat var(--surface);
}
.related-card-img.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.related-card-img.card-placeholder svg { width: 32px; height: 32px; opacity: .1; }
.related-card-info {
  padding: 7px 8px 9px;
}
.related-card-artist {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.related-card-album {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.related-card-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-top: 5px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 14px; }
}
@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; gap: 12px; }
  .logo-sub { display: none; }
  .discount-inner { padding: 8px 16px; }
  .filters-inner { padding: 8px 16px; gap: 8px; }
  .filters-bar { top: 66px; }
  .main-content { padding: 20px 14px 40px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .modal-info { padding: 20px 20px 28px; }
  .modal-title { font-size: 20px; }
  .modal-gallery img { height: 260px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-contact { align-items: flex-start; }
  .result-count { display: none; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .card-grid { gap: 12px 8px; }
  .cta-buttons { flex-direction: column; }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
