/* Perusasetukset */
.hidden { display: none !important; }

/* --- SUODATINOSIO (MODERNI) --- */

.filter-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Suodata-painike (se joka näkyy aina) */
#toggle-filters {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #1e293b;
}

#toggle-filters:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Avautuva suodatinlaatikko */
#filter-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Suodattimen sisällä olevat otsikot ja ryhmät */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Syötekentät ja Select-valikko */
.price-inputs input, #sort {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.price-inputs input:focus, #sort:focus {
    border-color: #0073e6;
}

.price-inputs input {
    width: 90px;
}

#sort {
    min-width: 180px;
    cursor: pointer;
}

/* "Näytä" eli Apply-painike */
#apply-filters {
    background: #0073e6;
    color: white;
    border: none;
    padding: 11px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#apply-filters:hover {
    background: #005bb8;
}

/* --- TUOTELISTALTA JA KORTIT --- */

#results-list {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.pc-image {
    background: #fafafa;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.pc-image img {
    height: 180px;
    object-fit: contain;
    max-width: 100%;
}

.pc-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.pc-content h3 {
    font-size: 16px;
    margin: 0 0 10px;
    color: #1e293b;
    line-height: 1.4;
}

.pc-content p {
    font-size: 13px;
    color: #64748b;
    flex-grow: 1;
    margin-bottom: 15px;
}

.pc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-bottom span {
    font-weight: 700;
    font-size: 18px;
    color: #0073e6;
}

.pc-bottom a {
    background: #0073e6;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* --- LATAUS JA SIVUTUS --- */

#loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 300px;
}

.loader-logo img {
    max-width: 500px;
    height: auto;
    margin-bottom: 10px;
}

.loader-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073e6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

#result-info {
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 15px;
    color: #64748b;
    font-size: 14px;
}

#pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

#pagination button {
    padding: 12px 24px;
    border: 2px solid #0073e6; /* Sininen reuna */
    background: #ffffff;
    color: #0073e6; /* Sininen teksti */
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#pagination button:hover {
    background: #0073e6;
    color: #ffffff; /* Teksti muuttuu valkoiseksi kun hiiri on päällä */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,115,230,0.2);
}

#pagination button:active {
    transform: translateY(0);
}

/* Mobiilioptimointi */
@media (max-width: 600px) {
    #filter-box {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    .price-inputs input {
        flex: 1;
    }
}
/* Koko yläosan säiliö */
.search-header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Logon koko tässä kohdassa */
.search-logo img {
    height: 50px; /* Säädä korkeus sopivaksi */
    width: auto;
}

/* Hakukentän kääre */
.fast-search-wrapper {
    display: flex;
    flex: 1;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 50px; /* Pyöreä moderni muoto */
    background: #fff;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.fast-search-wrapper:focus-within {
    border-color: #0073e6;
    box-shadow: 0 4px 20px rgba(0, 115, 230, 0.15);
}

/* Itse tekstikenttä */
#search-input {
    flex: 1;
    border: none !important;
    padding: 15px 25px !important;
    font-size: 16px !important;
    outline: none !important;
    background: transparent;
}

/* Hakunappi kentän sisällä */
#search-button {
    background: #0073e6;
    color: white;
    border: none;
    padding: 0 30px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

#search-button:hover {
    background: #005bb8;
}

/* Mobiiliasettelu (logo yläpuolelle jos ei mahdu) */
@media (max-width: 768px) {
    .search-header-container {
        flex-direction: column;
        gap: 20px;
    }
    .search-logo img {
        height: 40px;
    }
}