/* product.css — ficha de línea. Solo en single-producto.php. */

/* ---------- Hero ---------- */
.product-hero {
  background: var(--color-surface);
  padding-block: var(--space-6) var(--space-7);
}
.product-hero__grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}
@media (min-width: 1024px) {
  .product-hero__grid {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-8);
  }
}
.product-hero__chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.product-hero__title {
  margin-bottom: var(--space-2);
}
.product-hero__tagline {
  font-size: var(--fs-lg);
  color: var(--color-muted);
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.product-hero__excerpt {
  color: var(--color-text);
}
.product-hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.product-hero__facts > div {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}
.product-hero__facts dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  font-weight: 600;
}
.product-hero__facts dd {
  margin: var(--space-1) 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--color-primary);
}
.product-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.product-hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

/* ---------- Tabla ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.specs-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.specs-table th,
.specs-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.specs-table thead th {
  background: var(--color-surface);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--color-muted);
  white-space: nowrap;
}
.specs-table tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}
.specs-table tbody tr:last-child th,
.specs-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- Beneficios ---------- */
.product-benefits__list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .product-benefits__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .product-benefits__list {
    grid-template-columns: repeat(3, 1fr);
  }
}
.product-benefits__item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.product-benefits__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
.product-benefits__icon .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Aplicaciones ---------- */
.product-apps__list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .product-apps__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.product-apps__link {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  min-height: var(--tap);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.product-apps__link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-1);
  color: var(--color-text);
}
.product-apps__link img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex: none;
}
.product-apps__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.product-apps__text strong {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}
.product-apps__text span {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

/* ---------- Galería ---------- */
.swiper {
  overflow: hidden;
}
.swiper:not(.swiper-initialized) .swiper-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.swiper:not(.swiper-initialized) .swiper-slide {
  flex: 0 0 90%;
  scroll-snap-align: start;
}
.product-gallery__slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.swiper-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.swiper-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-primary);
}
.swiper-btn:hover {
  background: var(--color-primary);
  color: #fff;
}
.swiper-btn .icon {
  width: 20px;
  height: 20px;
}
.icon--flip {
  transform: scaleX(-1);
}
.swiper-controls .swiper-pagination {
  position: static;
  width: auto;
  display: flex;
  gap: var(--space-2);
}
.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 !important;
  background: var(--color-border);
  opacity: 1;
}
.swiper-pagination-bullet-active {
  background: var(--color-primary);
  width: 24px;
  border-radius: 4px;
}

/* ---------- Relacionados ---------- */
.product-related__grid {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 640px) {
  .product-related__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.product-related__grid > div {
  display: flex;
}
.product-related__grid .card {
  width: 100%;
}
.product-card__chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.product-card__tagline {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}
.product-card__meta {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.product-card__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-accent-text);
}
.product-card__more .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Ajustes de revisión UX ---------- */
/* Alternancia de fondos según las secciones que realmente se pintan */
.product > .section:nth-of-type(even):not(.section--dark) {
  background: var(--color-surface);
}
/* Chips del hero enlazados */
.chip--link {
  min-height: 36px;
  text-decoration: none;
}
.chip--link:hover {
  background: var(--color-primary);
  color: #fff;
}
/* Datos: tarjetas que no se estiran; nota de garantía */
.product-hero__facts {
  grid-template-columns: repeat(auto-fill, minmax(140px, 200px));
}
.product-hero__note {
  font-size: var(--fs-sm);
  color: var(--color-muted);
  margin: calc(-1 * var(--space-3)) 0 var(--space-5);
}
/* En móvil el CTA va antes que la descripción larga (ya está en el marcado); en escritorio la descripción sube */
@media (min-width: 1024px) {
  .product-hero__body {
    display: flex;
    flex-direction: column;
  }
  .product-hero__body > .product-hero__chips { order: 1; }
  .product-hero__body > .product-hero__title { order: 2; }
  .product-hero__body > .product-hero__tagline { order: 3; }
  .product-hero__body > .product-hero__excerpt { order: 4; }
  .product-hero__body > .product-hero__facts { order: 5; }
  .product-hero__body > .product-hero__note { order: 6; }
  .product-hero__body > .product-hero__actions { order: 7; }
}
/* Tabla: cifras alineadas a la derecha, sin hover de fila */
.specs-table td,
.specs-table thead th:not(:first-child) {
  text-align: right;
}
.specs-table tbody tr:hover {
  background: transparent;
}
.specs-table caption {
  caption-side: top;
}

/* Negritas en los conceptos clave de la introducción */
.product-hero__excerpt strong {
  font-weight: 600;
  color: var(--color-text);
}

/* Cintas de datos (Luz visible, Rechazo UV, Garantía): entran en cadena con un fundido de enfoque. */
@media (prefers-reduced-motion: no-preference) {
  .product-hero__facts > div {
    animation: fact-in 550ms var(--ease-out) backwards;
    animation-delay: calc(var(--n, 0) * 90ms + 350ms);
  }
  .product-hero__facts > div:nth-child(2) { --n: 1; }
  .product-hero__facts > div:nth-child(3) { --n: 2; }
  .product-hero__facts > div:nth-child(4) { --n: 3; }
  @keyframes fact-in {
    from {
      opacity: 0;
      transform: translateY(14px);
      filter: blur(5px);
    }
  }
}
