/* =========================================
   CONFIGURACIÓN BASE
   ========================================= */
body {
    background-color: #111316; /* Dark Depth */
    color: #8D99AE;
    font-family: 'Poppins', sans-serif;
}

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.5px;
}

.text-brand { color: var(--bx-brand); }
.catalog-wrapper {
    margin-top: -85px; /* Detrás del header */
    padding-top: 100px;
}

/* =========================================
   1. SIDEBAR (FILTROS COCKPIT PROFESIONAL)
   ========================================= */
.bx-filter-card {
    background: linear-gradient(145deg, #1a1d21 0%, #15181e 100%);
    border: 1px solid rgba(255, 31, 46, 0.2);
    border-radius: 16px;
    padding: 28px;
    position: sticky;
    top: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s ease;
}

.bx-filter-card:hover {
    border-color: rgba(255, 31, 46, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(255, 31, 46, 0.1);
}

/* Header del filtro */
.bx-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 31, 46, 0.2);
}

.bx-filter-title {
    display: flex;
    align-items: center;
}

.bx-filter-icon {
    color: var(--bx-brand);
    font-size: 1.4rem;
    margin-right: 12px;
    text-shadow: 0 0 10px rgba(255, 31, 46, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(255, 31, 46, 0.5)); }
    to { filter: drop-shadow(0 0 10px rgba(255, 31, 46, 0.8)); }
}

.bx-filter-label {
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bx-filter-sub {
    font-size: 0.75rem;
    color: #8D99AE;
    margin-top: 2px;
}

.bx-filter-clear {
    background: rgba(255, 31, 46, 0.1);
    border: 1px solid rgba(255, 31, 46, 0.3);
    color: var(--bx-brand);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.bx-filter-clear:hover {
    background: var(--bx-brand);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 31, 46, 0.4);
}

.bx-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 20px 0;
}

.bx-filter-section-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bx-filter-section-title i {
    color: var(--bx-yellow);
    margin-right: 8px;
    font-size: 0.85rem;
}

/* Checkboxes Personalizados */
.bx-check-row {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 12px;
    transition: 0.2s;
}

.bx-check { display: none; } /* Ocultar default */

.bx-check-ui {
    width: 18px; height: 18px;
    border: 2px solid #444;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: 0.2s;
}

.bx-check:checked + .bx-check-ui {
    background: var(--bx-brand);
    border-color: var(--bx-brand);
    box-shadow: 0 0 10px rgba(255, 31, 46, 0.4);
}

.bx-check:checked + .bx-check-ui::after {
    content: '✔';
    position: absolute;
    top: -3px; left: 2px;
    color: white;
    font-size: 12px;
}

.bx-check-text {
    font-size: 0.9rem;
    color: #aaa;
}

.bx-check-row:hover .bx-check-text { color: white; }

/* Buscador Sidebar Mejorado */
.bx-search-sidebar {
    position: relative;
}

.bx-search-sidebar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 12px 45px 12px 15px;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.bx-search-sidebar input:focus {
    outline: none;
    border-color: var(--bx-brand);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 31, 46, 0.2);
}

.bx-search-sidebar input::placeholder {
    color: #6c757d;
}

.bx-search-sidebar button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--bx-brand);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
}

.bx-search-sidebar button:hover {
    color: var(--bx-yellow);
    transform: translateY(-50%) scale(1.1);
}

/* =========================================
   RANGO DE PRECIO PROFESIONAL Y MODERNO
   ========================================= */
.bx-price-range-container {
    margin-top: 10px;
}

.bx-price-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 31, 46, 0.1) 0%, rgba(255, 214, 0, 0.05) 100%);
    border: 1px solid rgba(255, 31, 46, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.bx-price-box {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.bx-price-box:hover {
    background: rgba(255, 31, 46, 0.2);
    border-color: var(--bx-brand);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 31, 46, 0.3);
}

.bx-price-label {
    display: block;
    font-size: 0.7rem;
    color: #8D99AE;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 5px;
}

.bx-price-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bx-yellow);
    text-shadow: 0 0 10px rgba(255, 214, 0, 0.4);
    font-family: 'Montserrat', sans-serif;
}

