/* =============================
   PRODUCTO CSS - MEJORADO
============================= */
/* FUENTES */
@import url('/taggi/assets/fonts.css');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ESTILOS PARA SCROLL */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #3c7f78;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #2b6058;
}

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Tipografía general */
body {
  font-family: 'Montserrat', sans-serif;
  background-color: #f5f6f7;
  color: #565656;
}

/* =============================
   ESTRUCTURA PRINCIPAL
============================= */

.pagina-producto {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: #777;
}

.breadcrumb a {
  color: #3c7f78;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: #28ce93;
}

.breadcrumb .separator {
  margin: 0 0.5rem;
  color: #ccc;
}

.breadcrumb .current {
  color: #333;
  font-weight: 500;
}

/* Contenedor general */
.producto-detalle-contenedor {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding: 0;
}

/* =============================
   DETALLES DEL PRODUCTO
============================= */

.producto-detalle {
  display: flex;
  flex-direction: column;
}

/* ===== COLUMNA IMAGEN ===== */
.columna-imagen {
  position: relative;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.badge-container {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.badge {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.destacado {
  background-color: #ffc667;
  color: #333;
  text-align: center;
}

.badge.ultimas-unidades {
  background-color: #ff746c;
  color: white;
}

.imagen-principal-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.imagen-principal {
  max-width: 90%;
  max-height: 350px;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.miniaturas-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.grupo-miniaturas {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.miniatura-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #f0f0f0;
  transition: all 0.3s ease;
}

.miniatura-wrapper:hover {
  border-color: #28ce93;
  transform: translateY(-3px);
}

.miniatura {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== COLUMNA INFO ===== */
.columna-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ref-producto {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
}

.stock-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.stock-info.en-stock {
  color: #28ce93;
}

.stock-info.sin-stock {
  color: #ff746c;
}

.stock-info i {
  font-size: 1rem;
}

.titulo-producto {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* ===== PRECIOS ===== */

.precio-contenedor {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.precios {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.precio-antes {
  text-decoration: line-through;
  color: #aaa;
  font-size: 1.1rem;
}

.precio-ahora {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3c7f78;
}

.descuento-badge {
  background-color: #ff746c;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.impuestos-incluidos {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1rem;
}

.descripcion-corta {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #555;
}

/* ===== SELECTOR DE COLOR ===== */

.selector-container {
  margin: 1rem 0;
}

.selector-titulo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.color-seleccionado {
  font-size: 0.85rem;
  color: #777;
  font-weight: normal;
}

.selector-colores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.color-opcion {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #eee;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: relative;
}

.color-opcion:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-opcion.color-activo {
  border: 3px solid #28ce93;
  transform: scale(1.1);
}

.color-opcion.color-activo::after {
  content: none;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 1;
  }

  70% {
    transform: scale(1.05);
    opacity: 0.5;
  }

  100% {
    transform: scale(0.95);
    opacity: 1;
  }
}

/* ===== COMPRA CONTAINER ===== */

.compra-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.cantidad-container {
  width: 100%;
  margin-bottom: 1rem;
}

.cantidad-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.cantidad-selector {
  display: flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fafafa;
}

.btn-cantidad {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  border: none;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cantidad:hover {
  background-color: #e5e5e5;
}

#cantidad {
  width: 50px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  padding: 0 10px;
}

.acciones-producto {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.boton-comprar,
.btn-anadir {
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 180px;
}

.boton-comprar {
  background-color: #ffc667;
  color: #333;
  box-shadow: 0 4px 10px rgba(255, 198, 103, 0.3);
}

.boton-comprar:hover {
  background-color: #ffbb4d;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(255, 198, 103, 0.4);
}

.btn-anadir {
  background-color: #3c7f78;
  color: white;
  box-shadow: 0 4px 10px rgba(60, 127, 120, 0.2);
}

.btn-anadir:hover {
  background-color: #346b65;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(60, 127, 120, 0.3);
}

.boton-comprar i,
.btn-anadir i {
  font-size: 1.1rem;
}

/* ===== INFORMACIÓN DE ENVÍO ===== */

.envio-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.envio-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
}

.envio-item i {
  font-size: 1.5rem;
  color: #3c7f78;
}

.envio-item p {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.envio-item span {
  font-size: 0.85rem;
  color: #777;
}

/* =============================
   TABS DE INFORMACIÓN
============================= */

.tabs-container {
  padding: 2rem;
  border-top: 1px solid #f0f0f0;
}

.tabs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #eaeaea;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #777;
  position: relative;
  transition: all 0.3s ease;
}

.tab-button::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: transparent;
  transition: background-color 0.3s;
}

.tab-button:hover {
  color: #333;
}

.tab-button.active {
  color: #28ce93;
  font-weight: 600;
}

.tab-button.active::after {
  background-color: #28ce93;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== CONTENIDO DE PESTAÑAS ===== */

.info-producto h2,
.ficha-tecnica h2,
.coste-envio h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.info-producto p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.producto-ventajas {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.ventaja-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 250px;
}

.ventaja-item i {
  font-size: 2rem;
  color: #28ce93;
}

.ventaja-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.ventaja-item p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Tablas */
.ficha-tecnica table,
.coste-envio table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.ficha-tecnica th,
.ficha-tecnica td,
.coste-envio th,
.coste-envio td {
  padding: 1rem;
  text-align: left;
  border: 1px solid #eaeaea;
}

.ficha-tecnica th,
.coste-envio th {
  background-color: #f8f8f8;
  font-weight: 600;
  color: #333;
}

.ficha-tecnica tr:nth-child(even),
.coste-envio tr:nth-child(even) {
  background-color: #fafafa;
}

.envio-detalles {
  margin-top: 1.5rem;
  background-color: #f8f8f8;
  padding: 1.5rem;
  border-radius: 8px;
}

.envio-detalles p {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.envio-detalles p:last-child {
  margin-bottom: 0;
}

/* Acordeón FAQ */
.accordion {
  margin-top: 1.5rem;
}

.accordion-item {
  margin-bottom: 1rem;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background-color: #3c7f78;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  transition: all 0.3s ease;
}

.accordion-header:hover {
  background-color: #346b65;
}

.accordion-header.active {
  background-color: #28ce93;
  color: white;
}

.accordion-header i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.accordion-header.active i {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  background-color: white;
}

.accordion-content p {
  padding: 1.25rem;
  margin: 0;
  line-height: 1.6;
}

/* ===== PRODUCTOS RELACIONADOS ===== */

.productos-relacionados {
  padding: 2rem;
  border-top: 1px solid #f0f0f0;
}

.productos-relacionados h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.relacionados-slider {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
}

/* =============================
   RESPONSIVE
============================= */

@media (min-width: 768px) {
  .producto-detalle {
    flex-direction: row;
  }

  .columna-imagen {
    width: 50%;
    border-bottom: none;
    border-right: 1px solid #f0f0f0;
  }

  .columna-info {
    width: 50%;
  }

  .compra-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .cantidad-container {
    width: 40%;
  }

  .acciones-producto {
    width: 60%;
  }
}

@media (max-width: 767px) {
  .pagina-producto {
    padding: 1rem;
  }

  .producto-detalle-contenedor {
    border-radius: 12px;
  }

  .columna-imagen,
  .columna-info,
  .tabs-container,
  .productos-relacionados {
    padding: 1.5rem;
  }

  .boton-comprar,
  .btn-anadir {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 0.5rem;
  }

  .tabs-header {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .accordion-header {
    padding: 1rem;
  }

  .accordion-content p {
    padding: 1rem;
  }

  .acciones-producto {
    flex-direction: row;
  }
}

/* =============================
   PRODUCTOS RELACIONADOS
============================= */

.productos-relacionados {
  padding: 2rem;
  border-top: 1px solid #f0f0f0;
}

.productos-relacionados h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.productos-relacionados h2 i {
  color: #28ce93;
  font-size: 1.4rem;
}

.relacionados-slider {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Tarjetas de producto */
.producto-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-badge-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.card-badge.destacado {
  background-color: #ffc667;
  color: #333;
}

.card-badge.ultimas-unidades {
  background-color: #ff746c;
  color: white;
}

.card-imagen {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7f7f7;
  padding: 1rem;
  overflow: hidden;
}

.card-imagen img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.producto-card:hover .card-imagen img {
  transform: scale(1.05);
}

.card-acciones {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.card-action-btn:hover {
  background-color: #3c7f78;
  color: white;
  transform: translateY(-2px);
}

.card-action-btn i {
  font-size: 1rem;
}

.card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8rem;
}

.card-precio {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: auto;
}

.precio-antes {
  text-decoration: line-through;
  color: #aaa;
  font-size: 0.9rem;
}

.precio-ahora {
  font-size: 1.2rem;
  font-weight: 700;
  color: #3c7f78;
}

.card-form {
  padding: 0 1rem 1rem;
}

.card-btn-carrito {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  border-radius: 8px;
  background-color: #3c7f78;
  color: white;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-btn-carrito:hover {
  background-color: #346b65;
  transform: translateY(-2px);
}

.card-btn-carrito.anadido {
  background-color: #28ce93;
}

.sin-relacionados {
  text-align: center;
  padding: 2rem;
  color: #777;
  font-style: italic;
  background-color: #f9f9f9;
  border-radius: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
  .relacionados-slider {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .card-imagen {
    height: 150px;
  }

  .card-titulo {
    font-size: 0.9rem;
  }

  .precio-ahora {
    font-size: 1.1rem;
  }

  .card-btn-carrito {
    padding: 0.7rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .relacionados-slider {
    grid-template-columns: 1fr;
  }

  .productos-relacionados {
    padding: 1.5rem;
  }
}

/* === Efecto de desplazamiento horizontal para móviles === */
@media (max-width: 767px) {
  .relacionados-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }

  .producto-card {
    flex: 0 0 auto;
    width: 75%;
    scroll-snap-align: start;
  }

  /* Esconder scrollbar pero mantener la funcionalidad */
  .relacionados-slider::-webkit-scrollbar {
    height: 4px;
  }

  .relacionados-slider::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .relacionados-slider::-webkit-scrollbar-thumb {
    background: #dbdbdb;
    border-radius: 10px;
  }
}

/* === Animaciones === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.producto-card {
  animation: fadeIn 0.5s ease forwards;
}

.relacionados-slider .producto-card:nth-child(1) {
  animation-delay: 0.1s;
}

.relacionados-slider .producto-card:nth-child(2) {
  animation-delay: 0.2s;
}

.relacionados-slider .producto-card:nth-child(3) {
  animation-delay: 0.3s;
}

.relacionados-slider .producto-card:nth-child(4) {
  animation-delay: 0.4s;
}

.relacionados-slider .producto-card:nth-child(5) {
  animation-delay: 0.5s;
}

.relacionados-slider .producto-card:nth-child(6) {
  animation-delay: 0.6s;
}

.toast-stock {
  position: fixed;
  top: 20px;
  /* sitio visible */
  right: 20px;
  z-index: 10000;
  /* sobre todo lo demás */
  background: #e74c3c;
  /* rojo avisos */
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  font-size: 14px;
  animation: fadein .3s ease-out;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.disabled {
  background-color: #bbb;
  box-shadow: 0 4px 12px rgba(187, 187, 187, 0.3);
}

.disabled:hover {
  background-color: #bbb;
}
