/*
Theme Name: Kadence Child
Description: Child theme for Kadence
Template: kadence
Version: 1.0
*/

/* --- ZMIENNE GLOBALNE --- */
:root {
    /* Kolory ognia/akcentu (neobrutalizm) */
    --fire-1: #56dde3;          /* Pomarańcz */
    --fire-2: #33b7bc;          /* Różowo-czerwony */
    --fire-3: #1aa1a6;          /* Ciemna czerwień */

    /* Kolory tła/tekstu (ciemny schemat) */
    --card-bg: #111111;         /* Tło karty/formularza */
    --card-bg-hover: #1a1a1a;   /* Tło karty hover / kontrolki formularza */
    --text-main: #eee;
    --text-muted: #999;
    --text-spec: #d0d0d0;       /* Kolor tekstu specyfikacji */

    /* Kolory specyficzne */
    --green-price: #00ff7f;     /* Jaskrawo zielona cena */
    --orange: #fe8d59;          /* Pomarańcz do nagłówków w tabeli */
    --yellow-accent: #c8b824;   /* Żółty akcent dla etykiet/obramowań filtrów */
	--turquoise: #33b7bc;
    
    /* Ogólne */
    --radius: 12px;
    --anim-duration: 0.3s;
    --shadow-dark: 0 4px 12px rgba(0,0,0,0.6);
}

/* --- WRAPPERY STRONY/GRID GŁÓWNY --- */
.auta-page-wrapper.site-container {
    margin-top: 200px;
    margin-bottom: 80px;
}

/* Grid: Filtry + Listing (Desktop) */
.auta-grid {
    display: grid;
    /* Ujednolicenie: 280px dla filtrów */
    grid-template-columns: 280px 1fr; 
    gap: 60px; /* Ujednolicenie: 30px */
    margin-top: 30px;
    align-items: flex-start;
}

.auta-listing {
    flex: 1 1 auto;
}

/* --- FILTRY (auta-filters, car-filter-form) --- */

.auta-filters {
    /* Styl sticky dla desktopu */
    position: sticky;
    top: 30px;
    height: fit-content;
    padding-bottom: 30px;
    
    /* Usunięcie zbędnych i konfliktowych stylów tła/shadow */
    background: none; 
    padding: 0;
    box-shadow: none;
}

/* KONTENER FILTRÓW (Formularz) */
.car-filter-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    background: var(--card-bg-hover);
    border-radius: var(--radius); /* Użycie zmiennej */
    font-family: 'Roboto', sans-serif;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-weight: 600;
    font-size: 14px;
    /* Ujednolicenie: żółty akcent */
    color: var(--turquoise); 
    margin-bottom: 2px;
}

/* SELECT + KRZYŻYK */
.filter-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.filter-select {
    flex-grow: 1;
    padding: 12px 30px 12px 12px;
    border: 2px solid #555;
    background-color: #2e2e2e; /* Ciemniejszy niż --card-bg-hover */
    color: #fff;
    border-radius: 0;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Strzałka w kolorze białym */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    /* Ujednolicenie: żółty akcent */
    border-color: var(--yellow-accent); 
    outline: none;
}

/* Krzyżyk do usuwania pojedynczego filtra */
.filter-clear-one {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    line-height: 1;
    opacity: 1;
    z-index: 10;
    cursor: pointer;
}

.filter-clear-one .clear-icon {
    width: 100%;
    height: 100%;
    /* Ujednolicenie: żółty akcent */
    fill: var(--yellow-accent); 
    transition: all 0.2s ease;
}

.filter-clear-one:hover .clear-icon {
    fill: #ff3333;
    /* Dodanie delikatnego glow */
    filter: drop-shadow(0 0 5px rgba(255, 51, 51, 0.7));
}

/* Akcje (Filtruj/Reset) */
.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    min-height: 48px; /* Zapewnienie stałej wysokości */
    align-items: stretch;
}

/* Element zastępczy (div) - MUSI mieć tę samą wysokość co przycisk/link */
.filter-placeholder-hidden {
    visibility: hidden;
    flex-grow: 0;
    padding: 12px 20px;
    border: 2px solid transparent;
}