.bx-price-separator {
    color: var(--bx-brand);
    font-size: 1rem;
    opacity: 0.6;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.bx-range-wrap {
    position: relative;
    height: 30px;
    padding: 10px 0;
}

.bx-range-track {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #2a2d35 0%, #3a3d45 50%, #2a2d35 100%);
    border-radius: 10px;
    transform: translateY(-50%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bx-range-fill {
    position: absolute;
    top: 50%;
    height: 6px;
    background: linear-gradient(90deg, var(--bx-brand) 0%, var(--bx-yellow) 100%);
    border-radius: 10px;
    transform: translateY(-50%);
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 31, 46, 0.5);
    transition: all 0.3s ease;
}

.bx-range {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.bx-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid var(--bx-brand);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(255, 31, 46, 0.2);
    transition: all 0.2s ease;
}

.bx-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 31, 46, 0.6), 0 0 0 6px rgba(255, 31, 46, 0.3);
    border-color: var(--bx-yellow);
}

.bx-range::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(255, 31, 46, 0.8), 0 0 0 8px rgba(255, 31, 46, 0.4);
}

.bx-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid var(--bx-brand);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(255, 31, 46, 0.2);
    transition: all 0.2s ease;
}

.bx-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 31, 46, 0.6), 0 0 0 6px rgba(255, 31, 46, 0.3);
    border-color: var(--bx-yellow);
}

.bx-range::-moz-range-track {
    background: transparent;
}

