/* --- 1. IMPORTS Y RESETEO BASE --- */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: #000000 !important;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  overflow-x: clip !important; /* Evita scroll horizontal sin romper position: sticky */
  height: auto;
}

header {
  overflow: visible;
}

footer {
  width: 100%; 
  min-height: 100px; 
  padding: 0.5rem; 
  color: #ffffff;
  text-align: center;
}

/* --- 2. BARRA DE NAVEGACIÓN (NAVBAR) --- */
nav.navbar {
  width: 100%;
  min-height: 100px;
  padding: 0.5rem;
  background-color: #000000;
}

/* Sticky Navbar */
nav.navbar.sticky-top {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1020 !important; /* Reducido para no bloquear el modal */
}

.navbar-brand img {
  display: block;
  max-width: 340px;
  height: auto;
  object-fit: contain;
  transform: translateY(-4px);
}

.navbar-nav {
  gap: 2rem; /* Espaciado entre links */
}

.nav-item {
  position: relative;
  font-size: 0.80rem;
  font-weight: 500;
}

/* Enlaces principales */
.navbar-nav .nav-link, 
.navbar-nav .nav-link.dropdown-toggle {
  color: gold !important; 
  background: transparent;
}

.navbar-nav .nav-link.active {
  color: gold !important; 
  font-weight: 700 !important; 
}

#navbarNav .navbar-nav .nav-link:hover, 
#navbarNav .navbar-nav .nav-link.dropdown-toggle:hover,
#navbarNav .navbar-nav .nav-link.active:hover {
  color: orange !important; 
  text-decoration: underline;
  transform: scale(1.1);
  transition: transform 0.25s ease, color 0.25s ease;
}

/* Ícono Hamburguesa Dorado */
.navbar-toggler-icon-gold {
  display: inline-block;
  width: 1.8em;
  height: 1.8em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffd700' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* --- 3. MENÚ DROPDOWN (ESCRITORIO) --- */

/* 1. Estado base oculto del contenedor desplegable */
.dropdown-menu {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px); /* Inicia 12px más abajo para hacer un leve despliegue */
  pointer-events: none; /* Evita clicks invisibles cuando está oculto */
  
  background-color: #ffffff !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  padding: 1.2rem 1.8rem !important;
  min-width: 240px;
  
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease !important;
}

.navbar-nav .nav-item.dropdown:hover .dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important; /* Vuelve a su posición original */
  pointer-events: auto !important;
  margin-top: 0;
}

.dropdown-menu .dropdown-item {
  color: #ff9900 !important;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  padding: 0.55rem 0 !important;
  background-color: transparent !important;
  transition: color 0.2s ease, transform 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
  color: #d35400 !important;
  background-color: transparent !important;
  text-decoration: underline !important;
  transform: translateX(4px);
}

/* Bloqueo estricto para botones o links deshabilitados en Navbar */
.navbar .nav-link.disabled,
.navbar .dropdown-item.disabled {
  pointer-events: none !important; /* Desactiva clics y hovers por completo */
  opacity: 0.5 !important;         /* Aspecto atenuado */
  cursor: default !important;
}

/* Evita que si usas hover por CSS se muestre el submenú si el botón está desactivado */
.nav-item.dropdown:has(.disabled) .dropdown-menu,
.nav-item.dropdown:has(.disabled):hover .dropdown-menu {
  display: none !important;
}

/* --- 4. COMPONENTES GENERALES Y BOTONES FLOTANTES --- */

@media (prefers-reduced-motion: reduce) {
  .index-custom-carousel.carousel-fade .carousel-item {
    transition: opacity 0.6s ease-in-out !important;
    animation: none !important;
  }
}

.index-custom-carousel {
  background-color: #000000;
}

.index-custom-carousel .carousel-item img {
  object-fit: cover;
  margin: 0 auto;
}

.index-custom-carousel .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
  opacity: 0.6;
  margin: 0 4px;
}

.index-custom-carousel .carousel-indicators .active {
  opacity: 1;
}

