/* =========================================================
   Listado de productos (Productos.html) y Aportes.html
   ========================================================= */

.products-page { padding: 60px 0 90px; }
.products-page h1 { font-size: 2.4rem; text-align: center; margin-bottom: 10px; }
.page-intro { text-align: center; color: var(--texto-2); max-width: 720px; margin: 0 auto; }

/* Filtros */
.products-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 36px 0 46px; }
.filter-btn {
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; background: var(--gris-1); color: #fff;
  border: 1px solid var(--borde-campo);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover { background: var(--gris-2); border-color: #fff; }
.filter-btn[aria-pressed="true"], .filter-btn.active { background: var(--rojo); border-color: var(--rojo); }

.filtro-vacio { text-align: center; color: var(--texto-2); margin: 20px 0; }

/* Secciones por categoría */
.product-section { margin-bottom: 60px; }
.product-section h2 { font-size: 1.6rem; margin-bottom: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--borde); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px; }

/* Tarjeta */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--gris-1); border: 1px solid transparent; border-radius: 18px; padding: 22px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.product-card:hover { background: var(--gris-2); border-color: var(--borde); transform: translateY(-4px); }
.product-card > img { width: 100%; height: 200px; object-fit: contain; margin-bottom: 18px; border-radius: 12px; background: #0b0b0b; }
.product-card h3 { font-size: 1.12rem; margin-bottom: 8px; text-align: center; }
.product-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }  /* toda la tarjeta es clicable */
.product-card p { font-size: 0.95rem; color: var(--texto-2); margin-bottom: 14px; text-align: center; flex: 1; }
.product-meta { display: block; text-align: center; font-size: 0.85rem; color: var(--texto-3); margin-bottom: 14px; }
.product-card .btn-product {
  display: block; width: 100%; padding: 12px 0; text-align: center;
  background: var(--rojo); border-radius: 999px; color: #fff; font-weight: 600;
}
.product-card:hover .btn-product { background: var(--rojo-hover); }
.product-card .product-links { margin-top: 12px; text-align: center; }
.product-card .product-links a { display: inline-block; margin: 6px 10px; font-size: 0.9rem; color: var(--rojo-texto); font-weight: 600; }

/* ---------- Mini carrusel en tarjeta (Aportes) ---------- */
.card-carousel { position: relative; width: 100%; height: 200px; margin-bottom: 20px; border-radius: 12px; overflow: hidden; cursor: pointer; }
.card-carousel-track { display: flex; height: 100%; transition: transform 0.35s ease; }
.card-carousel-slide { flex: 0 0 100%; height: 100%; }
.card-carousel-slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; background: #0a0a0a; }
.card-carousel-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 2; }
.card-carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.45); }
.card-carousel-dot.active { background: #fff; }
.card-carousel-zone { position: absolute; top: 0; height: 100%; width: 50%; z-index: 3; }
.card-carousel-zone.left { left: 0; }
.card-carousel-zone.right { right: 0; }
.card-carousel-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); font-size: 0.72rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; z-index: 2; }
.card-carousel-zoom { position: absolute; bottom: 8px; right: 8px; width: 28px; height: 28px; background: rgba(0,0,0,0.6); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 4; cursor: zoom-in; }
.card-carousel-zoom svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; }

/* Visor del mini carrusel (Aportes) */
#lightbox { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.95); }
#lightbox.active { display: flex; }
#lightbox .lightbox-overlay { position: absolute; inset: 0; }
#lightbox .lightbox-inner { position: relative; z-index: 1; max-width: 90vw; max-height: 90vh; }
#lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
#lightbox .lightbox-close, #lightbox .lightbox-prev, #lightbox .lightbox-next {
  position: fixed; z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); color: #fff; border: 1px solid rgba(255,255,255,0.35); font-size: 24px; cursor: pointer;
}
#lightbox .lightbox-close { top: 18px; right: 18px; }
#lightbox .lightbox-prev { left: 18px; top: 50%; }
#lightbox .lightbox-next { right: 18px; top: 50%; }

@media (max-width: 600px) {
  .products-page { padding: 40px 0 70px; }
  .products-page h1 { font-size: 1.9rem; }
  .product-card { padding: 18px; }
  .product-card > img { height: 170px; }
}
