﻿/* --- RANDOM PRODUCTS --- */
.random-products {
    margin-bottom: 2.5rem;
}

.random-products-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.random-products-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: #23428D;
    letter-spacing: 0.02em;
}

.random-products-icon {
    color: #F6BE00;
    font-size: 1.35rem;
    vertical-align: middle;
}

.random-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    justify-items: stretch;
    align-items: stretch;
}

    .random-products-grid > * {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        opacity: 0;
        transform: translateY(25px);
        animation: fadeInUp 0.55s cubic-bezier(.19,1,.22,1) forwards;
        display: flex;
        align-items: stretch;
        height: 100%;
        transition: box-shadow 0.34s cubic-bezier(.17,.67,.59,1.15), transform 0.22s cubic-bezier(.17,.67,.59,1.22);
    }

/* --- Animaciones --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.random-products-fade-in {
    opacity: 1;
    animation: fadeInRandomProducts 0.35s;
}

.random-products-fade-out {
    opacity: 0.2;
    animation: fadeOutRandomProducts 0.35s;
}

@keyframes fadeInRandomProducts {
    from {
        opacity: 0.2;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOutRandomProducts {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.2;
    }
}

/* --- PRODUCTS GRID --- */
.productos-grid,
.productos-grid-custom,
.random-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    justify-items: stretch;
    align-items: stretch;
}

    .productos-grid > *,
    .productos-grid-custom > *,
    .random-products-grid > * {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        opacity: 0;
        transform: translateY(25px);
        animation: fadeInUp 0.5s ease-out forwards;
        display: flex;
        align-items: stretch;
        height: 100%;
    }

