/* ADV Technology — Páginas de detalle de producto */

/* ── Page hero ──────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: calc(var(--nav-h) + 3rem) 0 3.5rem;
}
.page-hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-block: 1rem .75rem;
}
.page-hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  max-width: 600px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
}
.breadcrumb a { color: rgba(255,255,255,.65); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb i { font-size: .6rem; }
.breadcrumb span { color: var(--white); }

/* ── Badge de modelo ─────────────────────────────── */
.product-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  margin-bottom: .75rem;
}

/* ── Layout principal producto ──────────────────── */
.producto-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: start;
}

/* ── Galería con slider ──────────────────────────── */
.producto-gallery {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Visor principal */
.gallery-slider {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  user-select: none;
  border: 1px solid var(--gray-100);
}

/* Slides: apilados por encima uno del otro */
.gallery-slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;              /* respiro para que la imagen no toque el borde */
}
.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;        /* imagen completa, sin recorte */
  display: block;
}

/* Estado de error de imagen */
.gallery-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-300);
  gap: 1rem;
  font-size: .9rem;
}
.gallery-error i { font-size: 3rem; }

/* Botones prev / next */
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  color: var(--blue-dark);
  font-size: .9rem;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  opacity: 0;                       /* ocultos; aparecen al hover del slider */
}
.gallery-slider:hover .gallery-btn,
.gallery-slider:focus-within .gallery-btn {
  opacity: 1;
}
.gallery-btn--prev { left: .75rem; }
.gallery-btn--next { right: .75rem; }
.gallery-btn:hover {
  background: var(--white);
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  transform: translateY(-50%) scale(1.08);
}
.gallery-btn:active { transform: translateY(-50%) scale(.96); }

/* Contador "1 / 4" */
.gallery-counter {
  position: absolute;
  bottom: .75rem;
  right: .85rem;
  background: rgba(0,0,0,.48);
  color: var(--white);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .2rem .55rem;
  border-radius: 100px;
  line-height: 1.6;
  pointer-events: none;
}

/* Miniaturas */
.gallery-thumbs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;          /* espacio para scrollbar en mobile */
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

.gallery-thumb {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--white);
  border-color: var(--gray-100);
  padding: .2rem;             /* pequeño respiro igual que el visor */
  transition: border-color var(--transition), opacity var(--transition);
  opacity: .65;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;        /* sin recorte en las miniaturas tampoco */
  display: block;
}
.gallery-thumb:hover { opacity: .88; }
.gallery-thumb.active {
  border-color: var(--orange);
  opacity: 1;
}

/* Placeholder (compat — cuando no hay slider) */
.producto-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-300);
  gap: 1rem;
  font-size: .9rem;
}
.producto-gallery-placeholder i { font-size: 3rem; }

/* ── Sidebar / Ficha rápida ─────────────────────── */
.producto-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.producto-card-info {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border-top: 4px solid var(--orange);
}
.producto-card-info h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
}
.producto-spec-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: 1.5rem;
}
.producto-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: .875rem;
}
.producto-spec-item:last-child { border-bottom: none; }
.producto-spec-item .spec-label { color: var(--gray-500); }
.producto-spec-item .spec-val   { font-weight: 600; color: var(--gray-900); text-align: right; }

.producto-cta-group {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.btn-full { width: 100%; justify-content: center; }

/* ── Specs table completa ───────────────────────── */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.specs-table th,
.specs-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}
.specs-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  font-family: var(--font-head);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.specs-table tr:last-child td { border-bottom: none; }
.specs-table tbody tr:hover { background: var(--gray-50); }
.specs-table td:first-child { color: var(--gray-500); width: 45%; }
.specs-table td:last-child  { color: var(--gray-900); font-weight: 500; }

/* ── Aplicaciones del modelo ────────────────────── */
.modelo-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.modelo-app-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-700);
}
.modelo-app-item i { color: var(--orange); font-size: 1rem; flex-shrink: 0; }

/* ── Modelos relacionados ───────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.related-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.related-card-label { font-size: .72rem; color: var(--gray-300); text-transform: uppercase; letter-spacing: .08em; }
.related-card-name  { font-family: var(--font-head); font-weight: 700; color: var(--gray-900); font-size: .95rem; }
.related-card-area  { font-size: .82rem; color: var(--gray-500); }
.related-card a     { margin-top: .5rem; font-size: .82rem; color: var(--orange); font-weight: 600; }
.related-card a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .producto-layout { grid-template-columns: 1fr; }
  .producto-sidebar { position: static; }
  .producto-card-info { margin-top: 0; }
}

@media (max-width: 768px) {
  .modelo-apps-grid { grid-template-columns: 1fr 1fr; }
  .related-grid     { grid-template-columns: 1fr 1fr; }
  .specs-table td:first-child { width: 50%; }

  /* Slider: botones siempre visibles en touch */
  .gallery-btn { opacity: 1; }
  .gallery-thumb { width: 3.75rem; height: 3.75rem; }
}

@media (max-width: 640px) {
  .specs-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .modelo-apps-grid { grid-template-columns: 1fr; }
  .related-grid     { grid-template-columns: 1fr; }

  .gallery-thumb { width: 3.25rem; height: 3.25rem; }
}
