.container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
    z-index: 20;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}

.filter-options label {
    cursor: pointer;
    font-size: 1em;
    color: #333;
    font-weight: 600;
}

.filter-options input {
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-radius: 3px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 6px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #0066cc;
    border-color: #0066cc;
}

input[type="checkbox"]:checked::after,
input[type="radio"]:checked::after {
    content: "✓";
    color: white;
    font-size: 12px;
    position: absolute;
    left: 2px;
    top: -1px;
}

.main-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-count {
    font-size: 1.2em;
    color: #0080FF;
    text-align: right;
    margin-bottom: 20px;
}

.product-card {
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    background: white;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.product-card.hidden {
    display: none;
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 4px;
}

.product-name {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 6px;
    color: #2B2B2B;
}

.product-brand {
    text-align: left;
    font-size: .9em;
    font-weight: 600;
    color: #2B2B2B;
    margin-bottom: 4px;
}

.product-description {
    font-size: .9em;
    font-weight: 600;
    color: #898989;
}

.product-price {
    font-weight: bold;
    color: #0080FF;
    font-size: 16px;
    margin-top: 6px;
}


.clear-btn {
    background: #0080FF;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.clear-btn:hover {
    background: #0066cc;
}

hr {
    border: none;
    border-top: 2px solid #0080FF;
}

.apply-btn {
    background: #00B74A;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
    display: none;
    /* Oculto por defecto en desktop */
}

.apply-btn:hover {
    background: #009E3C;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ocultar elementos móviles en desktop */
.mobile-header {
    display: none;
}

.overlay {
    display: none;
}

/* === RESPONSIVE MÓVIL === */
@media (max-width: 900px) {
    .container {
        display: block;
        padding: 10px;
    }

    /* Mostrar header móvil */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding: 10px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    .mobile-header-top{
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .filter-toggle {
        background: #0080FF;
        color: white;
        border: none;
        border-radius: 6px;
        padding: 10px 14px;
        font-size: 16px;
        cursor: pointer;
        font-weight: 600;
    }

    .filter-toggle:hover {
        background: #0066cc;
    }

    /* Sidebar como popover lateral */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100%;
        overflow-y: auto;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
        transition: left 0.3s ease;
        z-index: 1000;
        border-radius: 0;
    }

    .sidebar.active {
        left: 0;
    }

    /* Fondo oscuro del overlay */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .overlay.active {
        display: block;
    }

    /* Mostrar botón "Aplicar" en móvil */
    .apply-btn {
        display: block;
    }

    .filter-buttons {
        flex-direction: column;
    }

    /* Ocultar contador del recuadro principal en móvil */
    .desktop-count {
        display: none;
    }

    .main-content {
        padding: 15px;
    }

    .product-count {
        font-size: 1.1em;
        margin: 0;
    }
}

@media screen and (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .sidebar {
        width: 90%;
    }

    .mobile-header {
        padding: 8px;
    }
}