/* ── Qweon Buscador – Estilos Frontend ─────────────────────────────────── */

.qweon-buscador {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 0;
    font-family: inherit;
}

.qweon-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a1a;
}

/* ── Desplegables ─────────────────────────────────────────────────────────── */
.qweon-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 32px;
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.qweon-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    flex: 1;
}

.qweon-campo label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qweon-campo select {
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    cursor: pointer;
    appearance: auto;
}

.qweon-campo select:focus {
    outline: none;
    border-color: #2271b1;
}

.qweon-campo select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* ── Botón buscar ─────────────────────────────────────────────────────────── */
.qweon-btn-buscar {
    padding: 11px 28px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.qweon-btn-buscar:hover {
    background: #135e96;
    transform: translateY(-1px);
}

.qweon-btn-buscar:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
    transform: none;
}

/* ── Oculto ───────────────────────────────────────────────────────────────── */
.qweon-oculto {
    display: none !important;
}

/* ── Cargando ─────────────────────────────────────────────────────────────── */
.qweon-cargando {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-size: 0.95rem;
    padding: 16px 0;
}

.qweon-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: qweon-spin 0.7s linear infinite;
}

@keyframes qweon-spin {
    to { transform: rotate(360deg); }
}

/* ── Info coche seleccionado ──────────────────────────────────────────────── */
.qweon-coche-info {
    background: #e8f0fe;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: #1a1a1a;
}

/* ── Secciones de resultados ──────────────────────────────────────────────── */
.qweon-seccion {
    margin-bottom: 40px;
}

.qweon-seccion-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.qweon-seccion-titulo span {
    font-weight: 400;
    color: #777;
    font-size: 0.9rem;
}

/* ── Grid de productos ────────────────────────────────────────────────────── */
.qweon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ── Tarjeta de producto ──────────────────────────────────────────────────── */
.qweon-producto {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.qweon-producto:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.qweon-producto-agotado {
    opacity: 0.7;
}

.qweon-producto-img-link {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.qweon-producto-img-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s;
}

.qweon-producto:hover .qweon-producto-img-link img {
    transform: scale(1.04);
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.qweon-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.qweon-badge-stock {
    background: #d4edda;
    color: #155724;
}

.qweon-badge-nostock {
    background: #f8d7da;
    color: #721c24;
}

/* ── Info del producto ────────────────────────────────────────────────────── */
.qweon-producto-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.qweon-medida {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2271b1;
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.qweon-producto-info h4 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
}

.qweon-producto-info h4 a {
    color: #1a1a1a;
    text-decoration: none;
}

.qweon-producto-info h4 a:hover {
    color: #2271b1;
}

.qweon-producto-precio {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.qweon-producto-precio .woocommerce-Price-amount {
    color: #2271b1;
}

/* ── Botón añadir al carrito ──────────────────────────────────────────────── */
.qweon-btn-carrito {
    display: block;
    text-align: center;
    padding: 9px 12px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 4px;
}

.qweon-btn-carrito:hover {
    background: #135e96;
}

.qweon-btn-disabled {
    background: #ccc !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Sin resultados / Error ───────────────────────────────────────────────── */
.qweon-sin-resultados {
    padding: 32px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
    color: #555;
}

.qweon-sin-resultados p {
    margin: 6px 0;
}

.qweon-error {
    color: #c0392b;
    background: #fdf0ee;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #c0392b;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .qweon-selects {
        flex-direction: column;
    }
    .qweon-campo {
        min-width: 100%;
    }
    .qweon-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
}
