@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

li {
    list-style: none;
}

a {
    text-decoration: none;
}

h2,
h3,
h4,
p {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Montserrat", serif;
}


main {
    margin: 0 8em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-bottom: 4em;
}

.busq {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 1.5em;
    margin: 1.2em 0;
    box-shadow: 0 0 10px #00000025;
    border-radius: .9em;
    width: 80%;
}

.busq .text {
    display: flex;
    width: 30%;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1em;
}

.busq .bus {
    width: 30%;
}

#myForm {
    display: flex;
    align-items: center;
    width: 100%;

}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: .8em;
    box-shadow: 0 0 5px #00000025;
    font-family: "Montserrat", serif;
    font-weight: 600;
    font-size: 1em;
}

#buscarButton {
    border: none;
    cursor: pointer;
    background-color: #fff;
    position: relative;
    right: 3em;
    z-index: 10;
}

#popover-button {
    display: none;
}

.busq .most {
    width: 30%;
    display: flex;
    font-size: 1em;
    font-weight: 600;
    justify-content: end;
    align-items: center;
}

.busq .most .button {
    box-shadow: 0 0 5px #00000031;
    margin-left: 1em;
    padding: .5em 1em;
    border-radius: .7em;
}

section {
    display: flex;
    justify-content: space-around;
    width: 83%;
}

#accordion {
    width: 313px;
}

#product-filter {
    box-shadow: 0 0 10px #00000025;
    padding: 1em .5em 1em 0;
    border-radius: .9em;
}