.floating-buttons-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Botón WhatsApp */
.btn-whatsapp {
  position: relative;
  z-index: 2;
  width: 60px !important;
  height: 60px !important;
  background-color: #25D366 !important;
  border-color: #25D366 !important;
  color: #ffffff !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s, background-color 0.3s ease !important;
}

.btn-whatsapp i {
  color: #ffffff !important;
}

.btn-whatsapp:hover {
  background-color: #20ba5a !important;
  border-color: #20ba5a !important;
  color: #ffffff !important;
  transform: scale(1.1) !important;
}

/* Elevación de WhatsApp cuando aparece 'Volver Arriba' */
.floating-buttons-container:has(#btn-back-to-top.show) .btn-whatsapp {
  transform: translateY(-52px) !important;
  transition-delay: 0s !important;
}

.floating-buttons-container:has(#btn-back-to-top.show) .btn-whatsapp:hover {
  transform: translateY(-52px) scale(1.1) !important;
}

/* Botón Volver Arriba */
#btn-back-to-top {
  position: absolute;
  bottom: 0;
  z-index: 1;
  width: 40px !important;
  height: 40px !important;
  background-color: #000000 !important;
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease !important;
}

#btn-back-to-top i {
  color: #ffffff !important;
}

#btn-back-to-top.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  transition-delay: 0.1s, 0.1s, 0s, 0s !important;
}

#btn-back-to-top:hover {
  background-color: #111111 !important;
  transform: scale(1.1) translateY(0) !important;
}

/* --- 5. OFFCANVAS Y CAPAS --- */

.offcanvas, .offcanvas-lg {
  z-index: 1090;
}

.offcanvas-backdrop {
  z-index: 1085;
}

/* --- 6. ADAPTABILIDAD MÓVIL (MEDIA QUERIES) --- */
@media (max-width: 991.98px) {

  .offcanvas.offcanvas-end {
    width: 70% !important;
    max-width: 320px !important;
  }

  .navbar-brand img {
    max-width: 220px;
  }

  /* 1. Enlaces e Íconos Principales en NARANJA (INICIO, NOSOTROS) */
  .custom-offcanvas-menu > .nav-item > .nav-link {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem !important;
    color: #ff9900 !important;
  }

  /* 2. Categorías Estáticas en NARANJA (AUDIO y MÁS) */
  .custom-offcanvas-menu .category-header-title {
    display: block;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem !important;
    color: #ff9900 !important;
    border: none !important;
    pointer-events: none;
    user-select: none;
  }

  .custom-offcanvas-menu .nav-subitem {
    padding-left: 1.25rem;
  }

  /* 3. SUBÍTEMS EN COLOR NEGRO */
  .custom-offcanvas-menu .nav-subitem .nav-link {
    font-size: 0.90rem !important;
    font-weight: 400;
    color: #000000 !important; /* Texto negro */
    padding-top: 6px;
    padding-bottom: 6px;
  }
  
  /* Hover/Feedback táctil de subítems al tocar */
  .custom-offcanvas-menu .nav-subitem .nav-link:hover,
  .custom-offcanvas-menu .nav-subitem .nav-link:active {
    color: #ff9900 !important; /* Cambia a naranja únicamente al presionar */
    text-decoration: underline !important;
    transform: translateX(4px) !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
  }

  .custom-offcanvas-menu .dropdown-menu {
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    background-color: transparent;
    box-shadow: none;
  }

  .custom-offcanvas-menu .dropdown-toggle::after {
    display: none;
  }
}

/* --- 7. PÁGINA CATEGORÍAS Y PRODUCTOS --- */

/* Título de Categoría Principal (Ej: Amplificadores) */
.category-title {
  color: #111111;
  letter-spacing: 1.5px;
  border-bottom-color: #ff9900 !important;
}

/* Contenedor del Banner */
.category-banner-container {
  width: 100%;
  border: 1px solid #ddd;
  background-color: #000;
}

