/* Contenedor general para alinear con el resto del sitio */
.single-producto {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap; /* para responsividad */
}

.single-producto-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: flex-start;
  background-color: var(--blanco);
}

/* Galería */

.single-producto__galeria {
  flex: 1 1 45%;
  max-width: 500px;
}

.galeria-carrusel {
  max-width: 500px;
}

.galeria-principal {
  width: 100%;
  max-width: 500px;
  max-height: 500px;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* AÑADIDO */
}

.galeria-principal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.galeria-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.galeria-thumbs img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.galeria-thumbs img:hover,
.galeria-thumbs img.active {
  opacity: 1;
  outline: 2px solid var(--verde-abeto);
}

.imagen-activa img {
  height: 100%;
  object-fit: cover;
  display: block;
}

.flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--verde-abeto);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  padding: 0 1rem;
  box-shadow: none;
}

.flecha:hover {
  background: none;
  color: var(--verde-menta);
}

.flecha:focus {
  background: none;
  color: var(--verde-abeto);
}

.flecha.izq {
  left: 10px;
}

.flecha.der {
  right: 10px;
}

/* Info */
.single-producto__info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 45%;
  min-width: 620px;
}
.titulo-producto {
  font-size: 2rem;
  color: var(--verde-abeto);
  margin-bottom: 1rem;
}
.descripcion-larga {
  font-size: 1rem;
}

/* Extras */
.producto-extras {
  background: var(--verde-menta);
  padding: 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
}
.producto-extras label,
.producto-extras p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--verde-abeto);
}

.producto-extras select,
.producto-extras textarea {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--verde-abeto);
  border-radius: 12px;
  width: 30%;
}

.bloque-vela-2 {
  margin-top: 1rem;
}
/* Precio y botón */
.single-producto__final {
  margin-top: 2rem;
}
.single-producto__final .price {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}
.single-producto__final .single_add_to_cart_button {
  background-color: var(--verde-abeto);
  color: var(--blanco);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.single-producto__final .single_add_to_cart_button:hover {
  background-color: #014236;
}

form.cart button.single_add_to_cart_button {
  display: inline-block !important;
  background-color: var(--verde-abeto);
  color: var(--blanco);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form.cart button.single_add_to_cart_button:focus,
form.cart button.single_add_to_cart_button:hover {
  background-color: var(--blanco);
  color: var(--verde-abeto);
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 50);
}

form.cart .quantity {
  display: none;
}

.atributo-producto {
  margin-top: 1rem;
}

.atributo-producto select {
  width: 50%;
  padding: 0.5rem;
  border: 1px solid var(--verde-abeto);
  border-radius: 12px;
  font-size: 1rem;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  position: relative;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--verde-abeto);
  border-radius: 12px;
  margin-right: 0.5rem;
  transition: background-color 0.2s ease;
  background-color: var(--blanco);
  display: inline-block;
  position: relative;
}

.checkbox-wrap input:checked + .custom-checkbox::after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 3px;
  font-size: 14px;
  color: var(--verde-abeto);
}

.alergenos-producto.descripcion-corta-galeria {
  margin-top: 2rem;
  padding: 1.2rem 1.5rem;
  background: #fafafc;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px #0001;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.alergenos img:last-child {
  margin-right: 0;
}

.alergenos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
}

.alergenos img {
  height: 100px; /* o 48px si lo prefieres más pequeño */
  width: auto; /* El ancho se ajusta solo según el SVG */
  max-width: 80px; /* Opcional: para que no se haga gigante en SVGs horizontales */
  object-fit: contain; /* Que no se deforme nunca */
  margin-right: 10px;
  border-radius: 12px;
  background: var(--blanco);
  box-shadow: 0 2px 8px 0 #0001;
  transition: transform 0.12s;
  padding: 2px; /* Un pequeño margen interior para que no “toque” el borde */
}

.alergenos img:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 16px 0 #0002;
}

.descripcion-larga {
  background: var(--blanco);
  padding: 2rem 2.2rem 1.7rem 2.2rem;
  border-radius: 12px;
  border: 1px solid #e7e7e7;
  margin-bottom: 2rem;
  max-width: 700px;
  box-shadow: 0 4px 16px 0 #0001;
  font-size: 1.13rem;
  color: #292929;
  line-height: 1.65;
  justify-content: center;
}

.descripcion-larga b,
.descripcion-larga strong {
  color: #014236;
  font-weight: 700;
}

.descripcion-larga ul,
.descripcion-larga ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1.5em;
}

.descripcion-larga li {
  margin-bottom: 0.35em;
  font-size: 1.03em;
}

/*Boton alergenos oculto en pc*/
.alergenos-short-desc {
  display: block !important;
}
.toggle-alergenos-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .single-producto {
    flex-direction: column;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .single-producto__galeria,
  .single-producto__info {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .atributo-producto select {
    width: 70%;
  }

  .single-producto img,
  .galeria-carrusel img,
  .galeria-thumbs img {
    max-width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
  }

  .producto-contenido {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .single-producto,
  .single-producto__info {
    max-width: 100%;
  }

  .single-producto__info {
    min-width: 0 !important;
  }

  .descripcion-larga {
    padding: 1.2rem 0.9rem;
    font-size: 1rem;
    max-width: 100%;
  }

  .alergenos img {
    height: 100px; /* o 48px si lo prefieres más pequeño */
    width: auto; /* El ancho se ajusta solo según el SVG */
  }

  .alergenos-producto.descripcion-corta-galeria {
    display: none;
    margin-bottom: 0;
  }
  .toggle-alergenos-btn,
  .toggle-alergenos-btn:focus {
    display: block !important;
    margin: 1.1rem auto 0 auto !important; /* centrado horizontal */
    background: var(--verde-abeto) !important;
    color: var(--blanco);
    border: none;
    border-radius: 12px;
    padding: 0.65em 1.3em;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px #0001;
    transition: background 0.18s;
    text-align: center;
    width: fit-content;
    max-width: 100%;
  }
  .toggle-alergenos-btn[aria-expanded="true"] {
    background: var(--verde-menta) !important;
    color: var(--verde-abeto);
  }
}

/*Personalizados*/

.cta-personalizados-section {
  background: var(--blanco);
  padding: 1rem;
  margin-top: 2.5rem;
}

.cta-personalizados {
  max-width: 1200px;
  margin: 0 auto;
  text-align: justify;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cta-frase {
  color: var(--verde-abeto);
  font-size: 1.18rem;
  line-height: 1.55;
  margin: 0;
  font-weight: 500;
}

.cta-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: inline-block;
}

.cta-icon-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-block;
  margin-right: 1rem;
}
.icon-normal {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 0.18s;
}
.icon-hover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.18s;
}

/* Cambia el icono en hover del botón */
.boton-claro:hover .icon-normal {
  opacity: 0;
}
.boton-claro:hover .icon-hover {
  opacity: 1;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .cta-personalizados-section {
    padding: 1rem;
  }
  .cta-personalizados {
    max-width: 98vw;
    gap: 1rem;
  }
  .cta-frase {
    font-size: 1.02rem;
  }
  .btn-mi-clase {
    font-size: 1rem;
    padding: 0.8em 1.2em;
  }
  .cta-icon {
    width: 24px;
    height: 24px;
  }
  .cta-icon-wrap {
    width: 24px;
    height: 24px;
  }
}