/* --- Responsive para GRIDS --- */
@media (max-width: 1100px) {
    .random-products-grid, .productos-grid, .productos-grid-custom {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 700px) {
    .random-products-grid {
        grid-template-columns: 1fr !important;
        gap: 1.1rem;
    }
}

@media (max-width: 650px) {
    .productos-grid, .productos-grid-custom, .random-products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- LAYOUT GENERAL --- */
.productos-layout {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

.sidebar-filtros {
    flex: 0 0 30%;
    min-width: 230px;
    max-width: 350px;
    background: #fff;
    border-radius: 1.3rem;
    box-shadow: 0 8px 24px rgba(41,58,111,0.08);
    padding: 2.2rem 1.7rem 1.5rem 1.7rem;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 2.5rem;
    height: fit-content;
    z-index: 20;
    transform: translateX(-60px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(.39,.58,.57,1.05), opacity 0.34s cubic-bezier(.39,.58,.57,1.05);
}

.productos-layout.sidebar-open .sidebar-filtros {
    transform: translateX(0);
    opacity: 1;
}

.productos-listado {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 2rem;
    width: 100%;
    max-width: 100%;
    transition: width 0.3s;
}

.productos-layout.sidebar-open .productos-listado {
    max-width: 74vw;
    flex-basis: 70%;
    margin-left: 0;
}

.productos-layout:not(.sidebar-open) .productos-listado {
    max-width: 100vw;
    flex-basis: 100%;
    margin-left: 0;
}

.filtros-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.filtros-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #23428D;
}

.btn-clear {
    background: #fff;
    color: #376EB5;
    border: 1.5px solid #376EB5;
    border-radius: 0.5rem;
    font-size: 0.98rem;
    padding: 0.45rem 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .btn-clear:hover {
        background: #376EB5;
        color: #fff;
        border-color: #23428D;
    }

.filtros-switch-container {
    margin-bottom: 1.3rem;
    padding-top: 0.7rem;
    display: flex;
    align-items: center;
    min-height: 38px;
}

.switch-label, .switch-filtros-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #23428D;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.filtros-switch {
    accent-color: #23428D;
    width: 36px;
    height: 18px;
    opacity: 0;
    position: absolute;
}

.slider {
    width: 38px;
    height: 20px;
    border-radius: 14px;
    background: #e7eafd;
    display: inline-block;
    position: relative;
    transition: background 0.2s;
}

.filtros-switch:checked + .slider {
    background: #23428D;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 1px;
    top: 1px;
    border-radius: 50%;
    background: #fff;
    transition: 0.2s;
}

.filtros-switch:checked + .slider:before {
    transform: translateX(18px);
}

.categorias-barra {
    width: 100%;
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
}

.productos-titulo {
    color: #1b274c;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.3rem;
}

@media (max-width: 900px) {
    .productos-layout {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sidebar-filtros {
        max-width: 100vw;
        min-width: unset;
        margin-bottom: 1.3rem;
        position: static;
    }

    .productos-listado {
        padding-right: 0;
    }
}

.productos-grid-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 2.5rem;
    width: 100%;
}

@media (max-width: 900px) {
    .productos-grid-container {
        padding: 0 1rem;
    }

    .productos-grid {
        gap: 1.2rem;
    }
}

@media (max-width: 650px) {
    .productos-grid {
        grid-template-columns: 1fr !important;
        gap: 0.7rem;
    }

    .product-card {
        max-width: 100%;
    }
}

/* --- SLIDER DE COLUMNAS (filtro-col-slider) --- */
.filtro-col-slider {
    margin-bottom: 30px;
}

    .filtro-col-slider label {
        font-size: 1.05rem;
        color: #23428D;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .filtro-col-slider span {
        font-weight: 700;
        margin-left: 0.2rem;
    }

    /* Main input style - CUSTOM BARRA */
    .filtro-col-slider input[type="range"] {
        width: 120px;
        height: 22px;
        accent-color: #23428D;
        background: transparent !important;
        margin-left: 0.4rem;
        border-radius: 8px;
        box-sizing: border-box;
        transition: background 0.3s;
        color: #23428D;
        outline: none;
        padding: 0; /* Elimina padding */
        appearance: none;
    }

        /* --- THUMB y TRACK - Cross-browser --- */
        /* Chrome, Safari, Edge */
        .filtro-col-slider input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 22px;
            height: 22px;
            background: #23428D;
            border-radius: 50%;
            border: 2.5px solid #fff;
            cursor: pointer;
            transition: background 0.2s;
            box-shadow: 0 1px 6px rgba(41,58,111,0.10);
            position: relative;
            top: 0;
        }

        .filtro-col-slider input[type="range"]:hover::-webkit-slider-thumb {
            background: #23428D;
        }

        .filtro-col-slider input[type="range"]::-webkit-slider-runnable-track {
            height: 5px;
            background: #e7eafd; /* O el HEX que prefieras */
            border-radius: 8px;
        }

        .filtro-col-slider input[type="range"]:focus::-webkit-slider-runnable-track {
            background: #c7bbff;
        }

        /* Firefox */
        .filtro-col-slider input[type="range"]::-moz-range-thumb {
            width: 22px;
            height: 22px;
            background: #23428D;
            border-radius: 50%;
            border: 2.5px solid #fff;
            cursor: pointer;
        }

        .filtro-col-slider input[type="range"]:hover::-moz-range-thumb {
            background: #376EB5;
        }

        .filtro-col-slider input[type="range"]::-moz-range-progress {
            background-color: #23428D;
            height: 5px;
            border-radius: 8px 0 0 8px;
        }

        .filtro-col-slider input[type="range"]::-moz-range-track {
            background-color: #ccc3f9;
            height: 5px;
            border-radius: 8px;
        }

        .filtro-col-slider input[type="range"]:focus::-moz-range-track {
            background: #c7bbff;
        }

        /* IE/Edge */
        .filtro-col-slider input[type="range"]::-ms-fill-lower {
            background: #23428D;
            border-radius: 8px;
        }

        .filtro-col-slider input[type="range"]::-ms-fill-upper {
            background: #ccc3f9;
            border-radius: 8px;
        }

        .filtro-col-slider input[type="range"]:focus {
            outline: none;
        }

/* --- Branding root variable --- */
:root {
    --futurohoy-azul: #23428D;
}



.filtro-col-slider2 label {
    font-size: 1.05rem;
    color: #23428D;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filtro-col-slider2 span {
    font-weight: 700;
    margin-left: 0.2rem;
}



.filtro-col-slider2 input[type="range"].slider2 {
    width: 120px;
    height: 22px;
    accent-color: #23428D;
    background: transparent;
    margin-left: 0.4rem;
    border-radius: 8px;
    box-sizing: border-box;
    transition: background 0.3s;
    color: #23428D;
    outline: none;
    padding: 0;
    border: none;
}



.productos-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    width: 100%;
    justify-items: center; /* <-- centra el contenido de cada celda */
}


.product-card {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Aplica esto a la tarjeta interna */
.card {
    width: 100%;
    max-width: 220px;
    min-width: 180px; 
    margin: 0 auto; 
    box-sizing: border-box;
}

.productos-page-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1450px; /* O lo que decidas */
    margin: 0 auto;
    gap: 2.3rem;
}

.sidebar-categorias {
    flex: 0 0 260px; /* Sidebar fijo, ajusta el ancho si lo necesitas */
    min-width: 220px;
    max-width: 300px;
    margin-top: 1.2rem;
}

.productos-main {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 1.4rem;
}

 