.site-nav.navbar.navbar-expand-lg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1100 !important;
    background: #f8f9fa !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid #e5e7eb !important;
    transition: all 0.3s ease !important;
}

body {
    padding-top: 80px !important;
    background-color: #f5f5f5 !important; /* Fondo gris como ML */
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevenir desbordamiento horizontal en móvil */
@media (max-width: 991px) {
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    html {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .main {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* ===== CONTENEDOR PRINCIPAL CON LAYOUT INTEGRADO ===== */
.main {
    position: relative;
    margin-top: 50px;
    background-color: #f5f5f5;
    min-height: calc(100vh - 80px);
}

.catalog {
    position: relative;
    background-color: #f5f5f5;
    min-height: calc(100vh - 80px);
    padding-top: 0px !important;
}

/* ===== PANEL LATERAL INTEGRADO ===== */
.catalog__side-filter {
    position: fixed;
    top: 80px !important;
    left: -320px;
    width: 320px;
    height: calc(100vh - 80px) !important;
    background: #f5f5f5 !important; /* Mismo fondo que el body */
    border: none !important; /* Sin bordes separadores */
    box-shadow: none !important; /* Sin sombra separadora */
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important; /* Asegurar que siempre esté visible cuando active */
}

    .catalog__side-filter.active {
        left: 0;
    }

/* Overlay base - oculto por defecto */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ===== CONTENIDO DEL SIDEBAR SIN SEPARACIÓN VISUAL ===== */
.side-filter {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
    overflow-y: auto;
    max-height: 100%;
    margin-top: 28px; /* Ajusta este valor según necesites */
    border-radius: 0;
}

/* Header del sidebar integrado */
.side-filter__header {
    padding: 1rem;
    border: none !important; /* Sin separación visual */
    background: transparent !important; /* Fondo transparente */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* No sticky para que sea parte del scroll general */
    margin-bottom: 0.5rem;
}

.side-filter__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.side-filter__close {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #6b7280;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

    .side-filter__close:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
    }

/* Secciones del filtro integradas */
.side-filter__section {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #fff; /* Fondo blanco para las secciones */
    border-radius: 8px; /* Bordes redondeados como ML */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Sombra sutil */
    animation: fadeInUp 0.3s ease;
    width: 280px;
}

/* Secciones del filtro integradas */
.side-filter__section2 {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.3s ease;
    width: 280px; /* ← tal cual lo pusiste */
    box-sizing: border-box;
}

.side-filter__section:last-child {
    margin-bottom: 1rem;
}

.no-scroll-x {
    overflow-x: hidden;
}

.side-filter__label {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block;
}

.side-filter__selects {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .side-filter__selects .form-select {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid #d1d5db;
        border-radius: 0.375rem;
        background: #fff;
        transition: border-color 0.2s, background-color 0.3s, opacity 0.3s;
    }

        .side-filter__selects .form-select.filter-loading {
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
            background-size: 200% 100% !important;
            border-color: #d0d0d0 !important;
            opacity: 0.85 !important;
            position: relative !important;
            overflow: hidden !important;
            animation: shimmer-loading-bg 1.5s infinite !important;
            pointer-events: none !important;
            color: transparent !important;
            cursor: wait !important;
            min-height: 38px !important;
        }

            .side-filter__selects .form-select.filter-loading::after {
                content: '' !important;
                position: absolute !important;
                top: 0 !important;
                left: -100% !important;
                width: 100% !important;
                height: 100% !important;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent) !important;
                animation: shimmer-sweep 1.5s infinite !important;
                z-index: 10 !important;
                pointer-events: none !important;
            }

@keyframes shimmer-loading-bg {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.side-filter__selects .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* ===== CONTENEDOR PRINCIPAL AJUSTADO ===== */
.catalog__container {
    transition: margin-left 0.3s ease, max-width 0.3s ease;
    width: 100%;
    background-color: #f5f5f5;
    min-height: calc(100vh - 80px);
}

    .catalog__container.sidebar-active {
        margin-left: 340px; /* Espacio para el sidebar + padding */
        max-width: calc(100vw - 340px);
    }

        .catalog__container.sidebar-active .catalog__products-row,
        .catalog__container.sidebar-active .jsListRow,
        .catalog__container.sidebar-active .tab-content {
            width: 100%;
            max-width: 100%;
        }

.tab-content > .active {
    width: 100%;
}

.catalog__container.sidebar-active .catalog__products-row .col,
.catalog__container.sidebar-active .catalog__products-row [class*="col-"] {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
}

.catalog__container.sidebar-active .jsListRow .row {
    margin: 0;
    width: 100%;
}

.catalog__container.sidebar-active .catalog__list-col {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filters-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 1%;
}

/* Asegurar que el botón de filtros sea visible en móvil */
@media (max-width: 991px) {
    .filters-toggle-container {
        display: flex !important;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .btn-toggle-filters {
        display: inline-flex !important;
        z-index: 10;
        position: relative;
        background-color: #fff !important;
        border: 1px solid #6a6a6a !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

        .btn-toggle-filters:hover {
            background-color: #f8f9fa !important;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        }
}

.btn-toggle-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
    color: #333;
    border: 1px solid #6a6a6a;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .btn-toggle-filters span {
        display: inline-block;
    }

    .btn-toggle-filters:hover {
        background: #f8f9fa;
        border-color: #999;
        color: #111827;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .btn-toggle-filters:active {
        background: #f3f4f6;
        transform: translateY(1px);
    }

    .btn-toggle-filters i {
        font-size: 1rem;
        transition: transform 0.2s ease;
    }

    .btn-toggle-filters.active i {
        transform: rotate(90deg);
    }

/* Ocultar botón solo en desktop cuando el sidebar está activo */
@media (min-width: 992px) {
    .catalog__container.sidebar-active .btn-toggle-filters {
        display: none;
    }
}

/* En móvil, ocultar el botón cuando el sidebar está activo */
@media (max-width: 991px) {
    .catalog__container.sidebar-active .btn-toggle-filters,
    .catalog__container.sidebar-active .filters-toggle-container,
    .catalog__container.sidebar-active #btnToggleFilters {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* Asegurar que el botón esté por encima del sidebar cuando está visible */
    .btn-toggle-filters {
        z-index: 1051 !important;
        position: relative;
    }
}

.catalog__container.sidebar-active #mainFiltersWrapper,
.catalog__container.sidebar-active #mainSortControls {
    display: none !important;
}

/* ===== ESTILOS DE CARGA PARA FILTROS ===== */
/* Skeleton loader para selects nativos - Estilos más visibles */
.form-select.filter-loading,
.jsSelect.filter-loading,
select.filter-loading,
.filter-loading {
    position: relative !important;
    min-height: 38px !important;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 6px !important;
    pointer-events: none !important;
    overflow: hidden !important;
    opacity: 0.85 !important;
    animation: shimmer-loading-bg 1.5s infinite !important;
    color: transparent !important;
    cursor: wait !important;
}

    .form-select.filter-loading::after,
    .jsSelect.filter-loading::after,
    select.filter-loading::after,
    .filter-loading::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent) !important;
        animation: shimmer-sweep 1.5s infinite !important;
        z-index: 10 !important;
        pointer-events: none !important;
    }

    .filter-loading option {
        background-color: #ffffff;
        color: #333;
    }

@keyframes shimmer-loading-bg {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Aplicar estilos de carga al contenedor Select2 cuando el select tiene filter-loading */
.filter-loading + .select2-container,
.filter-loading ~ .select2-container {
    pointer-events: none !important;
    opacity: 0.85 !important;
}

    .filter-loading + .select2-container .select2-selection--single,
    .filter-loading + .select2-container .select2-selection--multiple,
    .filter-loading ~ .select2-container .select2-selection--single,
    .filter-loading ~ .select2-container .select2-selection--multiple {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
        background-size: 200% 100% !important;
        border-color: #d0d0d0 !important;
        position: relative !important;
        overflow: hidden !important;
        animation: shimmer-loading-bg 1.5s infinite !important;
        opacity: 0.85 !important;
    }

        .filter-loading + .select2-container .select2-selection--single::after,
        .filter-loading + .select2-container .select2-selection--multiple::after,
        .filter-loading ~ .select2-container .select2-selection--single::after,
        .filter-loading ~ .select2-container .select2-selection--multiple::after {
            content: '' !important;
            position: absolute !important;
            top: 0 !important;
            left: -100% !important;
            width: 100% !important;
            height: 100% !important;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent) !important;
            animation: shimmer-sweep 1.5s infinite !important;
            z-index: 10 !important;
            pointer-events: none !important;
        }

    .filter-loading + .select2-container .select2-selection__rendered,
    .filter-loading ~ .select2-container .select2-selection__rendered {
        color: transparent !important;
    }

@keyframes shimmer-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Remover estilos de carga cuando el select está listo */
.jsSelect:not(.filter-loading) {
    background: #ffffff !important;
    color: inherit !important;
    pointer-events: auto !important;
    border-color: #d1d5db !important;
    opacity: 1 !important;
}

    .jsSelect:not(.filter-loading)::after {
        display: none !important;
    }

    .jsSelect:not(.filter-loading) + .select2-container,
    .jsSelect:not(.filter-loading) ~ .select2-container {
        pointer-events: auto !important;
        opacity: 1 !important;
    }

        .jsSelect:not(.filter-loading) + .select2-container .select2-selection,
        .jsSelect:not(.filter-loading) ~ .select2-container .select2-selection {
            background: #ffffff !important;
            border-color: #d1d5db !important;
        }

            .jsSelect:not(.filter-loading) + .select2-container .select2-selection::after,
            .jsSelect:not(.filter-loading) ~ .select2-container .select2-selection::after {
                display: none !important;
            }

        .jsSelect:not(.filter-loading) + .select2-container .select2-selection__rendered,
        .jsSelect:not(.filter-loading) ~ .select2-container .select2-selection__rendered {
            color: #8a8a8a !important;
        }

/* ===== NAVBAR CON SCROLL ===== */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ===== Z-INDEX HIERARCHY ===== */
.site-nav__container {
    transition: all 0.3s ease;
}

.site-nav__search-bar {
    position: relative;
    z-index: 1;
}

#searchTypeDropdown {
    z-index: 1200;
}

.offcanvas {
    z-index: 1150;
}

.dropdown-menu {
    z-index: 1060;
}

.modal.show {
    z-index: 1200;
}

.modal-backdrop {
    z-index: 1150;
}

.toast {
    z-index: 1300;
}

.site-nav__search-container {
    position: relative;
    z-index: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    body {
        padding-top: 75px !important;
    }

    .catalog__side-filter {
        width: 300px;
        top: 75px !important;
        height: calc(100vh - 75px) !important;
    }

    .catalog__container.sidebar-active {
        margin-left: 320px;
        max-width: calc(100vw - 320px);
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    body {
        padding-top: 70px !important;
    }

    .catalog__side-filter {
        width: 340px !important;
        top: 70px !important;
        height: calc(100vh - 70px) !important;
        padding: 1.5rem !important;
    }

    .catalog__container.sidebar-active {
        margin-left: 360px !important;
        max-width: calc(100vw - 360px) !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .catalog__products-row {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

        .catalog__products-row .col-sm-6 {
            padding-left: 0.75rem !important;
            padding-right: 0.75rem !important;
            margin-bottom: 1.5rem !important;
        }

    .card {
        max-width: 100% !important;
        width: 100% !important;
    }

        .card .card-img-top {
            max-height: 22rem !important;
        }

    .catalog__nav {
        padding: 1rem 2rem !important;
        flex-wrap: wrap !important;
        margin-bottom: 1.5rem !important;
    }

    .catalog__nav-item {
        font-size: 1rem !important;
        padding: 0.75rem 1.25rem !important;
        margin: 0 0.5rem !important;
    }

    .side-filter__title {
        font-size: 1.5rem !important;
    }

    .side-filter__label {
        font-size: 1.125rem !important;
        margin-bottom: 1rem !important;
    }

    .side-filter__section {
        margin-bottom: 2rem !important;
    }

    .btn-toggle-filters {
        font-size: 1rem !important;
        padding: 0.875rem 1.5rem !important;
    }
}

@media (max-width: 991.98px) {
    body {
        padding-top: 70px !important;
    }

    .catalog__side-filter {
        width: 100% !important;
        left: -100% !important;
        top: 70px !important;
        height: calc(100vh - 70px) !important;
        z-index: 1050 !important;
        transition: left 0.3s ease !important;
        background: #ffffff !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        /* Sobrescribir estilos de Compras_index.css */
        max-width: 100% !important;
        min-width: 100% !important;
        overflow: visible !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

        .catalog__side-filter.active {
            left: 0 !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            max-width: 100% !important;
            min-width: 100% !important;
            overflow: visible !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }

    .catalog__container.sidebar-active {
        margin-left: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

        /* Ocultar botón de filtros cuando el sidebar está abierto en mobile */
        .catalog__side-filter.active ~ * .btn-toggle-filters,
        .catalog__side-filter.active ~ * #btnToggleFilters,
        .catalog__container.sidebar-active .btn-toggle-filters,
        .catalog__container.sidebar-active #btnToggleFilters,
        .catalog__container.sidebar-active .filters-toggle-container {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

    /* Overlay para móvil */
    .sidebar-overlay {
        display: none !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 70px) !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 1049 !important;
    }

        .sidebar-overlay.active {
            display: block !important;
        }
}

@media (max-width: 768px) {
    body {
        padding-top: 65px !important;
        overflow-x: hidden;
    }

    .catalog__side-filter {
        width: 100% !important;
        left: -100% !important;
        top: 65px !important;
        height: calc(100vh - 65px) !important;
        z-index: 1050 !important;
        transition: left 0.3s ease !important;
        background: #ffffff !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        /* Sobrescribir estilos de Compras_index.css */
        max-width: 100% !important;
        min-width: 100% !important;
        overflow: visible !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

        .catalog__side-filter.active {
            left: 0 !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            max-width: 100% !important;
            min-width: 100% !important;
            overflow: visible !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }

    .catalog__container.sidebar-active {
        margin-left: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

        /* Ocultar botón de filtros cuando el sidebar está abierto en mobile */
        .catalog__side-filter.active ~ * .btn-toggle-filters,
        .catalog__side-filter.active ~ * #btnToggleFilters,
        .catalog__container.sidebar-active .btn-toggle-filters,
        .catalog__container.sidebar-active #btnToggleFilters,
        .catalog__container.sidebar-active .filters-toggle-container {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

    /* Overlay para móvil - elemento separado para poder hacer click */
    .sidebar-overlay {
        display: none !important;
        position: fixed !important;
        top: 65px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 65px) !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 1049 !important;
    }

        .sidebar-overlay.active {
            display: block !important;
        }

    /* Asegurar que el contenido no se desborde */
    .catalog__container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .catalog__products-row {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

        .catalog__products-row .row {
            margin-left: 0 !important;
            margin-right: 0 !important;
            max-width: 100% !important;
        }

    /* Navegación responsive */
    .catalog__nav {
        flex-wrap: wrap;
        gap: 0.5rem !important;
        padding: 0.5rem 1rem;
    }

    .catalog__nav-item {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        margin: 0 0.25rem !important;
    }

    /* Contenedor responsive */
    .catalog__container.container-xxl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Paginación responsive */
    .catalog__pagination {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .catalog__pagination .pagination {
            flex-wrap: nowrap;
            margin: 0;
        }

    /* Tabs responsive */
    .catalog__products.tab-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ===== OPTIMIZACIONES PARA CONTENIDO ===== */
.catalog__container.sidebar-active img {
    max-width: 100%;
    height: 300px;
}

.catalog__container.sidebar-active .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.catalog__container.sidebar-active table {
    min-width: 600px;
}

.catalog__container.sidebar-active .catalog__pagination {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.catalog__container.sidebar-active .catalog__products-row .col,
.catalog__container.sidebar-active .catalog__products-row [class*="col-"] {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    overflow: hidden;
}

.catalog__container.sidebar-active .card--list .row {
    flex-wrap: nowrap;
}

.catalog__container.sidebar-active .card--list .col p,
.catalog__container.sidebar-active .card--list .col span,
.catalog__container.sidebar-active .card--list .col div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.catalog__container.sidebar-active .card--list .columna-precio-compra-sin-iva,
.catalog__container.sidebar-active .card--list .columna-precio-compra,
.catalog__container.sidebar-active .card--list .columna-precio-venta {
    min-width: 50px;
    text-align: center;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalog__container,
.catalog__products,
.tab-content,
.row {
    transition: all 0.3s ease;
}

/* ===== VARIABLES CSS ===== */
:root {
    --navbar-height: 80px;
    --navbar-height-tablet: 75px;
    --navbar-height-mobile: 65px;
    --sidebar-width: 320px;
    --sidebar-width-tablet: 300px;
    --sidebar-width-mobile: 280px;
    --background-gray: #f5f5f5;
    --card-background: #fff;
    --border-color: #e5e7eb;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ===== SCROLLBAR PERSONALIZADO SOLO PARA RESOLUCIONES PEQUEÑAS ===== */

/* (menor a 992px) */
@media (max-width: 991px) {
    .catalog__side-filter::-webkit-scrollbar {
        width: 6px;
    }

    .catalog__side-filter::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .catalog__side-filter::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

        .catalog__side-filter::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
}

/* === SOLO ESTILOS PARA EL COMPONENTE DE RANGO DE PRECIOS === */
.price-range-filter {
    position: relative;
}

.price-range-filter__values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.price-range-filter__min,
.price-range-filter__max {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.price-range-filter__separator {
    color: #999;
    margin: 0 10px;
}

/* Contenedor principal del slider */
.price-range-filter__slider {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 20px 0;
}

/* Barra de progreso entre los handles */
.price-range-filter__track {
    position: absolute;
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    left: 0%;
    right: 0%;
    transition: all 0.2s ease;
    z-index: 1;
}

/* Inputs de tipo range superpuestos */
.price-range-filter__slider-input {
    position: absolute;
    top: -8px;
    width: 100%;
    height: 22px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
}

    /* Ocultar la apariencia por defecto de los inputs range */
    .price-range-filter__slider-input::-webkit-slider-track {
        background: transparent;
        border: none;
    }

    .price-range-filter__slider-input::-moz-range-track {
        background: transparent;
        border: none;
    }

    /* Estilos para el thumb de WebKit (Chrome, Safari) */
    .price-range-filter__slider-input::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        background: #007bff;
        border: 2px solid white;
        border-radius: 50%;
        cursor: pointer;
        pointer-events: all;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        transition: all 0.2s ease;
        position: relative;
        z-index: 2;
    }

        .price-range-filter__slider-input::-webkit-slider-thumb:hover {
            background: #0056b3;
            transform: scale(1.1);
        }

    /* Estilos para Firefox */
    .price-range-filter__slider-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #007bff;
        border: 2px solid white;
        border-radius: 50%;
        cursor: pointer;
        pointer-events: all;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        transition: all 0.2s ease;
        position: relative;
        z-index: 2;
    }

        .price-range-filter__slider-input::-moz-range-thumb:hover {
            background: #0056b3;
            transform: scale(1.1);
        }

    /* Estilos adicionales para mejor apariencia */
    .price-range-filter__slider-input:focus {
        outline: none;
    }

        .price-range-filter__slider-input:focus::-webkit-slider-thumb {
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
        }

        .price-range-filter__slider-input:focus::-moz-range-thumb {
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
        }

/* ===== ESTILOS PARA UNIFICAR FILTRO DE PATENTE EN SIDEBAR ===== */

/* Contenedor del filtro de patente en sidebar */
.side-filter__section .side-filter__label {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

/* Contenedor para input y botón - layout horizontal como el de referencia */
.side-filter__section .patent-filter-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Estilos para el input de patente en sidebar - usando misma fuente que form-select */
.side-filter__section #licensePlateSidebar {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    color: #374151;
    font-family: inherit; /* Usa la misma fuente que form-select */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

    .side-filter__section #licensePlateSidebar:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }

    .side-filter__section #licensePlateSidebar:disabled {
        background-color: #f9fafb;
        color: #9ca3af;
        cursor: not-allowed;
    }

    /* Ocultar la "X" del navegador para limpiar campo */
    .side-filter__section #licensePlateSidebar::-webkit-search-cancel-button,
    .side-filter__section #licensePlateSidebar::-webkit-search-decoration,
    .side-filter__section #licensePlateSidebar::-ms-clear {
        display: none;
    }

    /* Estados de validación SIN iconos */
    .side-filter__section #licensePlateSidebar.is-valid {
        border-color: #22c55e;
    }

    .side-filter__section #licensePlateSidebar.is-invalid {
        border-color: #ef4444;
    }

/* Estilos para el botón de búsqueda - forma más redondeada como btn-md */
.side-filter__section #btnBuscarPatenteSidebar {
    padding: 1rem 1.5rem; /* Mismo padding que btn-md */
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 1.25rem; /* Border-radius más grande para forma "pill" */
    transition: all 0.2s ease;
    min-width: auto;
    width: auto;
}

    .side-filter__section #btnBuscarPatenteSidebar:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Responsive: En pantallas muy pequeñas, mantener layout vertical */
@media (max-width: 480px) {
    .side-filter__section .patent-filter-content {
        flex-direction: column;
        align-items: stretch;
    }

    .side-filter__section #licensePlateSidebar {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .side-filter__section #btnBuscarPatenteSidebar {
        width: 100%;
    }
}

/* Opcional: Si quieres que el input tenga el mismo estilo visual que license-plate */
.side-filter__section .license-plate-sidebar {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    transition: border-color 0.2s ease;
    flex: 1;
}

    .side-filter__section .license-plate-sidebar:focus-within {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .side-filter__section .license-plate-sidebar input {
        border: none;
        outline: none;
        background: transparent;
        font-family: inherit; /* Usa la misma fuente que form-select */
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #1f2937;
        width: 100%;
        padding: 0.25rem 0;
    }

        .side-filter__section .license-plate-sidebar input::placeholder {
            color: #9ca3af;
            font-weight: normal;
        }

.patent-search-form {
    display: block !important;
}

.patent-search-content {
    display: flex !important;
    gap: 10px;
}
