/* --- 1. RESET Y SEGURIDAD MÓVIL (Al principio siempre) --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  color: #333;
  line-height: 1.6;
  background-size: contain;
  background-position: center;
  background-attachment: fixed;
}

body::before {
  content: ""; /* Esta caracteristica es bligatoria para que el pseudo-elemento before exista */
  position: fixed; /* La capa que esta sobre la imagen se queda quieta al hacer scroll */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* En este apartado se configura imagen */
  background-image: url("./img_sitio/CosmoWandaConCollares.jpeg");
  background-size: contain;
  background-position: center;
  /* GRADUACIÓN DEL EFECTO: Los niveles son los siguientes, 0.1 - casi invisible, 0.9 - casi total. De 0.2 o 0.3 para la marca de agua. */
  opacity: 0.4;
  z-index: -1; /* Envía la imagen al fondo, DETRÁS de todo el contenido */
  pointer-events: none; /* Evita que la capa interfiera con los clics en botones */
}

/* --- 2. SECCIÓN HERO (TÍTULOS) --- */
.hero {
  text-align: center;
  padding: 40px 10px;
  background-color: #fbb0e3;
  margin-bottom: 20px;
  overflow: hidden; /* Doble seguridad para las huellas */
}

.hero h2 {
  font-size: 2.8rem;
  color: #000;
  position: relative;
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero h2::before,
.hero h2::after {
  content: "🐾";
  font-size: 1.8rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
}

.hero h2::before {
  left: -55px;
}
.hero h2::after {
  right: -55px;
}

.tagline {
  font-size: 1.2rem;
  color: #333;
  margin-top: 10px;
  font-weight: 500;
}

/* --- 3. HEADER Y NAVEGACIÓN --- */
header {
  background-color: #ff914d;
  color: #fff;
  padding: 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-titulo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 15px;
  border-radius: 5px;
  transition: 0.3s;
}

.nav-link.activo {
  background-color: white;
  color: #ff914d;
}

/* --- 4. GRID DE PRODUCTOS --- */
.producto-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #5e1717;
  text-align: center;
}

.item-precio {
  color: blue;
}

.grid-productos {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(300px, 1fr)
  ); /*Cambiando auto-fit por auto.fill las imágenes ya no se distorsionan*/
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

.producto {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  height: 100%; /* Para que todas las tarjetas tengan la misma altura, lo que ayuda a alinear los precios al fondo */
}

.producto:hover {
  transform: translateY(-5px);
}

.producto img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  display: block;
}

.producto-info {
  flex-grow: 1;
  padding: 15px;
  text-align: left;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  height: 100%; /* Para que el producto ocupe toda la altura disponible, lo que ayuda a alinear los precios al fondo */
}

.price {
  font-size: 1.2rem;
  color: #ff914d;
  font-weight: 800;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed #eee;
}

