/* Catalogo de productos WiXArt */

.products-store {
  padding-top: var(--sp-8);
}

.section-head--left {
  text-align: left;
  max-width: 760px;
  margin: 0 0 var(--sp-6);
}

.section-head--left .section-subtitle {
  margin-left: 0;
  margin-right: 0;
}

.product-store__shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

/* Las tres estanterías por categoría (Aplicaciones, Plataformas, Juegos)
   que productos.js rellena moviendo las tarjetas ya renderizadas. Cada
   `.product-store__shelf` ya trae su propio margin-bottom; el label solo
   necesita un poco más de aire por debajo antes de sus tarjetas. */
.product-group__label {
  margin-bottom: var(--sp-3);
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 340px;
  overflow: hidden;
  color: var(--text-primary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  transition: transform var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.product-card:hover,
.product-card:focus-visible,
.product-card[aria-current="true"] {
  transform: translateY(-4px);
  border-color: var(--glass-border-h);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.product-card:focus-visible {
  outline: 3px solid rgba(111, 255, 147, 0.32);
  outline-offset: 3px;
}

.product-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(36, 113, 231, 0.24), rgba(111, 255, 147, 0.12));
  overflow: hidden;
}

.product-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(6, 14, 29, 0.46));
  pointer-events: none;
}

.product-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
}

.product-card__topline {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.product-card__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.product-card__icon img {
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
  display: block;
}

.product-card__name {
  display: block;
  font-size: var(--fs-lg);
  line-height: 1.2;
}

.product-card__category {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  line-height: 1.3;
}

.product-card__tagline {
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: var(--fs-sm);
}

.product-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.product-card__meta span,
.product-detail__badges span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-full);
}

/* ── Modal overlay ── */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.product-modal[hidden] {
  display: none;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 22, 0.82);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.product-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  max-height: calc(100dvh - var(--sp-8));
  overflow-y: auto;
  border-radius: var(--radius-xl);
  background: var(--surface-card, #0e1829);
  border: 1px solid var(--glass-border);
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
  scroll-behavior: smooth;
}

.product-modal__close {
  position: sticky;
  top: var(--sp-3);
  float: right;
  margin: var(--sp-3) var(--sp-3) calc(-1 * var(--sp-3) - 28px) 0;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s;
}

.product-modal__close:hover {
  background: rgba(255,255,255,0.18);
}

/* ── Product detail (inside modal) ── */
.product-detail-list {
  padding: var(--sp-2);
}

.product-detail {
  display: none;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  padding: var(--sp-5);
}

.product-detail.is-active {
  display: grid;
}

.product-detail:focus {
  outline: none;
}

@media (min-width: 980px) {
  .product-detail {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: var(--sp-5);
    padding: var(--sp-6);
  }
}

.product-detail__main {
  min-width: 0;
}

.product-detail__header {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-3);
}

.product-detail__icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.product-detail__kicker {
  color: var(--blue-light);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin: 0 0 4px;
}

.product-detail__title {
  font-size: clamp(var(--fs-2xl), 3vw, var(--fs-4xl));
  line-height: 1.08;
  margin: 0;
  letter-spacing: 0;
}

.product-detail__tagline {
  color: var(--text-secondary);
  margin: 8px 0 0;
  line-height: 1.45;
}

.product-detail__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.product-detail__description {
  color: var(--text-secondary);
  font-size: var(--fs-lg);
  line-height: 1.65;
  margin: 0 0 var(--sp-4);
  max-width: 820px;
}

.product-screenshots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 46%);
  gap: var(--sp-3);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scroll-snap-type: x mandatory;
}

.product-screenshot {
  margin: 0;
  scroll-snap-align: start;
}

.product-screenshot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.product-screenshot figcaption {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  line-height: 1.4;
  margin-top: 8px;
}

.product-detail__aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.product-detail__panel {
  padding: var(--sp-3);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

.product-detail__panel h3 {
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-2);
}

.product-info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.product-info-list div {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 10px;
}

.product-info-list dt {
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.product-info-list dd {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.4;
  margin: 0;
}

.product-feature-list {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.product-feature-list li {
  position: relative;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.45;
  padding-left: 24px;
}

.product-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 14px rgba(111, 255, 147, 0.45);
}

.product-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.product-card--green .product-card__cover,
.product-detail--green .product-detail__icon {
  background: linear-gradient(135deg, rgba(111, 255, 147, 0.24), rgba(36, 113, 231, 0.16));
}

.product-card--purple .product-card__cover,
.product-detail--purple .product-detail__icon {
  background: linear-gradient(135deg, rgba(123, 92, 240, 0.32), rgba(36, 113, 231, 0.16));
}

.product-card--amber .product-card__cover,
.product-detail--amber .product-detail__icon {
  background: linear-gradient(135deg, rgba(255, 190, 84, 0.26), rgba(111, 255, 147, 0.12));
}

.product-card--rose .product-card__cover,
.product-detail--rose .product-detail__icon {
  background: linear-gradient(135deg, rgba(255, 107, 139, 0.24), rgba(123, 92, 240, 0.18));
}

@media (max-width: 720px) {
  .products-store {
    padding-top: var(--sp-5);
  }

  .product-store__shelf {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: 0;
  }

  .product-detail {
    padding: var(--sp-3);
  }

  .product-detail__header {
    grid-template-columns: 56px 1fr;
  }

  .product-detail__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .product-screenshots {
    grid-auto-columns: minmax(230px, 86%);
  }

  .product-info-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