/* Imagen del Banner */
.category-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Botones de Anclas */
.subcategory-btn {
  background: linear-gradient(180deg, #ffe0a3 0%, #ffd27f 100%);
  color: #1a1a1a !important;
  border: 1px solid #d4a359;
  border-radius: 6px;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease-in-out;
}

/* Efecto Hover */
.subcategory-btn:hover {
  background: linear-gradient(180deg, #ffd27f 0%, #fca835 100%);
  border-color: #b88330;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.subcategory-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

div[id] {
  scroll-margin-top: 120px;
}

/* Título del Producto Unificado en una sola línea */
.product-title-full {
  color: #000000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.35rem;
}

/* Precio dentro del título */
.product-price {
  color: #000000;
  font-weight: 800;
}

/* Carrusel de imágenes de productos */
.custom-product-carousel {
  background-color: #000000;
  border-radius: 4px;
}

.custom-product-carousel .carousel-item img {
  max-height: 480px;
  object-fit: cover; /* Para que ningún equipo de audio se corte */
  margin: 0 auto;
}

/* Flechas del carrusel */
.custom-product-carousel .carousel-control-prev-icon,
.custom-product-carousel .carousel-control-next-icon {
  width: 2rem;
  height: 2rem;
  background-color: #000000;
}

/* Puntos indicadores inferiores del carrusel */
.custom-product-carousel .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
  opacity: 0.6;
  margin: 0 4px;
}

.custom-product-carousel .carousel-indicators .active {
  opacity: 1;
}

/* Descripción centrada debajo de la foto */
.product-description p {
  color: #222222;
  line-height: 1.5;
}

/* Ancho máximo cómodo para la lectura de especificaciones */
.max-width-specs {
  max-width: 720px;
}

/* Tamaño de subtítulos secundarios dentro de la ficha de especificaciones */
.fs-7 {
  font-size: 0.85rem;
  color: #555555;
}

/* --- 8. ESTILOS GENERALES DE SECCIONES DE MÁS --- */

/* Borde dorado suave */
.border-gold {
  border: 1px solid #d4a359 !important;
}

.border-gold-bottom {
  border-bottom: 2px solid #d4a359 !important;
}

/* Colores de texto */
.text-gold {
  color: #e0b86c !important;
}

/* Fondo degradado dorado para los headers de las tarjetas */
.bg-gradient-gold {
  background: linear-gradient(180deg, #ffe0a3 0%, #ffd27f 100%) !important;
}

/* Botón grande de WhatsApp */
.btn-whatsapp-action {
  background-color: #25D366 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  font-size: 1.5rem !important; /* fs-4 */
  transition: all 0.3s ease-in-out;
}

.btn-whatsapp-action:hover {
  background-color: #1eb956 !important;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4) !important;
}

/* Ajustes de tamaño de texto global para estas secciones */
.text-large-body {
  font-size: 1.25rem !important; /* fs-5 */
}

.text-extra-large {
  font-size: 1.5rem !important; /* fs-4 */
}

/* --- 9. MODAL Z-INDEX Y SCROLL --- */

/* Bloquea estrictamente el scroll del fondo cuando el modal está activo */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
  padding-right: 0px !important;
}

/* Forzar al Header/Navbar a mantenerse fijo sin empujar elementos */
header, 
nav, 
.navbar, 
.fixed-top, 
.sticky-top {
  padding-right: 0px !important;
  margin-right: 0px !important;
  top: 0 !important;
}

/* Fondo oscuro del modal sobre la Navbar */
.modal-backdrop {
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9998 !important; /* Por encima de navbar (1020) */
}

/* Ventana emergente en la capa más alta de la pantalla */
.modal {
  padding-right: 0px !important;
  z-index: 9999 !important; /* Capa superior absoluta */
}

/* Contenedor de imagen con proporción estricta 16:9 */
.modal-16-9-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Ajuste de imagen para llenar el marco 16:9 sin deformar */
.modal-16-9-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Estilo completo del aviso de próximos productos */
#proximos {
  width: 100%;
  max-width: 1320px;
  margin: 1rem auto;
  padding: 0 0.75rem;
  background-color: #ff9c38;
  text-align: center;
}

#proximos h3 {
  display: inline-block;
  margin: 0;
  padding-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}