.producto-detalles-texto p {
  margin-bottom: 4px; /* Ajusta este valor según el espacio que desees */
  line-height: 1.4; /* Esto también ayuda a que el texto no se vea amontonado */
  flex-grow: 1; /* Esto le dice a la descripción: "Ocupa todo el espacio que puedas" */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.producto-info button {
  background: #ff914d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}
.producto-descripcion {
  font-size: 0.9em; /* Un poco más pequeña */
  color: #666; /* Un gris más suave */
  margin-bottom: 10px; /* Separación con el precio */
  /* Para limitar a 2 o 3 líneas si son muy largas */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- CARRITO --- */
.carrito {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #fffffffb; /* Naranja corporativo */
  color: rgb(10, 5, 5);
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 8px 20px rgba(255, 145, 77, 0.4);
  cursor: pointer;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  font-weight: 700;
  border: 2px solid rgb(255, 72, 27);
}

.carrito:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(255, 145, 77, 0.6);
}

/* Ajuste del icono dentro del botón */
.carrito i {
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s;
}

.carrito:hover i {
  transform: scale(1.1) rotate(-10deg);
}

/* --- 5. SIDEBAR CARRITO --- */
.sidebar-carrito {
  position: fixed;
  top: 20px; /* Separado del borde superior en escritorio */
  right: -500px; /* Oculto fuera de pantalla */
  width: 450px;
  max-height: 95vh; /* Para que no ocupe toda la altura y se vea flotante */
  background: #ffffff;
  z-index: 9999;
  border-radius: 20px; /* Bordes redondeados para efecto premium */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* Sombra para elevarlo */
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}
.sidebar-carrito.active {
  right: 20px; /* Se queda a 20px del borde derecho */
}

.sidebar-header {
  padding: 20px;
  background: #fbb0e3;
  color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.2rem;
}

.btn-cerrar {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #000;
  line-height: 1;
}

#lista-carrito {
  list-style: none;
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 400px;
}

/* Estilo de cada producto dentro del carrito */
.item-carrito {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  animation: fadeIn 0.4s ease forwards;
}

.item-info {
  display: flex;
  flex-direction: column;
}

.item-nombre {
  font-weight: 600;
  font-size: 0.95rem;
}

.item-precio {
  color: #ff914d;
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-eliminar {
  background: #ffeded;
  color: #ff4d4d;
  border: none;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-eliminar:hover {
  background: #ff4d4d;
  color: white;
}

.footer-carrito {
  margin-top: auto;
  padding: 20px;
  background: #fafafa;
  border-top: 1px solid #eee;
}

#total-carrito {
  font-size: 1.2rem;
  margin-bottom: 15px;
  display: block;
  text-align: center;
}

/* --- 6. FOOTER (Unificado) --- */
.footer-wancos {
  background: #333;
  color: white;
  padding: 40px 20px;
  text-align: center;
  margin-top: 50px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-copy {
  text-align: center;
  flex: 1;
}

.footer-copy p {
  font-size: 0.9rem;
  color: #bbb;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.footer-copy p span {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #ff914d;
  display: block;
  margin-top: 5px;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  transition: 0.3s ease;
}

.footer-social a:hover {
  color: #ff914d;
  transform: scale(1.2);
}

/* --- 7. RESPONSIVO (Media Queries) --- */

/* Ajustes Generales para Celulares */
@media (max-width: 768px) {
  /* Footer vertical */
  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  /* Botón carrito flotante */
  .carrito {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10001 !important;
    transform: scale(0.85);
  }

  /* Bandeja carrito (Ocupa todo en móvil) */
  .sidebar-carrito {
    width: 100% !important;
    right: -100% !important;
  }
  .sidebar-carrito.active {
    right: 0 !important;
  }
}

/* Ajustes Específicos para el Hero (Patitas y Títulos) */
@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.8rem;
  }
  .hero h2::before {
    left: -35px;
    font-size: 1.2rem;
  }
  .hero h2::after {
    right: -35px;
    font-size: 1.2rem;
  }
}

/*ICONOS DE REDES SOCIALES CARRITO Y FOOTER */
/* Mejora de tamaño para iconos en redes sociales */
.footer-social a i {
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

/* Efecto al pasar el mouse por los iconos del footer */
.footer-social a:hover i {
  transform: scale(1.2);
  color: #ff914d;
}

/* Estilo para el icono de WhatsApp en el botón del carrito */
.btn-whatsapp i {
  margin-right: 10px;
  font-size: 1.2rem;
}

.btn-whatsapp {
  background: #25d366; /* Verde WhatsApp */
  color: white;
  border: none;
  padding: 15px;
  width: 100%;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
}

.btn-whatsapp:hover {
  background: #128c7e;
}
/* --- FAVORITOS ESTILO INSTAGRAM --- */
.btn-favorito {
  background: white;
  border: 2px solid #000;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/*Boton de videos*/
.btn-video-flotante {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 5;
  background: #ff914d;
  color: white !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-weight: bold;
}

.btn-video-flotante:hover {
  background: #ff4d4d;
  transform: scale(1.05);
}

.btn-favorito.activo {
  background: #ff4d4d;
  border-color: #ff4d4d;
  color: white;
  transform: scale(1.1);
}

/* Sección: Bandeja Superior de Favoritos */
.seccion-favoritos {
  background: #fff;
  padding: 20px;
  margin: 20px auto;
  max-width: 1200px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 2px dashed #ff914d;
}

.favoritos-grid {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0;
}

.fav-vacio-msj {
  text-align: center;
  color: #888;
  font-style: italic;
  width: 100%;
}
/* Forzar que los resultados de búsqueda mantengan el diseño de tarjetas */
/* Ajuste para que los productos no se estiren si hay pocos */
#lista-busqueda.productos-grid {
  display: grid !important;
  /* Cambiamos auto-fit por auto-fill y limitamos el máximo a 300px */
  grid-template-columns: repeat(auto-fill, minmax(250px, 300px)) !important;
  gap: 20px;
  padding: 20px;
  justify-content: center; /* Esto los centra si prefieres, o usa flex-start para la izquierda */
}

/* Evitar que las imágenes se estiren fuera de la tarjeta */
#lista-busqueda .producto img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 15px 15px 0 0;
}

/* Descripción dentro de Fancybox */
.fancy-descripcion {
  padding: 20px;
  background: rgba(40, 40, 40, 0.9); /* Gris minimalista con transparencia */
  color: white;
  border-radius: 10px;
  max-width: 300px;
}

.fancy-descripcion h4 {
  color: #ff914d;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Forzar que el video ocupe el espacio correcto */

/* Ajuste para que el texto en la ventana del video sea legible */

.fancybox__content > video {
  margin-bottom: 40px !important; /* Deja espacio para el texto abajo */
}

/* --- DISEÑO PERSONALIZADO FANCYBOX WANCOS --- */

/* 1. Recuadro Rojo: Descripción a la izquierda con estilo minimalista */
.fancybox__caption {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 350px !important; /* Espacio para el recuadro rojo */
  height: 100%;
  background: rgba(20, 20, 20, 0.95) !important; /* Fondo oscuro */
  padding: 40px 20px !important;
  text-align: left !important;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-right: 2px solid #ff914d; /* Línea naranja divisoria */
}

/* Estilo del Título (Naranja) y Texto (Blanco) dentro del caption */
.fancybox__caption h4,
.fancybox__caption strong {
  color: #ff914d !important;
  font-size: 1.4rem;
  margin-bottom: 15px;
  display: block;
}

.fancybox__caption p {
  color: #ffffff !important;
  line-height: 1.6;
  font-size: 1rem;
}

/* 2. Recuadro Verde: Espacio para la imagen/video al centro */
.fancybox__content {
  margin-left: 350px !important; /* Deja espacio para la descripción roja */
  background: transparent !important;
}

/* 3. Recuadro Azul: Miniaturas en la parte inferior */
.fancybox__thumbs {
  background: rgba(0, 0, 0, 0.5) !important;
  padding: 10px 0 !important;
}

/* 4. Recuadros Amarillos: Mantener controles visibles */
.fancybox__toolbar,
.fancybox__nav {
  color: #fff !important;
  text-shadow: 1px 1px 2px #000;
}

/* Ajuste para móviles: Si la pantalla es pequeña, volvemos al diseño normal */
@media (max-width: 900px) {
  .fancybox__caption {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    border-right: none;
    border-top: 2px solid #ff914d;
  }
  .fancybox__content {
    margin-left: 0 !important;
  }
}
