/* -------------------------
   Base
------------------------- */
html,
body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--color-texto);
  /* background-color: #f9f9f9; */
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

.carrito-icon {
  width: 18px;
  height: 18px;
}

.carrito-icon-path {
  stroke: var(--color-primario);
  fill: none;
}

.detalle-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detalle-right {
  order: 1;
}

.detalle-left {
  order: 2;
}

/* -------------------------
   Hero (imagen + back)
------------------------- */

.detalle-variants {
  /* padding: 0 26px; */
}

/* -------------------------
   Info
------------------------- */
.detalle-info {
  background-color: #fff;
  padding: 7px 26px;
  border-radius: 20px 20px 0 0;
  margin-top: 5px;
}

/* Header: categoría, nombre, fav y precio */
.detalle-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 40px 1fr;
  gap: 8px;
}

.detalle-header-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detalle-header-actions .btn-fav.btn-favorito {
  margin-bottom: 0;
}

.detalle-header :nth-child(4) {
  margin-bottom: 1rem;
}

.detalle-header .categoria {
  grid-column: 1;
  grid-row: 1;
  font-size: 14px;
  color: #aeb0b7;
  margin-bottom: -0.5rem;
}

.variante_name {
  margin-top: -0.7rem;
  font-weight: 500;
  color: #717171;
}

.detalle-header .nombre-producto {
  grid-column: span 2 / span 2;
  font-size: 20px;
  font-weight: 700;
  color: #000;
  max-width: 90%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.categoria-container {
  display: flex;
  height: 100%;
  align-items: end;
}

.detalle-header .btn-fav {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background-color: var(--color-gris);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  /* margin-bottom: -0.5rem; */
}

.btn-share {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background-color: var(--color-gris);
  color: var(--color-primario);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-share:hover {
  background-color: #ececec;
}

.detalle-header .btn-fav:hover {
  background-color: #ececec;
}

.detalle-header .btn-fav img {
  width: 22px;
  height: 22px;
}

.detalle-header .btn-fav.active {
  background: var(--color-primario);
}

.detalle-header .precio {
  grid-column: 2;
  grid-row: 2;
  font-size: 20px;
  font-weight: 700;
  color: #000;
  justify-self: end;
  align-self: end;
}

/* -------------------------
   Tabs
------------------------- */
.detalle-tabs {
  margin: 16px 0 10px;
}

.tab {
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background-color: #fff;
  font-size: 14px;
  cursor: pointer;
  color: #b9b9b9;
}

.tab.active {
  background-color: var(--color-primario);
  color: #fff;
  border: none;
  font-weight: 600;
}

/* -------------------------
   Descripción
------------------------- */
.detalle-descripcion {
  font-size: 13px;
  color: #676869;
  line-height: 1.35;
  white-space: pre-line;
  margin-bottom: 6px;
}

.detalle-descripcion-title {
  font-size: 14px;
  color: #6b6f75;
  display: inline;
  margin-right: 6px;
}

.detalle-descripcion-wrapper {
  --desc-lines: 10;
  margin-bottom: 12px;
}

.detalle-descripcion.is-collapsed {
  overflow: hidden;
  max-height: calc(1.35em * var(--desc-lines));
  position: relative;
}

.detalle-descripcion.is-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.descripcion-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primario);
  cursor: pointer;
  line-height: 1.2;
  display: inline-block;
}

.descripcion-toggle:hover {
  text-decoration: underline;
}

.descripcion-toggle:focus-visible {
  outline: 2px solid var(--color-primario);
  outline-offset: 3px;
  border-radius: 8px;
}

.descripcion-toggle.is-hidden {
  display: none;
}

