/**
 * TIO Maquinaria - Estilos de ficha de producto
 * Colores: Amarillo #F4C308 | Azul navy #2a3065 | Petróleo #0F4758 | WhatsApp #25D366
 */

/* ============================================================
   VARIABLES Y RESET BASE
   ============================================================ */
:root {
  --tio-amarillo:   #F4C308;
  --tio-navy:       #2a3065;
  --tio-petroleo:   #0F4758;
  --tio-wa-green:   #25D366;
  --tio-text:       #2c2c2c;
  --tio-text-muted: #6c757d;
  --tio-border:     #e5e7eb;
  --tio-bg-light:   #f8f9fa;
  --tio-radius:     8px;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
#tio-product-page {
  background: #fff;
}

.tio-breadcrumb-bar {
  background: #f8f9fa;
  border-bottom: 1px solid var(--tio-border);
  padding: 10px 0;
}

.tio-product-main {
  padding-top: 32px;
  padding-bottom: 32px;
}

.tio-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Evita que la columna galería expanda el grid al ancho natural de la imagen */
.tio-col-gallery {
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 767px) {
  .tio-product-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================================
   GALERÍA — Slider principal + Slider de miniaturas
   ============================================================ */
.tio-gallery {
  position: sticky;
  top: 20px;
}

.tio-gallery-main {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f0f0;
  border-radius: var(--tio-radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tio-border);
  position: relative;
}

.tio-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.tio-no-image {
  color: #ccc;
  font-size: 3rem;
}

/* Flechas del slider principal */
.tio-slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.88);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a3065;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.tio-slide-btn:hover {
  background: #F4C308;
  color: #2a3065;
}
.tio-slide-prev { left: 10px; }
.tio-slide-next { right: 10px; }

/* Botón de zoom / abrir modal */
.tio-zoom-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a3065;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.tio-zoom-btn:hover {
  background: #F4C308;
  color: #2a3065;
}
.tio-gallery-main:hover .tio-cover-img {
  cursor: zoom-in;
}

/* ============================================================
   LIGHTBOX / MODAL — Visualización ampliada de imágenes
   ============================================================ */
.tio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.tio-lightbox.active {
  display: flex;
}
.tio-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
}
.tio-lightbox-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 70px;
  box-sizing: border-box;
}
.tio-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}
.tio-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.tio-lightbox-close:hover {
  color: #F4C308;
}
.tio-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.tio-lightbox-nav:hover {
  background: #F4C308;
  color: #2a3065;
}
.tio-lightbox-prev { left: 16px; }
.tio-lightbox-next { right: 16px; }
.tio-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 12px;
}

@media (max-width: 767px) {
  .tio-lightbox-content {
    padding: 50px 16px;
  }
  .tio-lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .tio-lightbox-prev { left: 6px; }
  .tio-lightbox-next { right: 6px; }
}

/* Wrapper del slider de miniaturas */
.tio-thumbs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

/* Botones de navegación de miniaturas */
.tio-thumb-nav {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a3065;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
  line-height: 1;
}
.tio-thumb-nav:hover {
  background: #F4C308;
  border-color: #F4C308;
}

/* Viewport del slider de miniaturas (oculta el overflow) */
.tio-thumbs-viewport {
  flex: 1;
  overflow: hidden;
}

/* Track que se desplaza con transform */
.tio-thumbs-track {
  display: flex;
  gap: 8px;
  transition: transform 0.3s ease;
}

/* Miniatura individual */
.tio-thumb {
  flex-shrink: 0;
  width: 76px;
  height: 57px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

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

.tio-thumb:hover,
.tio-thumb.active {
  border-color: var(--tio-amarillo);
}

/* ============================================================
   INFORMACIÓN DEL PRODUCTO (columna derecha)
   ============================================================ */
.tio-col-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tio-product-title {
  font-size: 1.375rem; /* 22px */
  font-weight: 500;
  color: var(--tio-navy);
  line-height: 1.3;
  margin: 0;
}

@media (max-width: 991px) {
  .tio-product-title {
    font-size: 1.2rem;
  }
}

/* ── Badges (inline pill, no ocupa ancho completo) ── */
/* ── Fila de badges (disponibilidad + condición) ── */
.tio-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tio-badge-disponible,
.tio-badge-agotado {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: auto;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tio-badge-disponible {
  background: #e6fdf0;
  color: #1a7a40;
  border: 1px solid #b2edca;
}

.tio-badge-agotado {
  background: #fff0f0;
  color: #cc0000;
  border: 1px solid #ffcccc;
}

.tio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ── Badge condición del producto ── */
.tio-badge-condition {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}
.tio-badge-new {
  background: #e8f0fe;
  color: #1a56a8;
  border: 1px solid #aac4f2;
}
.tio-badge-used {
  background: #fff8e1;
  color: #7a5700;
  border: 1px solid #ffe082;
}
.tio-badge-refurb {
  background: #f3e8fd;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

/* ── Badge oferta ── */
.tio-badge-oferta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff3cd;
  color: #8a6300;
  border: 1px solid #ffe28a;
}

/* ── Precio ── */
.tio-precio-bloque {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.tio-precio-regular {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tio-text-muted);
  text-decoration: line-through;
}

.tio-precio {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--tio-amarillo);
}

.tio-precio-nota {
  font-size: 0.8rem;
  color: var(--tio-text-muted);
}

/* ── Categoría ── */
.tio-categoria-label {
  color: var(--tio-text-muted);
  font-size: 0.95rem;
}

/* ── Stock ── */
.tio-stock {
  font-size: 0.9rem;
  color: var(--tio-text);
}

/* ── Specs con iconos amarillos ── */
.tio-specs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.tio-spec-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tio-spec-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tio-amarillo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.tio-spec-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
}

