/* ==========================================
   ESTILOS GENERALES Y LAYOUT
   ========================================== */
body {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================
   HEADER
   ========================================== */
.site-header {
    background-color: #ffffff;
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

.logo-container img {
    height: 40px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #d32f2f;
}

.btn-cotiza {
    background-color: #d32f2f;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.btn-cotiza:hover {
    background-color: #b71c1c;
}

/* ==========================================
   BUSCADOR Y FILTROS
   ========================================== */
.buscador-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: center;
}

.buscador-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#input-buscador {
    width: 100%;
    max-width: 600px;
    padding: 12px 15px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

#input-buscador:focus {
    outline: none;
    border-color: #d32f2f;
}

#btn-buscar {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#btn-buscar:hover {
    background-color: #b71c1c;
}

.limpiar-busqueda-container {
    margin-top: 8px;
    text-align: right;
    max-width: 685px;
    margin-left: auto;
    margin-right: auto;
}

#enlace-limpiar {
    color: #888;
    font-size: 0.85rem;
    text-decoration: none;
}

#enlace-limpiar:hover {
    color: #fff;
    text-decoration: underline;
}

.filtros-categorias {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-filtro {
    background-color: #1e1e1e;
    color: #bbb;
    border: 1px solid #333;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-filtro:hover, .btn-filtro.activo {
    background-color: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

/* ==========================================
   CATÁLOGO (GRID DE PRODUCTOS)
   ========================================== */
.contenedor-grid {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #555;
}

.card-img-container {
    width: 100%;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.card img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    will-change: transform;
}

.etiquetas-contenedor {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.etiqueta-marca, .etiqueta-categoria {
    font-size: 0.75rem;
    background-color: #2a2a2a;
    color: #aaa;
    padding: 3px 8px;
    border-radius: 4px;
}

.card h3 {
    font-size: 1rem;
    margin: 5px 0 10px 0;
    color: #fff;
    line-height: 1.3;
}

.precio-unidad {
    font-size: 1.1rem;
    font-weight: bold;
    color: #76ff03;
    margin: 0 0 12px 0;
}

.controles-cantidad {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #2a2a2a;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 12px;
}

.btn-cantidad {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 8px;
}

.cantidad-display {
    font-weight: bold;
    font-size: 1rem;
}

.btn-accion {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.btn-accion:hover {
    background-color: #b71c1c;
}

.btn-accion:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
}

/* ==========================================
   BOTÓN FLOTANTE Y CARRITO LATERAL (DRAWER)
   ========================================== */
.btn-carrito-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #d32f2f;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-carrito-flotante:hover {
    transform: scale(1.08);
    background-color: #b71c1c;
}

.carrito-contenedor {
    position: fixed;
    top: 135px;
    right: -420px;
    width: 350px;
    height: calc(100vh - 180px);
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px 0 0 16px;
    box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.6);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.carrito-contenedor.abierto {
    right: 0;
}

.carrito-header-superior {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    flex-shrink: 0;
}

#lista-pedido {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 15px;
    padding-right: 5px;
}

.total-container {
    flex-shrink: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

#btn-ir-cotizacion {
    flex-shrink: 0;
}

.btn-seguir-comprando {
    background-color: transparent;
    color: #aaa;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-seguir-comprando:hover {
    background-color: #333;
    color: #fff;
    border-color: #666;
}

.btn-cerrar-carrito {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.btn-cerrar-carrito:hover {
    color: #fff;
}

.vacio {
    color: #777;
    text-align: center;
    margin-top: 20px;
}

/* ========================================== */
/* ESTILOS DEL FOOTER                         */
/* ========================================== */
.footer-sitio {
    background-color: #000000;
    border-top: 1px solid #333333; /* Línea gris divisoria */
    padding: 15px 25px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 40px;
}

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

.footer-izquierda,
.footer-derecha {
    color: #888888; /* Texto gris legible pero que no resalta demasiado */
    font-size: 0.85rem;
    font-family: inherit;
}

/* Ajuste responsive para pantallas pequeñas (móviles) */
@media (max-width: 768px) {
    .footer-contenido {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================== */
/* BOTÓN GO TO TOP                            */
/* ========================================== */
#btn-go-top {
    position: fixed;
    bottom: 85px;
    left: 25px; /* Ubicado a la izquierda */
    z-index: 999;
    background-color: #cccccc; /* Color gris */
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

#btn-go-top.visible {
    opacity: 1;
    visibility: visible;
}

#btn-go-top:hover {
    background-color: #e0e0e0;
    transform: scale(1.08);
}

/* ========================================== */
/* ESTILOS DEL BOTÓN Y POPUP DE ESPECIFICACIONES */
/* ========================================== */
.btn-especificaciones {
    width: 100%;
    background-color: #333333;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.btn-especificaciones:hover {
    background-color: #555555;
}

/* Fondo oscurecido (60%) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.activo {
    opacity: 1;
    visibility: visible;
}

/* Contenedor del Pop-up */
.modal-popup {
    background-color: #1a1a1a;
    color: #ffffff;
    width: 90%;
    max-width: 850px;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 90vh;
    overflow-y: auto;
}

/* Botón X de cierre en esquina superior izquierda */
.btn-cerrar-modal {
    position: absolute;
    top: 15px;
    left: 20px;
    background: transparent;
    border: none;
    color: #aaaaaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-cerrar-modal:hover {
    color: #ffffff;
}

/* Estructura de dos columnas */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 15px;
    align-items: center;
}

.modal-img-container img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #222;
    padding: 10px;
}

