/**
 * Buscador de Palas - Estilos
 * DigitalPadel.net - v1.0.2 - Fix filtros avanzados
 */

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
.buscador-palas-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   HEADER
======================================== */
.buscador-header {
    text-align: center;
    margin-bottom: 40px;
}

.buscador-header h1 {
    font-size: 42px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.2;
}

.buscador-subtitle {
    font-size: 18px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
}

/* ========================================
   FORMULARIO DE BÚSQUEDA
======================================== */
.buscador-form-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
}

.busqueda-principal {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-busqueda {
    flex: 1;
    min-width: 250px;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-busqueda:focus {
    outline: none;
    border-color: #00a651;
    box-shadow: 0 0 0 4px rgba(0, 166, 81, 0.1);
}

.btn-buscar {
    padding: 16px 32px;
    background: linear-gradient(135deg, #00a651 0%, #008d44 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-buscar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.3);
}

.btn-filtros {
    padding: 16px 24px;
    background: white;
    color: #2c3e50;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-filtros:hover {
    border-color: #00a651;
    color: #00a651;
}

/* ========================================
   FILTROS AVANZADOS - CORRECCIÓN CRÍTICA
======================================== */
.filtros-avanzados {
    padding-top: 20px;
    border-top: 2px solid #f5f5f5;
    margin-top: 20px;
    display: none !important;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
}

.filtros-avanzados[style*="display: block"] {
    display: block !important;
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filtro-grupo label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-filtro {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-filtro:focus {
    outline: none;
    border-color: #00a651;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.filtros-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-secundario {
    padding: 12px 24px;
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secundario:hover {
    background: #e74c3c;
    color: white;
}

/* ========================================
   CONTROLES DE RESULTADOS
======================================== */
.resultados-controles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 16px;
}

.resultados-info {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.orden-select {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orden-select label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
    white-space: nowrap;
}

.input-orden {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.input-orden:focus {
    outline: none;
    border-color: #00a651;
}

/* ========================================
   GRID DE RESULTADOS
======================================== */
.resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ========================================
   TARJETA DE PALA
======================================== */
.pala-card-buscador {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.pala-card-buscador:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.pala-imagen {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pala-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.pala-card-buscador:hover .pala-imagen img {
    transform: scale(1.05);
}

.sin-imagen {
    font-size: 80px;
    opacity: 0.3;
}

.pala-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pala-marca {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #00a651;
    font-weight: 700;
    margin-bottom: 4px;
}

.pala-modelo {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.3;
    min-height: 52px;
}

.pala-precio {
    font-size: 28px;
    font-weight: 700;
    color: #00a651;
    margin-bottom: 16px;
    line-height: 1.2;
}

.pala-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px 0;
    border-top: 2px solid #f5f5f5;
    border-bottom: 2px solid #f5f5f5;
    flex: 1;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #95a5a6;
    font-weight: 600;
}

.spec-valor {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
}

.pala-acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-ver-detalle {
    display: block;
    padding: 14px 20px;
    background: linear-gradient(135deg, #00a651 0%, #008d44 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-ver-detalle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.3);
}

.btn-comparar-mini {
    display: block;
    padding: 12px 20px;
    background: white;
    color: #2c3e50;
    text-align: center;
    text-decoration: none;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-comparar-mini:hover {
    border-color: #00a651;
    color: #00a651;
}

/* ========================================
   PAGINACIÓN
======================================== */
.paginacion-container {
    margin-top: 40px;
}

.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-paginacion {
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: white;
    color: #2c3e50;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-paginacion:hover {
    border-color: #00a651;
    color: #00a651;
}

.btn-paginacion.activo {
    background: #00a651;
    color: white;
    border-color: #00a651;
}

.paginacion-puntos {
    padding: 0 8px;
    color: #bdc3c7;
}

/* ========================================
   SIN RESULTADOS
======================================== */
.sin-resultados {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sin-resultados-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.sin-resultados h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.sin-resultados p {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 24px;
    line-height: 1.5;
}

.btn-primario {
    padding: 16px 32px;
    background: linear-gradient(135deg, #00a651 0%, #008d44 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primario:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.3);
}

/* ========================================
   LOADING OVERLAY
======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #00a651;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* ===================================
   RESPONSIVE OPTIMIZADO PARA MÓVILES
   =================================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .buscador-palas-wrapper {
        padding: 30px 15px;
    }
    
    .buscador-form-container {
        padding: 25px 20px;
    }
    
    .resultados-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
}

/* Móviles - pantallas pequeñas */
@media (max-width: 768px) {
    .buscador-palas-wrapper {
        padding: 20px 10px;
    }
    
    /* Header */
    .buscador-header {
        margin-bottom: 30px;
    }
    
    .buscador-header h1 {
        font-size: 28px;
    }
    
    .buscador-subtitle {
        font-size: 16px;
    }
    
    /* Formulario de búsqueda */
    .buscador-form-container {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .busqueda-principal {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .input-busqueda {
        min-width: 100%;
        width: 100%;
        padding: 14px 16px;
    }
    
    .btn-buscar,
    .btn-filtros {
        width: 100%;
        padding: 14px 24px;
    }
    
    /* Filtros avanzados */
    .filtros-avanzados {
        padding-top: 16px;
        margin-top: 16px;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .filtro-grupo label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .input-filtro {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .filtros-acciones {
        justify-content: stretch;
        gap: 10px;
    }
    
    .btn-secundario {
        flex: 1;
        padding: 12px 20px;
    }
    
    /* Controles de resultados */
    .resultados-controles {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .resultados-info {
        font-size: 15px;
        text-align: center;
    }
    
    .orden-select {
        width: 100%;
        justify-content: space-between;
    }
    
    .orden-select label {
        font-size: 13px;
    }
    
    .input-orden {
        flex: 1;
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* Grid de resultados */
    .resultados-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    /* Tarjeta de pala */
    .pala-card-buscador:hover {
        transform: translateY(-4px);
    }
    
    .pala-imagen {
        height: 250px;
    }
    
    .sin-imagen {
        font-size: 60px;
    }
    
    .pala-body {
        padding: 16px;
    }
    
    .pala-marca {
        font-size: 11px;
    }
    
    .pala-modelo {
        font-size: 18px;
        min-height: auto;
        margin-bottom: 10px;
    }
    
    .pala-precio {
        font-size: 24px;
        margin-bottom: 14px;
    }
    
    .pala-specs {
        gap: 8px;
        padding: 14px 0;
        margin-bottom: 16px;
    }
    
    .spec-label {
        font-size: 10px;
    }
    
    .spec-valor {
        font-size: 13px;
    }
    
    .pala-acciones {
        gap: 8px;
    }
    
    .btn-ver-detalle {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .btn-comparar-mini {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Paginación */
    .paginacion-container {
        margin-top: 30px;
    }
    
    .paginacion {
        gap: 6px;
    }
    
    .btn-paginacion {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    /* Sin resultados */
    .sin-resultados {
        padding: 60px 20px;
        border-radius: 12px;
    }
    
    .sin-resultados-icon {
        font-size: 60px;
        margin-bottom: 16px;
    }
    
    .sin-resultados h3 {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .sin-resultados p {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .btn-primario {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    /* Loading */
    .spinner {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }
    
    .loading-overlay p {
        font-size: 16px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .buscador-palas-wrapper {
        padding: 15px 8px;
    }
    
    .buscador-header h1 {
        font-size: 24px;
    }
    
    .buscador-subtitle {
        font-size: 15px;
    }
    
    .buscador-form-container {
        padding: 16px 12px;
    }
    
    .input-busqueda {
        padding: 12px 14px;
    }
    
    .btn-buscar,
    .btn-filtros {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .filtro-grupo label {
        font-size: 12px;
    }
    
    .input-filtro {
        padding: 10px 12px;
    }
    
    .btn-secundario {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .resultados-controles {
        padding: 14px 12px;
    }
    
    .resultados-info {
        font-size: 14px;
    }
    
    .orden-select label {
        font-size: 12px;
    }
    
    .input-orden {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .pala-imagen {
        height: 220px;
    }
    
    .sin-imagen {
        font-size: 50px;
    }
    
    .pala-body {
        padding: 14px;
    }
    
    .pala-marca {
        font-size: 10px;
    }
    
    .pala-modelo {
        font-size: 17px;
    }
    
    .pala-precio {
        font-size: 22px;
    }
    
    .pala-specs {
        gap: 6px;
        padding: 12px 0;
    }
    
    .spec-label {
        font-size: 9px;
    }
    
    .spec-valor {
        font-size: 12px;
    }
    
    .btn-ver-detalle {
        padding: 11px 14px;
        font-size: 13px;
    }
    
    .btn-comparar-mini {
        padding: 9px 14px;
        font-size: 12px;
    }
    
    .btn-paginacion {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .sin-resultados {
        padding: 50px 16px;
    }
    
    .sin-resultados-icon {
        font-size: 50px;
    }
    
    .sin-resultados h3 {
        font-size: 20px;
    }
    
    .sin-resultados p {
        font-size: 14px;
    }
    
    .btn-primario {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Landscape móviles */
@media (max-width: 896px) and (orientation: landscape) {
    .buscador-palas-wrapper {
        padding: 20px 15px;
    }
    
    .buscador-header {
        margin-bottom: 25px;
    }
    
    .buscador-header h1 {
        font-size: 28px;
    }
    
    .buscador-form-container {
        padding: 20px;
    }
    
    .busqueda-principal {
        flex-direction: row;
    }
    
    .input-busqueda {
        min-width: 200px;
    }
    
    .btn-buscar,
    .btn-filtros {
        width: auto;
    }
    
    .filtros-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resultados-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pala-imagen {
        height: 200px;
    }
}

/* Muy ancho en móvil landscape */
@media (min-width: 568px) and (max-width: 768px) and (orientation: landscape) {
    .filtros-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .resultados-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets en portrait */
@media (min-width: 768px) and (max-width: 1024px) {
    .resultados-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .filtros-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}