/* =========================================================
   ==== MERCHANDISING (PRODUCTOS + POPUP + CARRITO) ====
   ========================================================= */

/* ==== SECCIÓN PRINCIPAL ==== */
.merch-section {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px 60px;
  text-align: left;
}
.merch-section h1 {
  color: var(--color-guitar-wood, #b38a5a);
  font-size: 2rem;
  margin-bottom: 18px;
  text-transform: uppercase;
}

/* El banner vive dentro de .merch-section pero debe ocupar todo el ancho
   y no heredar su padding/margin, igual que en el resto de páginas */
.merch-section .page-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -32px;
}
.merch-section .page-banner h1 {
  color: #fff;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .merch-section .page-banner {
    margin-top: 0;
  }
}

/* ==== GRID DE PRODUCTOS ==== */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 24px;
  max-width: 1300px;
  margin: 0 auto;
  justify-items: center;
  align-items: stretch;
}

.merch-card {
  width: 100%;
  max-width: 280px;
  min-width: 220px;
  background: #0f0f0f;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}
.merch-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

@media (max-width: 992px) {
  .merch-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 768px) {
  .merch-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .merch-grid { grid-template-columns: 1fr; }
  .merch-card { min-width: 0; }
}

/* ==== TARJETAS DE PRODUCTO ==== */
.merch-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08));
}
.merch-info {
  padding: 14px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  flex: 1;
}
.merch-info h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}
.merch-info p {
  margin: 6px 0 8px;
  color: var(--muted, #cfcfcf);
  font-size: 0.95rem;
}
.merch-price {
  font-weight: 800;
  color: var(--color-guitar-wood, #b38a5a);
  margin-top: auto;
}
.merch-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--accent, #d1a470);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.merch-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* ==== POPUP PRODUCTO ==== */
.merch-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 11000;
  padding: 20px;
}
.merch-popup.active {
  opacity: 1;
  visibility: visible;
}

.merch-popup-content {
  width: min(80vw, 620px);
  max-height: 82vh;
  background: #121212;
  border: 1px solid rgba(179, 138, 90, 0.18);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition: all 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
}
.merch-popup.active .merch-popup-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.merch-popup-img {
  width: 240px;
  flex-shrink: 0;
  background: #0c0c0c;
}
.merch-popup-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.merch-popup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 34px 34px;
  overflow-y: auto;
}
.merch-popup-eyebrow {
  font-family: var(--font-heading);
  color: var(--color-highlight, #d1a470);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.merch-popup-body h2 {
  margin: 0 0 10px;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.25;
  padding-right: 30px;
}
.merch-popup-body .merch-price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-highlight, #d1a470);
  margin-bottom: 14px;
}
.merch-popup-body p {
  margin: 0 0 16px;
  color: #bbb;
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1.6;
}
.merch-popup-note {
  font-family: var(--font-main);
  color: #888;
  font-size: 0.78rem;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}
.merch-popup-note a {
  color: var(--color-highlight, #d1a470);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.merch-popup-note a:hover {
  color: #fff;
}

/* Botón cerrar popup */
.merch-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease, background 0.3s ease;
  z-index: 20;
}
.merch-popup-close:hover {
  color: var(--color-guitar-highlight, #d1a470);
  background: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg);
}

/* Scrollbar interior */
.merch-popup-body::-webkit-scrollbar { width: 8px; }
.merch-popup-body::-webkit-scrollbar-thumb {
  background: #b38a5a;
  border-radius: 8px;
}
.merch-popup-body { scrollbar-width: thin; scrollbar-color: #b38a5a #111; }

/* ==== RESPONSIVE ==== */
@media (max-width: 700px) {
  .merch-popup-content {
    width: min(92vw, 480px);
    max-height: 88vh;
    flex-direction: column;
  }
  .merch-popup-img {
    width: 100%;
    height: 220px;
  }
  .merch-popup-body {
    padding: 24px 22px;
  }
  .merch-popup-body h2 {
    font-size: 1.15rem;
  }

  .merch-grid {
    gap: 12px;
    justify-content: center;
  }
}

/* === Uniformidad de altura con el resto de páginas === */
main {
  padding-bottom: 40px;
}

