/* Página: detalle de producto */

.section {
  padding-block: 3rem;
}

/* ===== Breadcrumb ===== */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 1.5rem 0 0;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb span.sep {
  opacity: 0.5;
}

.breadcrumb span.current {
  color: var(--ink);
}

/* ===== Detalle de producto ===== */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 3rem;
  padding: 2rem 0 1rem;
  align-items: flex-start;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-main {
  border-radius: var(--radius-lg);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.gallery-main .discount-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

.gallery-main:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.gallery-main .discount-badge {
  z-index: 2;
}

/* Carrusel: una imagen por "página", se desliza con el dedo (scroll-snap) */
.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* el zoom elegido en el panel no se sale de su lugar */
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 15, 18, 0.72);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.gallery-nav svg {
  width: 24px;
  height: 24px;
}

.gallery-nav.is-prev {
  left: 12px;
}

.gallery-nav.is-next {
  right: 12px;
}

.gallery-nav:hover {
  background: rgba(59, 130, 246, 0.85);
  border-color: var(--blue);
}

.gallery-nav:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 15, 18, 0.55);
}

.gallery-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

.gallery-dots button[aria-current="true"] {
  width: 20px;
  background: var(--blue);
}

/* En compu las flechas aparecen al pasar el mouse; en celular siempre */
@media (hover: hover) and (pointer: fine) {
  .gallery-main .gallery-nav {
    opacity: 0;
  }
  .gallery-main:hover .gallery-nav,
  .gallery-main:focus-within .gallery-nav {
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .gallery-nav {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.thumb {
  font: inherit;
  color: inherit;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.thumb.is-active {
  border-color: var(--blue);
}

/* ===== Info del producto ===== */

.product-info {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.brand-line .sku {
  opacity: 0.7;
}

.product-info h1 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.rating .stars {
  display: flex;
  gap: 2px;
  color: var(--blue);
}

.rating .stars svg {
  width: 16px;
  height: 16px;
}

.rating a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.rating a:hover {
  color: var(--ink);
}

.price-block {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.price-block .prices {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.price-block .prices .dashed {
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: rgba(160, 165, 172, 0.6);
}

.price-block .prices .priceNow {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
}

.price-block .prices .priceNow::before {
  content: "$";
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-right: 2px;
}

.price-block .cuotas {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  width: fit-content;
}

.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}

.variant-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.variant-block .label {
  font-size: 13px;
  color: var(--ink-soft);
}

.variant-block .label strong {
  color: var(--ink);
  font-weight: 600;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.chip:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip.is-selected {
  border-color: var(--blue);
  color: var(--ink);
  background: rgba(59, 130, 246, 0.1);
}

.purchase-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.shipping-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.shipping-info li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.shipping-info svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.shipping-info strong {
  color: var(--ink);
}

/* ===== Tabs ===== */

.tabs {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.tab-nav {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 1.1rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.is-active {
  color: var(--ink);
  border-color: var(--blue);
}

.tab-panel {
  display: none;
  padding: 2rem 0;
  max-width: 820px;
}

.tab-panel.is-active {
  display: block;
}

.tab-panel p {
  color: var(--ink-soft);
  font-size: 15px;
}

.tab-panel ul.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
}

.tab-panel ul.check-list li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.tab-panel ul.check-list svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--line);
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 14px 0;
  font-size: 14.5px;
  vertical-align: top;
}

.specs-table td:first-child {
  width: 220px;
  color: var(--ink-soft);
}

.specs-table td:last-child {
  color: var(--ink);
  font-weight: 500;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.review-score {
  text-align: center;
}

.review-score .num {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
}

.review-item {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}

.review-item:first-of-type {
  border-top: none;
}

.review-item .review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.review-item .review-head .stars {
  display: flex;
  gap: 2px;
  color: var(--blue);
}

.review-item .review-head .stars svg {
  width: 14px;
  height: 14px;
}

.review-item .name {
  font-weight: 600;
  font-size: 14px;
}

.review-item .date {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.review-item p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
}

.destacados-head h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

/* ===== Footer (idéntico al sitio) ===== */

@media (max-width: 991.98px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
  .product-info {
    position: static;
  }
}

@media (max-width: 575.98px) {
  /* Tabs: scroll horizontal en vez de desbordar la página */
  .tab-nav {
    gap: 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
  }

  .purchase-row {
    flex-wrap: wrap;
  }
  .qty-selector {
    order: 1;
  }
  .btn-secondary {
    order: 3;
    flex-basis: 100%;
    padding: 14px 16px;
  }
  .btn-third {
    order: 2;
  }
}