/* --- STYLI PRZYCISKÓW (GENERALNE) --- */
.custom-button-style {
    padding: 12px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 17px;
    font-weight: 600;
    border: 2px solid;
    border-radius: 0; /* Ujednolicenie: ostre rogi */
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all var(--anim-duration) ease; /* Użycie zmiennej */
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Przycisk Filtruj (DOMYŚLNY STYL) - Nadpisany przez custom-button-style-secondary w HTML */
.car-filter-submit {
    flex: 1 1 auto;
    /* Domyślny kolor jest żółty, ale ten selektor jest używany w połączeniu z .custom-button-style-secondary */
    background: var(--yellow-accent); 
    color: #fff;
    border-color: var(--yellow-accent);
}

/* STYL 1: Białe tło z czarnym borderem/tekstem (dla przycisku FILTRUJ) */
.custom-button-style-secondary {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

.custom-button-style-secondary:hover {
    background: var(--card-bg-hover) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* STYL 2: Przycisk Tertiary (Biały border, Przezroczyste tło) */
.custom-button-style-tertiary {
    background: transparent !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.custom-button-style-tertiary:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Przycisk Reset (Link) - Używa custom-button-style-tertiary lub zbliżonego */
.car-filter-reset {
    /* Ujednolicenie z .custom-button-style-tertiary */
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.car-filter-reset:hover {
    /* Ujednolicenie z .custom-button-style-tertiary */
    background: #fff;
    color: #000;
    border-color: #fff;
}


/* --- STRUKTURA KART (CAR CARD) --- */

/* Wrapper kafelków */
.auta-cards {
    display: grid;
    /* Ujednolicenie minmax */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 24px; /* Ujednolicenie: 24px */
}

.auta-cards > * {
    width: 100%;
    box-sizing: border-box;
}

.car-card {
    position: relative;
    /* Ujednolicone style ciemnej karty */
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text-main);
    font-family: 'Roboto', sans-serif; 
    box-shadow: var(--shadow-dark);
    transition: transform var(--anim-duration) ease, box-shadow var(--anim-duration) ease;
    display: flex;
    flex-direction: column;
    text-decoration: none; /* Upewnienie się dla a.car-card */
    color: inherit;
    height: 100%; /* Utrzymanie równej wysokości w gridzie */
}

/* Cały kafelek jako link */
.car-card a.full-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); /* Ujednolicone: mocniejszy shadow na hover */
}

.car-card:focus-visible {
    /* Ujednolicenie outline */
    outline: 2px solid var(--yellow-accent); 
    outline-offset: 2px;
}

/* --- ZDJĘCIE --- */
.car-card__image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.car-card__image img {
    width: 100%;
    height: 100%; /* Zmienione z 220px na 100% */
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.car-card:hover .car-card__image img {
    /* Ujednolicone: mniejsze powiększenie, aby wyglądało bardziej subtelnie */
    transform: scale(1.03); 
}

/* --- TREŚĆ KARTY --- */
.car-card__content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
}

.car-card__content h3 {
    margin: 6px 0 10px; /* Ujednolicone marginesy */
    font-size: 1.05rem; /* Ujednolicone font-size */
    font-weight: 600;
    color: #ffffff; /* Ujednolicone: biały */
    line-height: 1.3;
}

.car-card__title {
    font-size: 1.3rem; 
    margin: 0 0 6px;
    font-weight: 700;
    color: #fff;
    font-family: 'Roboto', sans-serif;
}


/* --- SPECYFIKACJE --- */
.car-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.car-spec {
    /* Ujednolicone style ciemnej specyfikacji */
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-spec);
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.2;
}

.car-card:hover .car-spec {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
    color: #ffffff;
    /* Dodanie delikatnego glow */
    text-shadow:
       0 0 2px rgba(255, 255, 255, 0.3),
        0 0 3px rgba(255, 255, 255, 0.3),
        0 0 5px rgba(255, 255, 255, 0.2);
}

/* --- CENA --- */
.car-card__price {
    font-size: 14px;
    color: #fff;
    margin-top: auto;
    text-shadow: 0 0 2px rgba(0,0,0,0.3);
    font-family: 'Roboto', sans-serif;
}

.car-card__price span {
    text-decoration: underline;
    color: var(--turquoise); /* Jaskrawo zielony akcent */
    font-weight: 700; /* Dodanie, aby podkreślić wartość */
}

/* --- STYLE DLA TABEL SPECYFIKACJI --- */
.mg-spec-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg-hover); /* Użycie tła hover/formularza */
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    margin-top: 20px;
}

.mg-spec-table td {
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #eee;
    border-bottom: 1px solid rgba(255,255,255,0.05);
	transition: 0.4s ease-out;
}

.mg-spec-table td.mg-spec-title, .mg-spec-table thead tr th {
    white-space: nowrap;
    font-weight: 500;
    color: var(--turquoise);
    font-size: 0.95rem;
    width: 35%;
}

.mg-spec-table td.mg-spec-value {
    font-weight: 500;
    color: #ddd;
}

