/* ==========================================================================
   HOJA DE ESTILOS: CATÁLOGO PRODUCCIÓN
   Descripción: Estilos para el catálogo, grillas, filtros y banners.
   ========================================================================== */

/* Estilo de Tarjeta Seleccionada */
.tarjeta-seleccionada {
    background-color: rgba(133, 194, 38, 0.12) !important;
    border: 2px solid #85C226 !important;
    transition: all 0.3s ease;
}

/* 🔥 Carrusel Horizontal de Marcas 🔥 */
.marcas-carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 5px 25px 5px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--cenco-green) #f8f9fa;
}

.marcas-carousel::-webkit-scrollbar {
    height: 6px;
}

.marcas-carousel::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.marcas-carousel::-webkit-scrollbar-thumb {
    background-color: var(--cenco-green);
    border-radius: 10px;
}

.marca-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
}

.marca-item:hover,
.marca-item.active {
    border-color: var(--cenco-green);
    box-shadow: 0 6px 15px rgba(133, 194, 38, 0.3);
    transform: translateY(-4px);
}

.marca-item img {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
}

.marca-item span {
    font-size: 0.65rem;
    font-weight: 800;
    color: #4a4a4a;
    text-align: center;
    line-height: 1.1;
    padding: 5px;
    text-transform: uppercase;
}

/* Overlay de carga para la grilla */
#grilla-productos-container {
    position: relative;
    min-height: 300px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

/* 🔥 Mejoras Responsive Banner 🔥 */
.banner-categoria-wrapper {
    position: relative;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--cenco-indigo);
    min-height: 180px;
}

.banner-categoria-img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cenco-indigo) 0%, #3e2b85 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 0 2rem;
}

.buscador-centrado {
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .banner-categoria-wrapper {
        min-height: 120px;
    }

    .banner-fallback h2 {
        font-size: 1.5rem !important;
    }

    .banner-fallback p {
        font-size: 0.9rem;
    }
}

/* 🔥 Selector de Ordenamiento Discreto 🔥 */
.select-discreto {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 6px 35px 6px 15px;
    font-size: 0.95rem;
    color: #495057;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23495057" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: border-color 0.2s;
}

.select-discreto:focus {
    outline: none;
    border-color: var(--cenco-green);
}

/* 🔥 Estilos para Etiquetas de Subcategorías 🔥 */
.subcategorias-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.subcategorias-wrapper::-webkit-scrollbar {
    display: none;
}

.subcat-pill {
    white-space: nowrap;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #6c757d;
    border-radius: 50rem;
    padding: 5px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.subcat-pill:hover {
    border-color: var(--cenco-green);
    color: var(--cenco-green);
    background-color: rgba(133, 194, 38, 0.05);
}

.subcat-pill.active {
    background-color: var(--cenco-indigo);
    border-color: var(--cenco-indigo);
    color: #fff;
    box-shadow: 0 3px 6px rgba(42, 27, 94, 0.2);
}