/* Espaciado para el contenido principal debajo del header fijo */
main {
  /* Espacio para el header + nav en VISTA DE COMPUTADOR */
  padding-top: 1px;
}

@media (max-width: 992px) {
  main {
    /* Espacio SOLO para el header en VISTA MÓVIL (porque el nav se oculta) */
    padding-top: 138px;
  }
}
/* --- HERO SECTION --- */
.hero-slider {
  position: relative;
  width: 100%;
  max-height: 500px;
  overflow: hidden;
}
.hero-slide {
  display: none;
  width: 100%;
}
.hero-slide.active {
  display: block;
  animation: fadeIn 0.8s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}
.hero-slide img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.slider-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.slider-dot.active {
  background-color: var(--orange);
}

/* --- SECCIONES GENÉRICAS DEL CONTENIDO DEL HOME --- */
.section {
  padding: 4rem 0;
}
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--orange);
  border-radius: 2px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}
.section-header .section-title {
  margin-bottom: 0;
  text-align: left;
}
.section-header .section-title::after {
  display: none;
}
.view-all-button {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--orange);
  background-color: var(--white);
  border: 2px solid var(--orange);
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
}
.view-all-button:hover {
  background-color: var(--orange);
  color: var(--white);
}

/* --- CARRUSEL DE PRODUCTOS (MODIFICADO) --- */

/* Contenedor relativo para posicionar las flechas */
.carousel-wrapper {
  position: relative;
  width: 100%;
}

/* Convertimos la grilla en una fila con scroll */
.product-grid {
  display: flex; /* Fila horizontal */
  overflow-x: auto; /* Permite scroll horizontal */
  gap: 1.5rem;
  padding: 1rem 0.5rem 2rem 0.5rem; /* Padding abajo para la sombra */
  scroll-behavior: smooth; /* Suavidad nativa */
  scroll-snap-type: x mandatory; /* Efecto imán */
  -webkit-overflow-scrolling: touch; /* Suavidad en iPhone */

  /* Ocultar barra de scroll visualmente pero mantener funcionalidad */
  scrollbar-width: none; /* Firefox */
}
.product-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* Ajuste de las tarjetas para el carrusel */
.product-card {
  flex: 0 0 280px; /* Ancho FIJO en escritorio para que no se aplasten */
  scroll-snap-align: start; /* El imán se pega al inicio de la tarjeta */
  /* Mantén tus estilos anteriores de borde y sombra aquí */
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

/* --- FLECHAS DE NAVEGACIÓN (SOLO DESKTOP) --- */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: white;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--orange);
  transition: all 0.3s ease;
  opacity: 0.9;
}
.scroll-btn:hover {
  background-color: var(--orange);
  color: white;
  transform: translateY(-50%) scale(1.1);
}
.scroll-btn.left {
  left: -20px;
}
.scroll-btn.right {
  right: -20px;
}

/* Ocultar flechas si no hay hover (opcional, moderno) */
.carousel-wrapper:hover .scroll-btn {
  opacity: 1;
}

/* --- VISTA MÓVIL (EFECTO PEEK) --- */
@media (max-width: 768px) {
  .product-grid {
    gap: 1rem;
    padding-right: 2rem; /* Espacio al final */
  }

  .product-card {
    flex: 0 0 85%; /* En móvil ocupa el 85% del ancho para ver el borde del siguiente (PEEK) */
    max-width: 320px;
  }

  .scroll-btn {
    display: none; /* En móvil se usa el dedo, no flechas */
  }

  /* Ajuste del header para quitar botón ver todo y centrar */
  .section-header {
    justify-content: center; /* Centrar título si ya no hay botón */
  }
  .section-title {
    text-align: center !important;
  }
}

/* --- Etiquetas de Descuento y Estado --- */
.discount-tag,
.status-tag {
  position: absolute;
  color: var(--white);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-title);
  border-radius: 6px;
  z-index: 10;
}
.discount-tag {
  top: 12px;
  right: 12px;
  background-color: var(--orange);
}
.status-tag {
  top: 12px;
  left: 12px;
  background-color: #007bff;
}
.status-tag.recommended {
  background-color: #6f42c1;
}
.product-card:hover .product-image img {
  transform: scale(1.1);
  transition: transform 0.5s ease;
}
/* --- Área de Información de Producto --- */
.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}
.product-name {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  min-height: 40px;
  margin-bottom: 0.5rem;
}
.price-section {
  margin-bottom: 0.5rem;
}
.old-price {
  font-size: 0.9rem;
  color: #888;
  text-decoration: line-through;
  display: block;
}
.current-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--black);
}
.product-info .spacer {
  flex-grow: 1;
}
.shipping-info {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.shipping-info .shipping-icon {
  width: 20px;
  height: 20px;
  stroke: var(--orange);
}

/* --- ESTILOS PARA HOVER DE IMAGEN DE PRODUCTO --- */
.product-image {
  position: relative;
  background-color: var(--white);
  height: 250px;
  width: 100%;
  overflow: hidden; /* Asegura que nada se salga */
}

/* Esta regla asegura que cualquier imagen dentro se comporte bien */
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Mantiene la proporción sin estirarse */
  display: block;
}
.product-image .img-primary,
.product-image .img-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem; /* Padding interno a la imagen para que no toque los bordes */
  transition: opacity 0.3s ease-in-out;
  backface-visibility: hidden;
  z-index: 1; /* Asegura que esté visible sobre el fondo */
}