.mg-spec-table tr:hover td {
    /* Akcent ognia na hover w tabeli */
    background: rgb(109 250 255 / 18%);
	transition: 0.1s ease-in;
}
.mg-spec-table tr:hover td.mg-spec-value {
	color: #fff;
}
.mg-footer {
	font-size: 12`px;
	color: #5e605b;
}

/* --- PAGINATION --- */
.auta-pagination {
    margin-top: 24px;
    text-align: center;
}

.auta-pagination a,
.auta-pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: 6px;
    border: 1px solid #333;
    background: var(--card-bg-hover);
    color: #ddd;
    font-size: 14px;
    transition: all var(--anim-duration) ease;
}

.auta-pagination a:hover {
    background: var(--fire-2);
    color: #fff;
    border-color: var(--fire-2);
}

.auta-pagination .current {
    background: var(--fire-3);
    border-color: var(--fire-3);
    color: #fff;
    font-weight: 600;
}

.slider-logos .kt-inside-inner-col {
	display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}
@media (max-width: 991px) {

    /* KONTENER GŁÓWNY */
    .slider-logos .kt-inside-inner-col {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important; /* Wyśrodkowanie rzędu, jeśli zostanie luz */
        column-gap: 2% !important; /* Lepiej użyć % przy RWD */
        row-gap: 15px !important;  /* Odstęp między rzędami */
		column-gap: 0 !imortnat;
    }

    /* POJEDYNCZY BOX (WRAPPER) - ma być ich 4 w rzędzie */
    .slider-logos .kt-inside-inner-col .wp-block-uagb-image {
        /* flex: grow shrink basis */
        /* 0 0 23% oznacza: nie rozciągaj, nie kurcz, sztywno trzymaj 23% szerokości */
        /* 4 * 23% = 92% + odstępy = 100% */
        flex: 0 0 23% !important; 
        height: 60px !important;    /* Sztywna wysokość pudełka */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;       /* Reset marginesów wrappera */
        padding: 0 !important;
    }

    /* FIGURE - POŚREDNIK (TO ON PSUŁ SPRAWĘ NA IPHONIE) */
    .slider-logos .kt-inside-inner-col .wp-block-uagb-image figure {
        margin: 0 !important;      /* KLUCZOWE: Usuwa domyślne wcięcia Safari */
        padding: 0 !important;
        width: 100% !important;    /* Musi wypełnić wrappera */
        height: 100% !important;   /* Musi wypełnić wrappera */
        display: flex !important;  /* Robimy z niego flex, żeby wycentrować img */
        align-items: center !important;     /* Pion */
        justify-content: center !important; /* Poziom */
    }

    /* OBRAZEK */
    .slider-logos .kt-inside-inner-col .wp-block-uagb-image figure img {
        width: auto !important;
        height: auto !important;
        max-width: 95% !important;  /* Margines bezpieczeństwa wewnątrz pudełka */
        max-height: 100% !important; /* Żeby nie wyszedł poza wysokość 60px */
        object-fit: contain !important;
        display: block !important;
    }
}


/* --- MOBILE: AKORDEON I WIDOK --- */

/* Przycisk toggle POZA aside - pokazywany tylko na mobile */
.mobile-filter-toggle-outside {
    display: none;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
	.auta-page-wrapper.site-container {
    	margin-top: 80px;
    	margin-bottom: 80px;
	}
    /* GŁÓWNY GRID */
    .auta-grid {
        display: block; /* Zmieniamy grid na block/column */
        gap: 0;
        margin-top: 0;
    }

    /* PRZYCISK TOGGLE FILTRÓW */
    .mobile-filter-toggle-outside {
        display: block;
        position: relative;
        padding: 20px 0 0;
        z-index: 1000;
    }

    .mobile-filter-toggle-outside .car-filter-button {
        width: 100%;
        /* Użycie styli .custom-button-style-tertiary */
        background: transparent;
        border-color: #fff;
        color: #fff;
    }

    .mobile-filter-toggle-outside .car-filter-button:hover {
        background: #fff !important;
        color: #000 !important;
    }

    /* KONTENER FILTRÓW (Akordeon) */
    .auta-filters {
        position: static;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;

        /* Mechanizm ukrywania */
        pointer-events: none;
        padding-bottom: 0 !important;
        overflow: hidden;
        max-height: 0;
        margin-bottom: 0;
        opacity: 0;
        transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, margin-bottom 0.4s ease-in-out;
    }

    /* Klasa dodawana przez JS */
    .auta-filters.mobile-visible {
        max-height: 1000px;
        opacity: 1;
        box-shadow: 0 5px 15px rgba(0,0,0,0.4);
        margin-bottom: 20px;
        pointer-events: auto;
    }

    /* Formularz w akordeonie */
    .car-filter-form {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 25px; /* Ujednolicone paddingi */
        border-radius: 0 0 var(--radius) var(--radius); /* Zaokrąglenie tylko na dole */
    }

    /* LISTING KART */
    .auta-listing {
        width: 100%;
    }

    /* KARTY */
    .auta-cards {
        grid-template-columns: 1fr; /* Wymuś jedną kolumnę */
        gap: 18px; /* Mniejszy gap na mobile */
    }
	.car-hero {
		margin-top: 200px !important;
	}
}

/* Media query dla mniejszych urządzeń (ponowne użycie 768px, jeśli jest potrzebne) */
@media (max-width: 768px) {
    /* Utrzymujemy powyższe style mobilne (900px) */
    /* Upewnienie się, że grid z kafelkami ma mniejszy odstęp (nadpisane już wyżej, ale dla pewności) */
     .auta-cards {
        gap: 18px;
    }
}

.szybki-kontakt span, .szybki-kontakt a {
	white-space: nowrap;
}