/* ===================================
   Ricerca Piscine - Stili Moderni
   =================================== */

:root {
    --rp-primary: #0ea5e9;
    --rp-primary-dark: #0284c7;
    --rp-secondary: #06b6d4;
    --rp-accent: #8b5cf6;
    --rp-success: #10b981;
    --rp-dark: #1e293b;
    --rp-light: #f8fafc;
    --rp-gray: #64748b;
    --rp-border: #e2e8f0;
    --rp-shadow: 0 10px 30px rgba(14, 165, 233, 0.15);
    --rp-shadow-lg: 0 20px 60px rgba(14, 165, 233, 0.2);
}

/* ===================================
   Box di Ricerca
   =================================== */

.ricerca-piscine-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.ricerca-piscine-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--rp-shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ricerca-piscine-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--rp-primary), var(--rp-secondary), var(--rp-accent));
}

.ricerca-piscine-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--rp-shadow-lg);
}

.ricerca-piscine-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--rp-dark);
    margin-bottom: 10px;
    text-align: center;
}

.ricerca-piscine-subtitle {
    font-size: 16px;
    color: var(--rp-gray);
    margin-bottom: 30px;
    text-align: center;
}

/* Form di Ricerca */
.ricerca-piscine-form {
    display: grid;
    gap: 20px;
}

.rp-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .rp-form-row {
        grid-template-columns: 2fr 1fr;
    }
    
    .rp-form-row.rp-three-cols {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.rp-form-group {
    position: relative;
}

.rp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-dark);
    margin-bottom: 8px;
}

.rp-form-input,
.rp-form-select {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--rp-border);
    border-radius: 12px;
    background: var(--rp-light);
    color: var(--rp-dark);
    transition: all 0.3s ease;
    outline: none;
}

.rp-form-input:focus,
.rp-form-select:focus {
    border-color: var(--rp-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.rp-form-input::placeholder {
    color: var(--rp-gray);
}

/* Input con Icona */
.rp-input-icon {
    position: relative;
}

.rp-input-icon .rp-form-input {
    padding-left: 50px;
}

.rp-input-icon::before {
    content: '🔍';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

/* Pulsante di Ricerca */
.rp-submit-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--rp-primary), var(--rp-secondary));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, var(--rp-primary-dark), var(--rp-primary));
}

.rp-submit-btn:active {
    transform: translateY(0);
}

/* Loading State */
.rp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rp-loading .rp-submit-btn {
    position: relative;
}

.rp-loading .rp-submit-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: rp-spin 0.8s linear infinite;
    right: 20px;
    top: 50%;
    margin-top: -10px;
}

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

/* ===================================
   Pagina Risultati
   =================================== */

.ricerca-piscine-results {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.rp-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 20px;
}

.rp-results-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--rp-dark);
    margin-bottom: 10px;
}

.rp-results-count {
    font-size: 18px;
    color: var(--rp-gray);
}

.rp-results-count strong {
    color: var(--rp-primary);
    font-weight: 700;
}

/* Griglia Prodotti */
.rp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.rp-product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.rp-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.rp-product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--rp-light);
}

.rp-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rp-product-card:hover .rp-product-image img {
    transform: scale(1.1);
}

.rp-product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--rp-success);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
}

.rp-product-content {
    padding: 24px;
}

.rp-product-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rp-dark);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rp-product-title a {
    color: var(--rp-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.rp-product-title a:hover {
    color: var(--rp-primary);
}

.rp-product-excerpt {
    font-size: 14px;
    color: var(--rp-gray);
    margin-bottom: 16px;
    line-height: 1.6;
}

.rp-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--rp-border);
}

.rp-product-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--rp-primary);
}

.rp-product-price del {
    font-size: 16px;
    color: var(--rp-gray);
    margin-right: 8px;
}

.rp-product-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--rp-primary), var(--rp-secondary));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.rp-product-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

/* Nessun Risultato */
.rp-no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--rp-light);
    border-radius: 20px;
}

.rp-no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.rp-no-results-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--rp-dark);
    margin-bottom: 10px;
}

.rp-no-results-text {
    font-size: 16px;
    color: var(--rp-gray);
    margin-bottom: 30px;
}

.rp-back-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--rp-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.rp-back-btn:hover {
    background: var(--rp-primary-dark);
    transform: translateY(-2px);
}

/* Filtri Avanzati */
.rp-filters-toggle {
    text-align: center;
    margin: 20px 0;
}

.rp-filters-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-primary);
    background: white;
    border: 2px solid var(--rp-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rp-filters-btn:hover {
    background: var(--rp-primary);
    color: white;
}

.rp-advanced-filters {
    background: var(--rp-light);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 767px) {
    .ricerca-piscine-box {
        padding: 30px 20px;
    }
    
    .ricerca-piscine-title {
        font-size: 24px;
    }
    
    .rp-results-title {
        font-size: 28px;
    }
    
    .rp-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rp-product-card {
    animation: fadeInUp 0.6s ease backwards;
}

.rp-product-card:nth-child(1) { animation-delay: 0.1s; }
.rp-product-card:nth-child(2) { animation-delay: 0.2s; }
.rp-product-card:nth-child(3) { animation-delay: 0.3s; }
.rp-product-card:nth-child(4) { animation-delay: 0.4s; }
.rp-product-card:nth-child(5) { animation-delay: 0.5s; }
.rp-product-card:nth-child(6) { animation-delay: 0.6s; }

/* Accessibility */
.rp-form-input:focus-visible,
.rp-form-select:focus-visible,
.rp-submit-btn:focus-visible {
    outline: 3px solid var(--rp-primary);
    outline-offset: 2px;
}