.modal-info-container h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.modal-precio {
    font-size: 1.2rem;
    color: #76ff03;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Especificaciones técnicas abajo */
.modal-especificaciones-tecnicas {
    margin-top: 25px;
    border-top: 1px solid #333333;
    padding-top: 20px;
}

.modal-especificaciones-tecnicas h4 {
    font-size: 1.1rem;
    color: #ff9800;
    margin-bottom: 12px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9rem;
}

.specs-item {
    background-color: #262626;
    padding: 8px 12px;
    border-radius: 6px;
}

.specs-item span {
    color: #aaa;
    display: block;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .specs-grid {
        grid-template-columns: 1fr;
    }
    .btn-cerrar-modal {
        left: auto;
        right: 15px;
    }
}

/* ========================================== */
/* ESTILOS DEL SLIDER DE ANCHO COMPLETO */
/* ========================================== */
.slider-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #111;
    margin-bottom: 30px;
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: none; /* Se controlará mediante clase activa o translate */
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra perfectamente los 250px sin deformarse */
}

/* Botones de navegación (Flechas) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    font-size: 1.5rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.slider-btn:hover {
    background-color: rgba(255, 152, 0, 0.8);
}

.slider-btn-prev {
    left: 15px;
}

.slider-btn-next {
    right: 15px;
}

/* Puntos indicadores centrados */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.dot.active {
    background-color: #ff9800;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .slider-container {
        height: 180px; /* Ajuste opcional para móviles si se prefiere más compacto, o dejar en 250px */
    }
}

/* ========================================== */
/* BACKGROUND GENERAL CON OVERLAY OBSCURO 80% */
/* ========================================== */
body {
    background-image: url('imagenes/background-sitio.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #ffffff;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Eliminamos position: relative del body para evitar conflictos de apilamiento */
}

/* Overlay obscuro al 75% fijo en la pantalla */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.80);
    z-index: 1; /* El overlay se queda en la capa 1 */
    pointer-events: none; /* Permite hacer clics a través de él */
}

/* 
  SOLUCIÓN GLOBAL: 
  En lugar de buscar clase por clase, elevamos todo elemento directo 
  que esté dentro del body (headers, contenedores, títulos, cajas de mayoreo, 
  slider, catálogos, footers) a la capa 2 para que estén siempre sobre el overlay.
*/
body > * {
    position: relative;
    z-index: 2; 
}

/* El modal de especificaciones debe tener el z-index más alto de todo el sitio */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6); /* Oscurecimiento del 60% para el pop-up */
    z-index: 9999; /* Por encima de todo */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.activo {
    opacity: 1;
    visibility: visible;
}

/* ========================================== */
/* ESTILOS DEL BOTÓN FLOTANTE DE PROMOCIÓN */
/* ========================================== */
.btn-flotante-promo {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background-color: #000000; /* Fondo negro */
    color: #76ff03; /* Letras color verde brillante */
    border: 1px solid #76ff03; /* Borde muy fino color #76ff03 */
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: background-color 0.2s ease, transform 0.2s ease;
    animation: rebotarPromo 12s infinite ease-in-out;
}

.btn-flotante-promo:hover {
    background-color: #1a1a1a; /* Negro un poco menos obscuro para el hover */
    color: #76ff03; /* Se mantienen las letras intactas sin cambiar de color */
    transform: scale(1.05);
}

/* Animación de rebote sutil cada 12 segundos */
@keyframes rebotarPromo {
    0%, 90%, 100% {
        transform: translateY(0);
    }
    93% {
        transform: translateY(-10px);
    }
    96% {
        transform: translateY(-5px);
    }
}

/* Estilo específico para el contenido del pop-up de promoción */
.modal-promo-popup {
    max-width: 650px;
    padding: 25px;
    text-align: center;
}

.promo-img-container img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 10px;
}

