/*--------------------------------------------------------------------- LaVitrina64 Catalog Styles - Consolidado ---------------------------------------------------------------------*/
/* Versión 1.2.0 - Archivos consolidados: catalog-fixes.css + catalog-filters-fix.css */

/* ========== Catalog Product Cards Fixes ========== */

/* Estilos para las tarjetas de productos en el catálogo */
#products-grid .col-md-4,
#products-grid .col-sm-6 {
    margin-bottom: 30px;
}

.product-card-catalog {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-catalog:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-card-catalog a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: 50% 50% !important;
    transition: transform 0.3s ease;
    display: block;
    flex-shrink: 0;
    min-height: 100%;
}

.product-card-catalog:hover .product-card-image-wrapper img {
    transform: scale(1.05);
}

.product-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.product-card-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.product-card-badge.stock {
    background: #28a745;
    color: #fff;
}

.product-card-badge.out-of-stock {
    background: #dc3545;
    color: #fff;
}

.product-card-badge.drop {
    background: #c41e3a;
    color: #fff;
}

.product-card-badge.premium {
    background: #ffc107;
    color: #2a2a2a;
}

/* Badge de marca */
.product-card-badge.brand-badge {
    background: #2a2a2a;
    color: #ffffff;
    font-weight: 700;
    font-size: 10px;
    padding: 5px 12px;
    border-radius: 12px;
    letter-spacing: 0.8px;
}

/* Colores específicos por marca */
.product-card-badge.brand-badge.brand-hot-wheels {
    background: linear-gradient(135deg, #e63946 0%, #c41e3a 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.3);
}

.product-card-badge.brand-badge.brand-matchbox {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 68, 153, 0.3);
}

.product-card-badge.brand-badge.brand-minigt {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid #c0c0c0;
}

.product-card-badge.brand-badge.brand-greenlight {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.product-card-badge.brand-badge.brand-johnny-lightning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #2a2a2a;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
    font-weight: 800;
}

/* Ajustar orden de badges - marca primero */
.product-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.product-card-badges .brand-badge {
    order: -1;
    margin-right: auto;
}

.product-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2a2a2a;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-card-variant {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #c41e3a;
    margin-top: auto;
    padding-top: 8px;
    white-space: nowrap;
}

/* Botón discreto para agregar al carrito */
.product-card-add-btn {
    width: 100%;
    padding: 8px 16px;
    margin-top: 10px;
    background: #ffffff;
    color: #c41e3a;
    border: 1.5px solid #c41e3a;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: none;
    letter-spacing: 0.3px;
}

.product-card-add-btn:hover {
    background: #c41e3a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
}

.product-card-add-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments - Mejorado con clamp para mejor escalado */
@media (max-width: 768px) {
    #products-grid .col-md-4,
    #products-grid .col-sm-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    .product-card-image-wrapper {
        height: clamp(200px, 40vw, 250px);
    }
    
    .product-card-image-wrapper img {
        object-position: 50% 50% !important;
        object-fit: cover !important;
    }
    
    .product-card-content {
        padding: clamp(12px, 3vw, 15px);
    }
    
    .product-card-title {
        font-size: clamp(14px, 3vw, 16px);
        min-height: 44px;
    }
    
    .product-card-meta,
    .product-card-variant {
        font-size: clamp(11px, 2.5vw, 13px);
    }
    
    .product-card-price {
        font-size: clamp(18px, 4vw, 22px);
    }
    
    .product-card-badge {
        font-size: clamp(9px, 2vw, 11px);
        padding: clamp(3px, 1vw, 5px) clamp(6px, 2vw, 10px);
    }
    
    .product-card-add-btn {
        font-size: clamp(11px, 2.5vw, 13px);
        padding: clamp(6px, 1.5vw, 8px) clamp(12px, 3vw, 16px);
    }
}

@media (max-width: 576px) {
    .product-card-image-wrapper {
        height: clamp(180px, 35vw, 220px);
    }
    
    .product-card-content {
        padding: clamp(10px, 2.5vw, 12px);
    }
    
    .product-card-title {
        font-size: clamp(13px, 2.8vw, 15px);
        min-height: 40px;
    }
    
    .product-card-price {
        font-size: clamp(16px, 3.5vw, 20px);
    }
}

@media (max-width: 400px) {
    .product-card-image-wrapper {
        height: clamp(160px, 30vw, 200px);
    }
    
    .product-card-image-wrapper img {
        object-position: 50% 50% !important;
        object-fit: cover !important;
    }
    
    .product-card-content {
        padding: 10px;
    }
    
    .product-card-title {
        font-size: 13px;
        min-height: 38px;
    }
    
    .product-card-price {
        font-size: 16px;
    }
    
    .product-card-add-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* ========== Catalog Filters Fix ========== */

/* Ocultar el nice-select en los filtros del catálogo para evitar doble selección */
#filters-sidebar .nice-select {
    display: none !important;
}

/* Prevenir que nice-select se aplique a selects con la clase no-nice-select */
select.no-nice-select + .nice-select {
    display: none !important;
}

#filters-sidebar select.form-control {
    display: block !important;
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: #2a2a2a;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232a2a2a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
    box-sizing: border-box;
    min-height: 44px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
}

#filters-sidebar select.form-control option {
    padding: 8px 12px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
}

#filters-sidebar select.form-control::-ms-expand {
    display: none;
}

#filters-sidebar select.form-control:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

#filters-sidebar select.form-control:hover {
    border-color: #c41e3a;
}

/* Estilos para los inputs de precio */
#filters-sidebar input.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: #2a2a2a;
    transition: all 0.3s ease;
}

#filters-sidebar input.form-control:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

#filters-sidebar input.form-control:hover {
    border-color: #c41e3a;
}

/* Estilos para el checkbox */
#filters-sidebar input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c41e3a;
}

/* Estilos para el botón de limpiar filtros */
#filters-sidebar button.btn {
    width: 100%;
    padding: 12px 20px;
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#filters-sidebar button.btn:hover {
    background: #c41e3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

#filters-sidebar button.btn:active {
    transform: translateY(0);
}