/* -------------------------
   Actions
------------------------- */
.detalle-actions {
  position: relative;
  margin-top: 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

/* Botones en horizontal */
.btn-outline,
.btn-solid {
  width: 100%;
  max-width: 420px;
  height: 56px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-outline {
  border: 2px solid var(--color-primario);
  background: #fff;
  color: var(--color-primario);
}

.btn-outline img {
  width: 18px;
  height: 18px;
}

.btn-solid {
  border: none;
  background: var(--color-primario);
  color: #fff;
}

@media (max-width: 400px) {
  .detalle-actions {
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
  }

  .btn-outline,
  .btn-solid {
    width: 100%; /* ocupan todo el ancho disponible */
    max-width: none; /* sin límite de ancho */
    height: 56px; /* misma altura */
  }
}

@media (max-width: 768px) {
  .detalle-actions {
    /* padding: 0 20px; */
    box-sizing: border-box;
  }
}

/* --- Corrige solapamiento de la imagen y el contenido --- */
.detalle-hero {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 4rem; /* deja espacio debajo del header */
}

.detalle-img-wrapper {
  width: 100%;
  overflow: hidden;
  /* border-radius: 0 0 20px 20px; */
}

.detalle-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* carrousel */

/* -------------------------
   Carrusel
------------------------- */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 27rem; /* 🔹 Altura fija real */
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slides {
  display: flex;
  transition: transform 0.4s ease;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  flex: 0 0 100%; /* asegura que cada slide ocupe todo el ancho */
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* evita recorte */
  background-color: #fff; /* opcional: fondo uniforme */
  transition: transform 0.3s ease;
}

/* Controles del carrusel */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.carousel-control.is-hidden {
  display: none;
}

.carousel-control.prev {
  left: 10px;
}

.carousel-control.next {
  right: 10px;
}

/* Indicadores del carrusel */
.carousel-indicators {
  position: absolute;
  bottom: 11px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.indicator {
  width: 10px;
  height: 12px;
  border-radius: 100%;
  border: none;
  border-color: #cacaca;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.indicator.active {
  background-color: var(--color-primario);
}

.indicator.is-hidden {
  display: none;
}

.carousel-thumbs {
  display: none;
}

.carousel-thumbs.is-hidden {
  display: none;
}

.carousel-thumb {
  border: 1px solid #e1e1e1;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.carousel-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-thumb.active {
  border-color: var(--color-primario);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
  .carousel-control {
    width: 35px;
    height: 35px;
  }

  .carousel-control img {
    width: 16px;
    height: 16px;
  }
}

/* variantes del producto */

.variant-section {
  /* padding: 0 26px; */
  margin-bottom: 30px;
}

.variant-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.variant-options {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.variant-btn {
  border: 2px solid #d8d8d8;
  background-color: transparent;
  color: #d8d8d8;
  border-radius: 10%;
  width: 50px;
  height: 40px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  font-size: 10px;
}

.variant-btn:hover {
  background-color: #ffe5ef;
}

.variant-btn.active {
  /* background-color: #ff91b7; */
  border: 2px solid #ff91b7;
  color: #ff91b7;
}

.precio-original.tachado {
  text-decoration: line-through;
  color: #999;
  font-size: 13px;
  font-weight: normal;
}

.precio-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.precio-oferta {
  color: #000;
  font-weight: bold;
  font-size: 20px;
}

.precio {
  color: #000000;
  font-weight: bold;
  font-size: 20px;
}

.descuento-badge {
  background: var(--color-secundario);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

/* Estilos para el botón de favoritos en Product.php */
.btn-fav.btn-favorito {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background-color: var(--color-gris);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -0.5rem;
}

.btn-fav.btn-favorito:hover {
  background-color: #ffe5ef;
}

.btn-fav.btn-favorito svg {
  color: var(--color-primario);
}

.btn-fav.btn-favorito.active {
  background-color: color-mix(in srgb, var(--color-primario) 15%, white);
}

.btn-fav.btn-favorito.active svg path {
  fill: var(--color-primario);
  stroke: var(--color-primario);
}

.btn-fav.btn-favorito.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Modal Styles - CENTRADO */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.stock-modal {
  background: white;
  border-radius: 20px;
  padding: 0;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
  margin: 0 auto; /* Asegura centrado horizontal */
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Notificación centrada horizontalmente */
.notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primario);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  font-weight: 500;
  text-align: center;
  min-width: 200px;
}

/* Estilos SIMPLES para botones de variantes */
.variant-options {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 15px 0;
  --variant-thumb-height: 5.4em;
  --variant-thumb-max: 96px;
}

.variant-btn {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.variant-btn.active {
  border-color: var(--color-primario);
  border-width: 3px;
}

.variant-btn:hover {
  border-color: var(--color-primario);
}

.variant-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Estilos para el select de presentaciones */
.presentation-section {
  margin: 20px 0;
}

.presentation-section h4 {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.presentation-select {
  width: 100%;
  padding: 15px 16px;
  border: 2px solid #e0e0e0 !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  background: white !important;
  cursor: pointer;

  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;

  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 16px !important;
}

@-moz-document url-prefix() {
  .presentation-select {
    text-indent: 0.01px;
    text-overflow: "";
  }
}

.presentation-select:focus {
  border-color: var(--color-primario);
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primario) 10%, transparent);
}

.presentation-select:hover {
  border-color: var(--color-primario);
  background-color: #fff5f7;
}

.presentation-select::-ms-expand {
  display: none;
}

.presentation-select option {
  padding: 10px;
  font-size: 14px;
}

/* Estilos para las variantes con etiquetas */
.variant-image-container {
  object-fit: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.variant-btn {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  /* padding: 4px; */
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 5.4em;
  height: var(--variant-thumb-height, 5.4em);
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-btn.active {
  border-color: var(--color-primario);
  background-color: #fff;
}

.variant-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.variant_name {
  margin-bottom: 8px;
}

.presentation-badge {
  position: absolute;
  bottom: 11px;
  left: 2px;
  right: 2px;
  background: rgba(54, 54, 54, 0.8);
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Para variantes que SÍ tienen imágenes propias */
.variant-with-custom-image .presentation-badge {
  display: none;
}

.btn-consultar {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-consultar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-consultar:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.alerta-agotado {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  border: 1px solid #f1aeb5;
  border-radius: 12px;
  margin: 16px 0;
  color: #842029;
}

.alerta-agotado svg {
  flex-shrink: 0;
  color: #dc3545;
}

.alerta-agotado strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.alerta-agotado p {
  font-size: 13px;
  margin: 0;
  opacity: 0.9;
}

/* Agregar a Product.css */

/* ==================================================================== */
/* SELECT PERSONALIZADO - Reemplaza al nativo en Android */
/* ==================================================================== */

.presentation-section {
  margin: 20px 0;
}

.presentation-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

/* Ocultar select nativo */
.presentation-select-hidden {
  display: none !important;
}

/* Wrapper del select personalizado */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

/* Trigger (botón que abre el dropdown) */
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger:hover {
  border-color: var(--color-primario);
  box-shadow: 0 2px 8px
    color-mix(in srgb, var(--color-primario) 10%, transparent);
}

.custom-select-trigger.active {
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primario) 10%, transparent);
}

/* Texto seleccionado */
.selected-option {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
}

/* Flecha del dropdown */
.dropdown-arrow {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: #666;
}

.custom-select-trigger.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* Contenedor de opciones */
.custom-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid var(--color-primario);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.custom-options.show {
  max-height: 280px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
}

/* Scrollbar personalizada para el dropdown */
.custom-options::-webkit-scrollbar {
  width: 6px;
}

.custom-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.custom-options::-webkit-scrollbar-thumb {
  background: var(--color-primario);
  border-radius: 10px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
  background: var(--color-primario);
}

/* Cada opción individual */
.custom-option {
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.custom-option:last-child {
  border-bottom: none;
}

.custom-option:hover {
  background: color-mix(in srgb, var(--color-primario) 10%, transparent);
  padding-left: 20px;
}

.custom-option.selected {
  background: var(--color-primario);
  color: white;
  font-weight: 600;
}

.custom-option.selected:hover {
  background: var(--color-primario);
  padding-left: 16px;
}

/* Efecto de ripple al hacer click */
.custom-option:active {
  transform: scale(0.98);
}

/* Estado cuando está cargando */
.custom-select-trigger.loading {
  opacity: 0.6;
  cursor: wait;
}

/* Animación de entrada */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-options.show {
  animation: slideDown 0.3s ease;
}

/* ==================================================================== */
/* RESPONSIVE - Optimizado para móvil */
/* ==================================================================== */

@media (max-width: 768px) {
  .custom-select-trigger {
    padding: 12px 14px;
  }

  .selected-option {
    font-size: 13px;
  }

  .custom-option {
    padding: 12px 14px;
    font-size: 13px;
  }

  .custom-option:hover {
    padding-left: 18px;
  }

  /* Mejorar el área táctil en móvil */
  .custom-select-trigger {
    min-height: 48px;
  }

  .custom-option {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ==================================================================== */
/* ACCESIBILIDAD */
/* ==================================================================== */

/* Focus visible para navegación con teclado */
.custom-select-trigger:focus-visible {
  outline: 2px solid var(--color-primario);
  outline-offset: 2px;
}

.custom-option:focus-visible {
  outline: 2px solid var(--color-primario);
  outline-offset: -2px;
}

/* ==================================================================== */
/* ESTADOS ESPECIALES */
/* ==================================================================== */

/* Cuando no hay opciones disponibles */
.custom-option.disabled {
  color: #999;
  cursor: not-allowed;
  background: #f9f9f9;
}

.custom-option.disabled:hover {
  padding-left: 16px;
  background: #f9f9f9;
}

/* Indicador de precio en oferta */
.custom-option .price-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #ffd700;
  color: #333;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* ==================================================================== */
/* DARK MODE (opcional) */
/* ==================================================================== */

@media (prefers-color-scheme: dark) {
  .custom-select-trigger {
    background: #ffffff;
    border-color: #a8a7a7;
    color: #484848;
  }

  .selected-option {
    color: #484848;
  }

  .custom-options {
    background: #ffffff;
    border-color: var(--color-primario);
  }

  .custom-option {
    color: #545454;
    border-bottom-color: #c1c1c1;
  }

  .custom-option:hover {
    /* background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%); */
  }
}

/* ==================================================================== */
/* ANIMACIONES ADICIONALES */
/* ==================================================================== */

/* Micro-interacción al seleccionar */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.custom-option.selected {
  animation: pulse 0.3s ease;
}

/* Loading state */
.custom-select-trigger.loading::after {
  content: "";
  position: absolute;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--color-primario);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------
   Tablet (600-1023px): single column, imagen centrada
------------------------- */
@media (min-width: 600px) and (max-width: 1023px) {
  body {
    background-color: #fff;
  }

  .detalle-page {
    padding-top: 54px;
  }

  .detalle-hero {
    margin-top: 0;
  }

  .detalle-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: #fff;
  }

  .detalle-right {
    order: 1;
    display: flex;
    flex-direction: column;
  }

  .detalle-left {
    order: 2;
  }

  .detalle-img-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 32px;
    border-radius: 0;
  }

  .carousel-container {
    height: 420px;
  }

  .carousel-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 8px;
    margin-top: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }

  .carousel-thumb {
    width: 80px;
    height: 80px;
    padding: 0;
  }

  .carousel-thumb img {
    object-fit: contain;
  }

  .detalle-info {
    background: transparent;
    border-radius: 0;
    padding: 16px 40px 0;
    margin-top: 0;
  }

  .detalle-actions {
    padding: 0 14px;
    margin-bottom: 32px;
  }

  .productos-relacionados {
    padding: 0 32px;
    margin: 24px auto 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 24px;
  }

  .productos-relacionados .productos-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .productos-relacionados .producto-card {
    width: 100%;
    height: auto;
  }

  .productos-relacionados .producto-img-wrapper {
    width: calc(100% - 20px);
    height: 170px;
  }
}

/* Productos relacionados (mismos estilos de Home, con scope) */
.productos-relacionados {
  padding: 10px 26px;
  margin: 20px auto;
}

.productos-relacionados .productos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.productos-relacionados .productos-header h2 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.productos-relacionados .productos-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.productos-relacionados .productos-scroll::-webkit-scrollbar {
  display: none;
}

.productos-relacionados .producto-card {
  width: 211px;
  height: 286px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
}

.productos-relacionados .producto-img-wrapper {
  background-color: #f9f9f9;
  border-radius: 12px;
  width: calc(100% - 35px);
  height: 192px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px auto 9px auto;
  position: relative;
}

.productos-relacionados .producto-img {
  max-width: 192px;
  max-height: 192px;
  object-fit: contain;
}

.productos-relacionados .producto-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 25px 14px;
  flex: 1;
  text-decoration: none;
  margin-top: 1.2em;
}

.productos-relacionados .producto-info h3 {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.productos-relacionados .producto-info .categoria {
  font-size: 12px;
  color: #7c7c7c;
  margin-bottom: 9px;
  text-align: left;
  text-decoration: none;
}

.productos-relacionados .producto-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-top: auto;
}

.productos-relacionados .producto-footer .precio {
  font-size: 14px;
  font-weight: bold;
  color: #000;
}

.productos-relacionados .precios-oferta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -0.6em;
}

.productos-relacionados .precio-original {
  text-decoration: line-through;
  color: var(--color-primario);
  font-size: 1em;
}

.productos-relacionados .precio-oferta {
  color: #000;
  font-weight: bold;
  font-size: 1em;
}

.productos-relacionados .badge-oferta {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-secundario);
  color: white;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.productos-relacionados .badge-agotado {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.productos-relacionados .btn-favorito {
  border: none;
  background: none;
  cursor: pointer;
  width: 30px;
  color: var(--color-primario);
  transition: color 0.2s;
  z-index: 999;
  padding-bottom: 5px;
  margin-right: 10px;
}

.productos-relacionados .btn-favorito:hover {
  color: var(--color-primario);
}

.productos-relacionados .btn-favorito svg {
  width: 20px;
  height: 20px;
  color: var(--color-primario);
  pointer-events: none;
}

.productos-relacionados .btn-favorito svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.productos-relacionados .producto-img-wrapper .btn-favorito {
  position: absolute;
  top: 14px;
  right: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 0;
  border: none;
  cursor: pointer;
  z-index: 5;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.productos-relacionados .btn-favorito.active svg path {
  fill: var(--color-primario);
  stroke: var(--color-primario);
}

.productos-relacionados .btn-favorito:not(.active) svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

@media (max-width: 480px) {
  .productos-relacionados .producto-card {
    width: 230px;
    height: 310px;
    border-radius: 25px;
  }

  .productos-relacionados .producto-img-wrapper {
    height: 200px;
  }

  .productos-relacionados .producto-img {
    max-width: 250px;
  }
}