/* Por defecto, la imagen principal es visible */
.product-image .img-primary {
  opacity: 1;
}

/* Por defecto, la imagen secundaria está oculta */
.product-image .img-hover {
  opacity: 0;
  z-index: 2; /* Al aparecer, queda encima */
}

/* AL HACER HOVER */
.product-card:hover .product-image .img-primary {
  opacity: 0;
}
.product-card:hover .product-image .img-hover {
  opacity: 1;
}

/* --- Banners de Categorías --- */
.section-subtitle {
  text-align: center;
  max-width: 600px;
  margin: -1.5rem auto 2.5rem;
  font-size: 1.1rem;
  color: #555;
}
.category-banner {
  border-radius: var(--border-radius);
  margin: 0 auto 2.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}
.category-banner:hover {
  transform: scale(1.02);
}
.view-more-container {
  text-align: center;
  margin-top: 3rem;
}
.view-more-button {
  display: inline-block;
  padding: 0.75rem 2.5rem;
  background-color: var(--orange);
  color: var(--white);
  border-radius: 50px;
  font-weight: 700;
  font-family: var(--font-title);
  transition:
    background-color 0.3s,
    transform 0.3s;
}
.view-more-button:hover {
  background-color: #d94a1a;
  transform: scale(1.05);
}

/* ==================================================================== */
/* ===== ESTILOS PARA LA SECCIÓN DE CLIPS ===== */
/* ==================================================================== */
.section-clips {
  background-color: #f9f9f9;
}
.swiper-container {
  width: 100%;
  overflow: hidden;
}
.video-clips-grid {
  display: flex;
}
.swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  position: relative;
}
.video-clip-container {
  position: relative;
  padding-top: 177.78%;
  background-color: #e9e9e9;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.clip-thumbnail,
.clip-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clip-thumbnail {
  z-index: 3;
  transition: opacity 0.4s ease;
}
.clip-video {
  z-index: 1;
}
.clip-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: white;
  padding: 1.5rem 1rem 1rem;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 4;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.video-clip-container:not(.is-playing):hover .play-overlay,
.video-clip-container.is-paused .play-overlay {
  opacity: 1;
}
.play-button {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--orange);
}
.sound-control {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}
.video-clip-container.is-playing .sound-control {
  opacity: 1;
}
.video-clip-container.is-playing .clip-thumbnail,
.video-clip-container.is-playing .clip-title,
.video-clip-container.is-playing .play-overlay {
  opacity: 0;
  pointer-events: none;
}
.video-clip-container.is-paused:not(:hover) .play-overlay {
  opacity: 0;
}

/* Navegación del Carrusel (Solo visible en Desktop) */
.clips-navigation {
  display: none;
  gap: 0.5rem;
}
.swiper-button-next,
.swiper-button-prev {
  position: static;
  margin: 0;
  width: 40px;
  height: 40px;
  background-color: var(--white);
  border: 1px solid #ddd;
  border-radius: 50%;
  color: var(--orange);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
  background-color: var(--orange);
  color: var(--white);
}
.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 1rem;
  font-weight: 800;
}

/* Media Queries para cambiar de carrusel a grid */
@media (min-width: 769px) {
  #clips-grid.swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .clips-navigation {
    display: flex;
  }
}
/* Media queries para secciones y productos */
@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
  .section {
    padding: 3rem 0;
  }
  .hero-slider {
    max-height: 400px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .section-header {
    margin-bottom: 1.5rem;
  }
  .section-header .section-title {
    font-size: 1.5rem;
  }
  .view-all-button {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
}

/* ==================================================================== */
/* ===== ESTILOS PARA PRODUCTOS SIN STOCK ===== */
/* ==================================================================== */

/* Badge de Sin Stock en tarjetas */
.out-of-stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ef4444;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-title);
  z-index: 10;
}

/* Tarjeta de producto sin stock */
.product-card.out-of-stock .product-image img {
  opacity: 0.6;
  filter: grayscale(20%);
}

.product-card.out-of-stock:hover .product-image img {
  transform: scale(1.05);
}

/* Mensaje de disponibilidad */
.out-of-stock-message {
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