.tio-spec-text {
  font-size: 0.9rem;
  color: var(--tio-text);
}

.tio-spec-text strong {
  color: var(--tio-navy);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ============================================================
   SELECTOR DE CANTIDAD Y BOTONES
   ============================================================ */
.tio-actions {
  margin-top: 4px;
}

.tio-quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tio-qty-label {
  font-size: 0.9rem;
  color: var(--tio-text);
  font-weight: 500;
  white-space: nowrap;
}

.tio-qty-fixed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  padding: 7px 4px;
  border: 1px solid var(--tio-border);
  border-radius: var(--tio-radius);
  font-size: 0.95rem;
  text-align: center;
  color: var(--tio-text);
  background: #fff;
  user-select: none;
}

/* ── Botones ── */
.tio-buttons-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tio-btn-cart,
.tio-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--tio-radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1;
}

.tio-btn-cart {
  background: var(--tio-amarillo);
  color: var(--tio-navy);
  border-color: var(--tio-amarillo);
}

.tio-btn-cart svg {
  stroke: var(--tio-navy);
}

.tio-btn-cart:hover:not(:disabled) {
  background: #d9a900;
  border-color: #d9a900;
  color: #fff;
  transform: translateY(-1px);
}

.tio-btn-cart:hover:not(:disabled) svg {
  stroke: #fff;
}

.tio-btn-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tio-btn-whatsapp {
  background: transparent;
  color: var(--tio-wa-green);
  border-color: var(--tio-wa-green);
}

.tio-btn-whatsapp svg {
  fill: var(--tio-wa-green);
}

.tio-btn-whatsapp:hover {
  background: var(--tio-wa-green);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.tio-btn-whatsapp:hover svg {
  fill: #fff;
}

@media (max-width: 480px) {
  .tio-btn-cart,
  .tio-btn-whatsapp {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   GARANTÍAS TIO
   ============================================================ */
.tio-garantias-bloque {
  background: #eef2ff;
  border-left: 4px solid var(--tio-navy);
  border-radius: 0 var(--tio-radius) var(--tio-radius) 0;
  padding: 18px 20px;
}

.tio-garantias-titulo {
  font-weight: 700;
  color: var(--tio-navy);
  font-size: 1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tio-garantias-titulo svg {
  flex-shrink: 0;
}

.tio-garantias-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tio-garantias-lista li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--tio-text);
  line-height: 1.4;
}

.tio-garantias-lista li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   SECCIÓN INFERIOR
   ============================================================ */
.tio-product-bottom {
  padding: 32px 0 48px;
  border-top: 1px solid var(--tio-border);
}

.tio-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 767px) {
  .tio-bottom-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.tio-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--tio-amarillo);
  display: inline-block;
}

/* ── Cards de detalles ── */
.tio-detail-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.tio-detail-card {
  border: 1px solid var(--tio-border);
  border-radius: var(--tio-radius);
  padding: 20px;
  text-align: center;
  background: #fff;
}

.tio-detail-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.tio-brand-abbr {
  color: #0F4758;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.tio-detail-label {
  font-size: 0.8rem;
  color: var(--tio-text-muted);
  margin-bottom: 4px;
}

.tio-detail-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tio-navy);
}

/* ── Descripción ── */
.tio-desc-content {
  font-size: 0.95rem;
  color: var(--tio-text);
  line-height: 1.7;
}

.tio-desc-content p {
  margin-bottom: 0.75rem;
}

/* ── Tags cloud ── */
.tio-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tio-tag {
  display: inline-block;
  background: #fff;
  border: 1.5px solid var(--tio-amarillo);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.85rem;
  color: var(--tio-navy);
  font-weight: 500;
  transition: background 0.2s;
}

.tio-tag:hover {
  background: var(--tio-amarillo);
  color: #fff;
}

/* ── Mensaje sin tags ── */
.tio-no-tags {
  font-size: 0.875rem;
  color: var(--tio-text-muted);
  font-style: italic;
}

/* ============================================================
   BANDERAS — flag-icons en spec de país
   ============================================================ */
.tio-spec-item .fi {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid var(--tio-border);
  margin-right: 4px;
  position: relative;
  top: -1px;
}

/* ============================================================
   ACCESORIOS
   ============================================================ */
.tio-accessories {
  padding-bottom: 48px;
  border-top: 1px solid var(--tio-border);
  padding-top: 32px;
}

/* ============================================================
   VARIANTES (mantener compatibilidad PS)
   ============================================================ */
.tio-cart-form .product-variants {
  margin-bottom: 16px;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.tio-bottom-left,
.tio-bottom-right {
  min-width: 0; /* evitar overflow en grid */
}

/* =============================================================
   TIO — Puntos indicadores + Detalles debajo de galería
   ============================================================= */

/* Thumbs ocultos en DOM (usados solo por el JS para leer data-src) */
.tio-thumbs-hidden {
  display: none;
}

/* Puntos indicadores */
.tio-dots-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}

.tio-img-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(42, 48, 101, 0.25);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  display: inline-block;
}

.tio-img-dot.active {
  background-color: #2a3065;
  transform: scale(1.3);
}

.tio-img-dot:hover {
  background-color: #F4C308;
}

/* Detalles del equipo debajo de galería */
.tio-details-below-gallery {
  margin-top: 24px;
  width: 100%;
}

@media (max-width: 768px) {
  .tio-dots-wrap {
    gap: 6px;
    padding: 10px 0 2px;
  }

  .tio-img-dot {
    width: 7px;
    height: 7px;
  }
}
