/* Estructura principal de la grid */
#productsGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#productsGrid .col-12, 
#productsGrid .col-sm-6, 
#productsGrid .col-md-4 {
    flex: 1 1 calc(33.33% - 10px);
    max-width: calc(33.33% - 10px);
    box-sizing: border-box;
}

/* Responsive para tablets */
@media (max-width: 768px) {
    #productsGrid .col-sm-6 {
        flex: 1 1 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

/* Responsive para móviles */
@media (max-width: 576px) {
    #productsGrid .col-12 {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Estilos de cards */
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(44, 82, 124, 0.1);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.card:hover {
    border-color: #2c527c;
    box-shadow: 0 8px 16px rgba(44, 82, 124, 0.15);
    transform: translateY(-4px);
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
}

.card img {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #f9f9f9;
}

.clickable-card {
    cursor: pointer;
}



/* Ajuste de espacio para el contenido principal */
.container.mt-5 {
    margin-top: 80px !important;
}

/* Cards vacías (para completar filas) */
.empty-card {
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* Asegurar que las cards normales mantengan su tamaño */
#productsGrid .col-md-4 {
    flex: 0 0 auto;
    width: 100%;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    #productsGrid .col-md-4 {
        width: calc(33.333333% - 1rem);
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    #productsGrid .col-sm-6 {
        width: calc(50% - 1rem);
    }
    
    .empty-card {
        display: none;
    }
}

.background {
	margin-top: -50px;
}

/* Ajuste visual de checkboxes en el panel de filtros (excluir switches) */
#generalFilters .form-check-input:not([role="switch"]),
#categoryFilters .form-check-input:not([role="switch"]),
#subcategoryFilters .form-check-input:not([role="switch"]) {
  width: 1.1em !important;
  height: 1.1em !important;       
  margin-top: .25em;
  float: left;
  background-color: var(--bs-form-check-bg);
  border-color: var(--bs-border-color);
  background-image: none;
}

/* Solo cuando está tildado, que se pinte en primario con el check (excluir switches) */
#generalFilters .form-check-input:not([role="switch"]):checked,
#categoryFilters .form-check-input:not([role="switch"]):checked,
#subcategoryFilters .form-check-input:not([role="switch"]):checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  background-image: var(--bs-form-check-bg-image);
}