.categoria {
    border: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.categoria legend {
    font-weight: bold;
    cursor: pointer;
    font-size: 1.3em;
    color: #007bff;
}

.categoria input {
    position: static;
    top: 18px;
}

.categoria span {
    margin-left: 2em;
    font-weight: 600;
    color: #474747;
}


.subcategoria {
    border: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.subcategoria legend {
    font-weight: bold;
    cursor: pointer;
    font-size: 1.3em;
    color: #007bff;
}

.subcategoria input {
    position: static;
    top: 4px;
    margin-top: .9em;
}

.subcategoria span {
    font-weight: 600;
    color: #474747;
    padding: 0 0 0 .4em;
}

.filtroBtn {
    font-family: "Montserrat", serif;
    position: relative;
    left: 30%;
    font-weight: 700;
    font-size: 1.3em;
    color: #007bff;
}


fieldset div {
    display: none;
    /* Ocultar opciones por defecto */
}

.active {
    display: block;
}

input[type="radio"] {
    -webkit-appearance: none;
    /* Ocultar el aspecto predeterminado */
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    /* Ajusta el ancho del cuadrado */
    height: 20px;
    /* Ajusta la altura del cuadrado */
    border: 2px solid #ccc;
    /* Borde del cuadrado */
    border-radius: 4px;
    /* Esquinas redondeadas */
    cursor: pointer;
    /* Cambia el cursor al pasar el ratón */
    position: relative;
    /* Posicionar el elemento dentro */
}

input[type="radio"]:checked::before {

    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #007bff;
    /* Color del check */
    border-radius: .2em;
}

.productos {
    width: 73%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px #00000025;
    padding: .5em;
    border-radius: .9em;
}

.product-card:hover .more-info-button {
    opacity: 1;
    /* Make the button visible on hover */
}

.more-info-button {
    width: 100%;
    position: absolute;
    bottom: 10px;
    /* Adjust bottom position as needed */
    left: 50%;
    transform: translateX(-50%);
    background-color: #007bff;
    /* Blue button color */
    color: #fff;
    border: none;
    padding: .25em 0;
    border-radius: .5em;
    opacity: 0;
    /* Initially hide the button */
    transition: opacity 0.3s ease;
    text-align: center;
    font-weight: 600;
}

/* Contenedor principal */
.product-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columnas por defecto */
    gap: 20px;
    padding: 20px;
}

/* Estilo de las tarjetas de producto */
.product-card {
    width: 230px;
    height: 280px;
    background-color: #fff;
    overflow: hidden;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10;
}

.product-card:hover {
    transform: scale(1.05);
}

.product-card .imagen {
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-card img {
    width: 80%;
    height: 200px;
    object-fit: cover;
}

.product-card .brand {
    font-size: .8em;
    color: #898989;
    font-weight: 500;
    text-align: start;
}

.product-card h1 {
    margin: 0;
    padding: .5em;
    font-size: 1em;
    color: #2B2B2B;
    text-align: center;
}

.product-card .description {
    font-size: .8em;
    color: #898989;
    font-weight: 500;
    text-align: center;
}


@media (max-width: 1600px) {
    main {
        margin: 0;
        margin-bottom: 4em;
    }

    main .busq {
        width: 95%;
    }

    main section {
        width: 100%;
    }
}

@media (max-width: 800px) {

    main .busq {
        width: 80%;
    }

    .busq .text {
        width: 40%;
        font-size: 1em;
        text-align: center;
    }

    .cell {
        display: none;
    }

    .busq .bus {
        width: 50%;
        font-size: .6em;
    }

    #buscarButton {
        right: 2em;
    }

    .busq .most {
        display: none;
    }

    section {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    #popover-button {
        display: initial;
        font-size: 1em;
        font-weight: 800;
        color: #007bff;
        width: 93%;
        padding: 1em 1.5em;
        margin: 0;
        box-shadow: 0 0 10px #00000025;
        border-radius: .9em;
        border: none;
        background-color: #fff;
    }


    #accordion {
        width: 100%;
        display: flex;
        justify-content: center;
        align-content: center;
    }

    #product-filter {
        box-shadow: none;
        padding: 1em .5em 1em 0;
        border-radius: .9em;
    }

    .categoria {
        border: none;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
    }

    .categoria legend {
        font-weight: bold;
        cursor: pointer;
        font-size: 1.3em;
        color: #007bff;
    }

    .categoria input {
        position: static;
        top: 18px;
    }

    .categoria span {
        margin-left: 2em;
        font-weight: 600;
        color: #474747;
    }


    .subcategoria {
        border: none;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
    }

    .subcategoria legend {
        font-weight: bold;
        cursor: pointer;
        font-size: 1.3em;
        color: #007bff;
    }

    .subcategoria input {
        position: static;
        top: 4px;
        margin-top: .9em;
    }

    .subcategoria span {
        font-weight: 600;
        color: #474747;
        padding: 0 0 0 .4em;
    }

    input[type="radio"] {
        -webkit-appearance: none;
        /* Ocultar el aspecto predeterminado */
        -moz-appearance: none;
        appearance: none;
        width: 20px;
        /* Ajusta el ancho del cuadrado */
        height: 20px;
        /* Ajusta la altura del cuadrado */
        border: 2px solid #ccc;
        /* Borde del cuadrado */
        border-radius: 4px;
        /* Esquinas redondeadas */
        cursor: pointer;
        /* Cambia el cursor al pasar el ratón */
        position: relative;
        /* Posicionar el elemento dentro */
    }

    .filtroBtn {
        font-family: "Montserrat", serif;
        position: relative;
        left: 30%;
        font-weight: 700;
        font-size: 1.3em;
        color: #007bff;
    }

    /* Fondo desenfocado */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        /* Fondo semitransparente */
        backdrop-filter: blur(5px);
        /* Desenfoque */
        z-index: 999;
        /* Debajo del popover */
    }

    .overlay.visible {
        display: block;
    }

    /* Popover */
    #popover-container {
        width: 90%;
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -40%);
        background-color: white;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
        border-radius: 0.9em;
        padding: .5em;
        z-index: 1000;
        animation: slideUp 0.3s ease-out;
        /* Animación de desplazamiento */
    }

    #popover-container.visible {
        display: block;
    }

    /* Animación de desplazamiento */
    @keyframes slideUp {
        from {
            transform: translate(-50%, 100%);
            opacity: 0;
        }

        to {
            transform: translate(-50%, -50%);
            opacity: 1;
        }
    }


    .productos {
        width: 100%;
        box-shadow: none;
        padding: 0;
        border-radius: none;
    }

    .product-card:hover .more-info-button {
        opacity: 1;
        /* Make the button visible on hover */
    }

    .more-info-button {
        bottom: 0;
    }

    /* Contenedor principal */
    .product-container {
        gap: 20px;
        padding: 1em;
        justify-content: center;
        align-content: center;
    }

    /* Estilo de las tarjetas de producto */
    .product-card {
        width: 150px;
        height: 160px;
        display: grid;
        justify-content: center;
        align-content: center;
    }

    .product-card .imagen {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .product-card img {
        height: 100%;
        height: 125px;
    }

    .product-card h1 {
        margin: 0;
        padding: .5em;
        font-size: 1em;
        color: #2B2B2B;
        text-align: center;
    }

    .product-card .description {
        display: none;
    }
}

/* Responsividad */
@media (max-width: 1850px) {
    .product-container {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columnas */
    }
}

@media (max-width: 1450px) {

    .product-container {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columnas */
    }
}

#subcategories-container {
    display: none;
}