/* css/pages.css */
/* Style specyficzne dla konkretnych podstron i widoków */

/* =========================================
   STRONA GŁÓWNA (Kalkulator)
   ========================================= */

/* Siatka kompasu 3x3 */
.compass-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

/* Przyciski kierunków */
.direction-button {
    aspect-ratio: 1 / 1;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direction-button:hover {
    background-color: #dee2e6;
}

.direction-button.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

/* Pusty środek kompasu */
.direction-button:nth-child(5) {
    visibility: hidden;
    pointer-events: none;
}


/* =========================================
   STRONA GŁÓWNA (FAQ)
   ========================================= */

.faq-item {
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.faq-question {
    padding: 20px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-answer {
    display: none;
    padding-bottom: 20px;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-question {
    color: var(--color-primary);
}


/* =========================================
   WYSZUKIWARKA - FILTRY (Sidebar)
   ========================================= */

.search-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.filter-content {
    padding: 5px 0 15px 0;
    display: none;
}

.filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-heading i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.filter-heading.active i {
    transform: rotate(180deg);
}

/* Inputy w filtrach */
.dual-input {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.dual-input input {
    width: 50%;
}

.dim-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}

.dim-inputs input {
    width: 100%;
    padding: 5px;
    font-size: 0.8rem;
}

.dim-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-align: center;
}

.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Pojedynczy element checkboxa w filtrach */
.filter-checkbox-item {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================================
   KARTA PRODUKTU (Nowy Wygląd)
   ========================================= */

/* Główny kontener wewnątrz karty (.card definiowane w components.css) */
.product-card-top-layout {
    display: flex;
    gap: 30px; /* Odstęp między zdjęciem a tabelą */
    align-items: flex-start;
}

/* Lewa kolumna: Zdjęcie i Logo */
.product-image-col {
    flex: 0 0 240px; /* Stała szerokość kolumny zdjęcia */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.product-main-img {
    max-height: 160px; /* Ograniczenie wysokości zdjęcia */
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
    transition: opacity 0.2s ease;
}

.product-brand-logo {
    max-height: 35px;
    width: auto;
    object-fit: contain;
    margin-top: 5px;
}

/* Prawa kolumna: Tabela parametrów */
.product-details-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Kontener na wiersze */
.specs-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Pojedynczy wiersz tabeli */
.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Ważne: centruje pionowo tekst i ikonki info */
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0; /* Delikatna linia */
    font-size: 0.95rem;
    color: var(--text-main);
}

.spec-row:last-child {
    border-bottom: none;
}

/* Lewa strona wiersza (Etykieta + Ikonka Info) */
.spec-row span:first-child {
    color: var(--text-muted);
    font-weight: 400;
    display: flex;
    align-items: center; /* Żeby ikonka była w linii z tekstem */
}

/* Prawa strona wiersza (Wartość) */
.spec-row strong {
    font-weight: 600;
    color: var(--text-main);
}

/* Wiersz z ceną - wyróżnienie */
.price-row {
    margin-top: 5px;
    padding-top: 12px;
    font-size: 1.05rem;
    border-bottom: none;
}

/* Kulki kolorów (teraz wewnątrz wiersza tabeli) */
.color-swatch-container {
    display: inline-flex;
    gap: 6px;
    vertical-align: middle;
}

.color-swatch {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.2);
    z-index: 2;
}

.color-swatch.active {
    border: 2px solid var(--text-main);
    transform: scale(1.1);
}

/* Przyciski akcji (Buttony) */
.product-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end; /* Wyrównanie do prawej */
    margin-top: 25px;
}

.product-actions .btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    min-width: 140px; /* Żeby przyciski były równe */
}

/* --- SEKCJA ROZWIJANA (Więcej parametrów) --- */
.toggle-details-btn {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-details-btn:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.toggle-details-btn i {
    margin-left: 5px;
}

.extended-details {
    background-color: #fcfcfc;
    padding: 20px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #f0f0f0;
}

/* Nadpisanie stylów dla tabelki wewnątrz extended-details */
.extended-details .spec-row {
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px dotted #e0e0e0;
}


/* =========================================
   STRONA PRODUKTU (Details Page)
   ========================================= */

.btn-fixed-bottom {
    position: fixed;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    bottom: 20px;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    width: 300px;
    text-align: center;
}

.product-specs .grid-2 {
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
}

.product-specs .grid-2:last-child {
    border-bottom: none;
}

.product-image-container img {
    max-height: 350px; /* Blokada wysokości */
    width: auto;       /* Szerokość proporcjonalna */
    max-width: 100%;   /* Nie szersze niż kontener */
    object-fit: contain;
    margin: 0 auto;    /* Wycentrowanie */
    display: block;
}


/* =========================================
   INSTALATORZY & MAPY (SVG)
   ========================================= */

.map-container {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.voivodeship-path {
    fill: #e9ecef;
    stroke: #adb5bd;
    stroke-width: 1px;
    transition: fill 0.3s ease;
    cursor: pointer;
}

.voivodeship-path:hover {
    fill: #dee2e6;
}

.highlighted-voivodeship {
    fill: #28a745 !important;
    stroke: #1e7e34 !important;
    opacity: 0.8;
}

.range-circle {
    fill: rgba(229, 57, 53, 0.2);
    stroke: var(--color-primary);
    stroke-width: 2px;
    pointer-events: none;
}

.installers-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
    padding-top: 8px;
}


/* =========================================
   RESPONSYWNOŚĆ (RWD)
   ========================================= */

@media (max-width: 992px) {
    /* Wyszukiwarka: Sidebar nad wynikami */
    .search-layout {
        flex-direction: column;
    }
    
    #left-filters {
        width: 100% !important;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    /* Karta produktu na mobile */
    .product-card-top-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .product-image-col {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 10px;
    }

    .product-details-col {
        width: 100%;
    }

    /* Na mobile wiersze mogą być bardziej ściśnięte */
    .spec-row {
        justify-content: space-between; /* Zachowaj layout lewo-prawo */
        text-align: left;
    }

    .product-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .product-actions .btn {
        width: 100%;
    }

    /* Mapa i lista instalatorów */
    .installers-layout {
        flex-direction: column-reverse;
    }

    .map-container {
        min-height: 300px;
    }
    
    .installers-list {
        max-height: none;
    }
}