/* Botón Filtro Móvil */
.btn-filter-mobile {
    background: #15181e;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}


/* =========================================
   2. BANNER PRINCIPAL (CORREGIDO)
   ========================================= */
.bx-hero-banner {
    position: relative;
    /* height: 250px;  <-- LO QUITAMOS DE AQUÍ, YA ESTÁ EN EL CSS INLINE */
    border-radius: 12px;
    overflow: hidden;
    
    /* ❌ BORRAR ESTA LÍNEA ANTIGUA: */
    /* background: url('https://i.ibb.co/xPz58HB/catalogo-banner.webp') center/cover; */
    
    /* ✅ AGREGAR ESTO NUEVO: */
    background-color: #1a1d21; /* Color de fondo mientras carga */
    
    display: flex;
    align-items: center;
    padding: 0 40px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Modificar el overlay para que funcione sin imagen en móvil */
.bx-hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Degradado más oscuro abajo para que el texto resalte sobre el fondo negro */
    background: linear-gradient(90deg, rgba(17,19,22,0.95) 0%, rgba(17,19,22,0.6) 100%);
    z-index: 1;
    pointer-events: none; /* Dejar pasar clicks */
}

/* Media Query Móvil */
@media (max-width: 991px) {
    .bx-hero-overlay {
        /* Degradado vertical para móvil */
        background: linear-gradient(0deg, rgba(17,19,22,1) 10%, rgba(17,19,22,0.4) 100%) !important;
    }
}

.bx-hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.badge-cat {
    background: rgba(255, 214, 0, 0.2);
    color: var(--bx-yellow);
    padding: 4px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
}

.bx-hero-title {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    margin: 10px 0;
    text-transform: uppercase;
}

.bx-hero-subtitle {
    color: #ccc;
    font-size: 1rem;
    margin-bottom: 25px;
}

/* =========================================
   FIX MÓVIL: BANNER CATÁLOGO
   ========================================= */
@media (max-width: 991px) {

    .bx-hero-banner {
        /* 1. Quitamos la altura fija para que crezca según el texto */
        height: auto !important;
        min-height: auto !important;
        
        /* 2. Damos espacio interno arriba y abajo */
        padding: 50px 20px !important;
        
        /* 3. Centramos el texto */
        text-align: center;
        justify-content: center; /* Centrar contenido flex */
    }

    .bx-hero-overlay {
        /* 4. CAMBIO IMPORTANTE: 
           En PC el degradado va de Izq a Der. 
           En Móvil lo ponemos de Abajo a Arriba para que se lea bien el texto centrado */
        background: linear-gradient(0deg, rgba(17,19,22,0.98) 20%, rgba(17,19,22,0.7) 100%) !important;
    }

    .bx-hero-content {
        max-width: 100%; /* Usar todo el ancho */
    }

    .bx-hero-title {
        font-size: 1.8rem !important; /* Texto un poco más chico */
        line-height: 1.2;
    }

    .bx-hero-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 30px; /* Separar más del botón */
    }

    /* 5. Botón ancho completo para fácil click */
    .bx-hero-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* =========================================
   3. HEADER RESULTADOS
   ========================================= */
.catalog-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.count-badge {
    background: #202328;
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.custom-select {
    background: #15181e;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}


/* =========================================
   4. TARJETAS DE PRODUCTO (REDISEÑO PRO)
   ========================================= */

.modern-card {
    background: #1a1d21; /* Gris un poco más claro que el fondo */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* Efecto Hover: Sube y brilla */
.modern-card:hover {
    transform: translateY(-5px);
    border-color: var(--bx-brand); /* Borde rojo al hover */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Contenedor de imagen (Fondo blanco para repuestos) */
.card-img-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    height: 160px; /* Altura estándar */
    position: relative;
    overflow: hidden;
}

.card-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

/* Zoom suave en la imagen al pasar mouse */
.modern-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}

/* Tipografía del Producto */
.product-title {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.text-brand {
    color: var(--bx-yellow); /* Precio en amarillo resalta más */
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.15);
}

/* Botón Ver Detalle */
.btn-full {
    width: 100%;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 8px 0;
    text-align: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    transition: 0.3s;
}

.btn-full:hover {
    background: var(--bx-brand);
    border-color: var(--bx-brand);
    color: white;
}

/* =========================================
   RESPONSIVO (AJUSTES PARA MÓVIL 2 COLUMNAS)
   ========================================= */
@media (max-width: 576px) {
    /* Reducir altura de imagen en móvil */
    .card-img-wrapper {
        height: 130px; 
        padding: 5px;
    }

    /* Texto más pequeño para que quepa en col-6 */
    .product-title {
        font-size: 0.85rem; 
    }

    .product-price {
        font-size: 1rem !important; /* Precio sigue siendo importante */
        margin-bottom: 0.5rem !important;
    }
    
    /* Ajuste de badges */
    .badge {
        font-size: 0.55rem !important;
        padding: 3px 5px !important;
    }
    
    /* Botón más compacto */
    .btn-full {
        padding: 5px 0;
        font-size: 0.75rem;
    }
}
/* =========================================
   5. BOTÓN DIAGONAL / SKEW (EL PEDIDO PRINCIPAL)
   ========================================= */
.btn-skew {
    background: transparent;
    border: 1px solid var(--bx-brand);
    color: var(--bx-brand);
    padding: 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex; /* Importante para el centrado */
    align-items: center;
    justify-content: center;
    
    /* LA MAGIA DIAGONAL */
    transform: skewX(-20deg); 
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 2px; /* Pequeño radio */
}

/* Contrarrestar la inclinación en el texto */
.btn-skew span {
    transform: skewX(20deg); /* Inclinación opuesta */
    display: inline-block;
}

.btn-skew:hover {
    background: var(--bx-brand);
    color: white;
    box-shadow: 0 0 15px rgba(255, 31, 46, 0.4);
}

/* Botón "Aplicar" del sidebar - Mejorado */
.bx-apply-btn {
    width: 100%;
    margin-top: 25px;
    background: linear-gradient(135deg, var(--bx-brand) 0%, #D6001C 100%);
    color: white;
    border: none;
    padding: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 31, 46, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bx-apply-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.bx-apply-btn:hover::before {
    left: 100%;
}

.bx-apply-btn:hover {
    background: linear-gradient(135deg, #D6001C 0%, var(--bx-brand) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 31, 46, 0.6);
}

.bx-apply-btn:active {
    transform: translateY(0);
}


/* Botón de la tarjeta de producto (Ancho completo) */
.btn-full {
    width: 100%;
    background: rgba(255, 31, 46, 0.1); /* Fondo rojo muy suave */
    border: 1px solid rgba(255, 31, 46, 0.3);
    color: white;
    font-size: 0.85rem;
}

.btn-full:hover {
    background: var(--bx-brand);
    border-color: var(--bx-brand);
}

/* Responsivo */
@media (max-width: 991px) {
    .bx-filter-card {
        position: static;
        margin-bottom: 20px;
    }
}