/* ── Reset & Base ── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --orange: #FF4500;
    --orange-dark: #e03d00;
    --black: #111111;
    --gray-light: #f2f2f2;
    --gray-mid: #e0e0e0;
    --gray-text: #666;
    --white: #ffffff;
    --card-radius: 4px;
    --btn-radius: 999px;
  }
  body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--white);
    color: var(--black);
    -webkit-font-smoothing: antialiased;
  }

  /* ── HERO ── */
  .hero {
    background: url('../img/bg-header.jpg') no-repeat center/cover;
    position: relative;
    height: 260px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hero-mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    opacity: 0.45;
  }
  .hero-mosaic .tile {
    overflow: hidden;
  }
  .hero-mosaic .tile-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: saturate(0.6);
  }
  .hero-overlay {
    position: absolute;
    inset: 0;
    /*background: linear-gradient(135deg, rgba(0,0,0,0.72) 0%, rgba(20,20,20,0.78) 100%);*/
  }
  .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    padding: 0 16px;
  }
  .hero-logo {
    position: relative;
    z-index: 2;
    text-align: center;
    line-height: 1;
    user-select: none;
    margin: 0;
    display: inline-block;
  }
  .hero-tagline {
    position: relative;
    z-index: 2;
    margin: 16px auto 0;
    max-width: 640px;
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0.92;
  }
  .hero-logo .lazy { display: block; font-size: 3rem; font-weight: 900; color: var(--orange); letter-spacing: -1px; text-transform: uppercase; }
  .hero-logo .bar { display: block; width: 100%; height: 10px; background: var(--orange); margin: 2px 0; }
  .hero-logo .it { display: block; font-size: 3rem; font-weight: 900; color: var(--orange); letter-spacing: -1px; text-transform: uppercase; }
  .hero-logo .is { display: block; font-size: 1.4rem; font-weight: 900; color: var(--white); letter-spacing: 2px; text-transform: uppercase; text-align: right; }
  .hero-logo .discos { display: block; font-size: 1.1rem; font-weight: 700; color: var(--white); letter-spacing: 6px; text-transform: uppercase; text-align: right; }

  /* ── MAIN CONTENT ── */
  .main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 64px;
  }

  /* ── SEARCH ── */
  .search-wrap {
    text-align: center;
    margin-bottom: 28px;
  }
  .search-wrap p {
    font-size: 0.95rem;
    color: var(--gray-text);
    margin-bottom: 12px;
    font-weight: 700;
  }
  .stock-line {
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--black);
    text-transform: uppercase;
  }
  .stock-line #stockNum,
  .stock-line .stock-word { color: var(--orange); }
  .search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 540px;
  }
  .search-box input {
    width: 100%;
    padding: 12px 44px 12px 18px;
    border: 1.5px solid var(--gray-mid);
    border-radius: var(--btn-radius);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
    color: var(--black);
  }
  .search-box input::placeholder { color: #aaa; }
  .search-box input:focus { border-color: var(--orange); }
  .search-box .search-icon {
    position: absolute;
    right: 14px;
    color: #aaa;
    pointer-events: none;
  }

  /* ── GENRE FILTERS ── */
  .genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 auto 32px;
    max-width: 1200px;
    justify-content: center;
  }
  .genre-btn {
    background-color: #EBEBEB;
    padding: 8px 16px;
    border: none;
    border-bottom: 4px solid transparent;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: var(--black);
    line-height: 1.3;
    text-align: center;
    margin-bottom: 8px;
  }
    
    .genre-btn:hover,
    .genre-btn.active {
        background: var(--orange);
        border-color: var(--orange);
        border-bottom: 4px solid #000;
        color: #000;
    }

  /* ── COUNTER ── */
  .count-bar {
    text-align: center;
    margin-bottom: 28px;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--black);
    letter-spacing: -0.01em;
  }
  .count-bar span { color: var(--orange); }

  /* ── GRID ── */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }

  /* ── CARD ── */
  .card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
  }
    .card-inner{
        border: 1.5px solid var(--gray-mid);
        border-radius: var(--card-radius);
        padding: 10px;
    }
    .card:hover { 
        transform: translateY(-2px); 
    }
    .card:hover .card-inner{
        border-color: var(--orange);
    }

  .card-artist {
    padding: 10px 12px 4px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #808080;
  }
  .card-album {
    padding: 0 12px 8px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--black);
  }
  .card-album .version {
    font-weight: 700;
    color: #555;
  }

  .card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    flex-shrink: 0;
  }
  .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
  }
  .cover-placeholder .initials {
    font-size: 2.8rem;
    font-weight: 900;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -2px;
  }
  .cover-placeholder .album-short {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    text-align: center;
    line-height: 1.4;
  }
  /* ── Pronto en Stock ── */
  .card--pronto {
    cursor: default;
  }
  .card--pronto:hover {
    box-shadow: none;
    transform: none;
  }
  .pronto-bar {
    display: block;
    width: 100%;
    padding: 11px 12px;
    background: var(--orange);
    color: var(--white);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .card-footer {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
  }
  .card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .price-badge {
    background: var(--black);
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }
  .edition-text {
    font-size: 0.68rem;
    color: var(--gray-text);
    line-height: 1.35;
  }
  .btn-quiero {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: var(--btn-radius);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
    margin-top: auto;
  }
  .btn-quiero:hover { background: var(--orange); }

  /* ── EMPTY STATE ── */
  .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 16px;
    color: var(--gray-text);
  }
  .empty-state svg { opacity: 0.25; margin-bottom: 16px; }
  .empty-state p { font-size: 1rem; }

  /* ── MODAL ── */
  .modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: var(--white);
    border-radius: 6px;
    max-width: 640px;
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-cover {
    width: 260px;
    min-width: 260px;
    aspect-ratio: 1;
    flex-shrink: 0;
    overflow: hidden;
  }
  .modal-cover img { width: 100%; height: 100%; object-fit: cover; }
  .modal-cover .cover-placeholder {
    width: 100%;
    height: 100%;
  }
  .modal-info {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
  }
  .modal-artist {
    border-bottom: 1px solid #dedede;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #808080;
  }
  .modal-album {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--black);
  }
  .modal-version {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 3px;
        color: var(--orange);
    text-transform: uppercase;
  }
  .modal-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--black);
    letter-spacing: -0.02em;
  }
  .modal-edition {
    font-size: 0.8rem;
    color: var(--gray-text);
    line-height: 1.5;
  }
  .modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .genre-tag {
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--gray-mid);
    padding: 3px 8px;
    border-radius: 99px;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  /* ── Modal action buttons (WhatsApp + Messenger) ── */
  .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
        margin-top: 10px;
  }
  .modal-actions-label {
    border-bottom: 1px solid #dedede;
    font-size: 0.9rem;
    color: #000;
    margin-bottom: 2px;
  }
  .modal-actions > a { flex: unset; }
  .modal-actions-btns {
    display: flex;
    gap: 10px;
  }
  .modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 10px;
    border-radius: var(--btn-radius);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.12s;
    white-space: nowrap;
  }
  .modal-btn:hover { opacity: 0.88; transform: translateY(-1px); }
  .modal-btn--wa  { background: #25D366; color: #fff; }
  .modal-btn--ms  { background: #0084FF; color: #fff; }
  .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: #fff;
    transition: background 0.15s;
    z-index: 10;
  }
  .modal-close:hover { background: #fff; color: #000 }

  /* ── Géneros: toggle oculto en desktop ── */
  .genres-toggle { display: none; }

  /* ── Responsive ── */
  @media (max-width: 600px) {
    .hero { height: 200px; }
    .hero-logo .lazy, .hero-logo .it { font-size: 2.2rem; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .modal { flex-direction: column; }
    .modal-cover { width: 100%; min-width: unset; aspect-ratio: 1; }

    /* Acordeón de géneros */
    .genres-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 12px 16px;
      background: var(--white);
      border: 1.5px solid var(--gray-mid);
      border-radius: var(--card-radius);
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--black);
      cursor: pointer;
      margin-bottom: 8px;
    }
    .genres-chevron {
      transition: transform 0.2s;
      flex-shrink: 0;
    }
    .genres-toggle.open .genres-chevron { transform: rotate(180deg); }
    /* "Filtrar por estilo" activo = viendo todo el catálogo. */
    .genres-toggle.active {
      background: var(--orange);
      border-color: var(--orange);
      color: #000;
    }

    .genres {
      display: none;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 16px;
    }
    .genres.open { display: flex; }
    .genre-btn { text-align: left; }
    /* En móvil "Catálogo Completo" va 2º, justo debajo de "Novedades".
       (En desktop el orden lo da el array GENRES en main.js.) */
    /* "Catálogo Completo" se muestra como opción, pero SIN estado activo (naranja):
       ese estado lo lleva la barra "Filtrar por estilo". */
    .genre-btn[data-genre="Catálogo Completo"] { order: -2; }
    .genre-btn[data-genre="Novedades"] { order: -1; }
    .genre-btn[data-genre="Catálogo Completo"].active {
      background: #EBEBEB;
      border-color: transparent;
      border-bottom: 4px solid transparent;
      border-left: none;
      color: var(--black);
    }
    .genre-btn.active {
      border-left: 3px solid var(--orange);
    }

    /* Card footer: descripción arriba full-width, precio abajo */
    .card-price-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }
    .edition-text { width: 100%; order: -1; }
    .price-badge  { order: 0; }
    .card-footer{
        padding: 10px 0 12px;
    }

    .genres-wrap{
        margin-bottom: 20px;
    }
    .card-artist{
        font-size: 0.9rem;
        /*min-height: 50px;*/
    }
    .edition-text{
        font-size: 0.9rem;
    }

  }
/* ── Loading state ── */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 16px;
  color: var(--gray-text);
}
.loading-state p { margin-top: 16px; font-size: 0.95rem; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-mid);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Infinite scroll sentinel ── */
#sentinel {
  text-align: center;
  padding: 32px 0 48px;
}
