/* ===========================
   Zmienne
=========================== */
:root {
    --primary-color: #1E1E24;
    --secondary-color: #777777;
    --border-color: #DDDDDD;
    --background-grey: #F0F0F5;
    --card-bg: #EAEAEA;
    --button-bg-color: #3D40BF;
    --button-bg-hover: #1E2067;
    --button-text-color: #FAFAFA;
    --dark-grey-bg: #CCCCCC;
    --font-size-small: 12px;
}


/* ===========================
   Kontener główny
=========================== */

.property-listing-container {
    width: 100%;
}

.property-listing-container * {
    box-sizing: border-box;
    font-family: inherit;
    color: var(--primary-color);
}

/* ===========================
   Header + sortowanie (Bez zmian)
=========================== */

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px 0;
}

.found-count {
    font-size: var(--font-size-small);
    color: var(--secondary-color);
}

.sort-dropdown-wrapper {
    position: relative;
    display: inline-block;
    border: none;
    border-radius: 10px;
    background-color: #E3E3E3;
    padding: 0;
    min-width: 180px;
    height: 40px;
    overflow: hidden;
}

.sort-dropdown {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    padding: 0 36px 0 16px;
    font-size: 14px !important;
    color: #4A4A4A !important;
    cursor: pointer;
    outline: none;
    width: 100%;
    height: 100%;
    line-height: normal;
}

.sort-dropdown-wrapper .dropdown-arrow {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sort-dropdown-wrapper .dropdown-arrow img {
    width: 10px;
    height: 10px;
    display: block;
}

/* ===========================
   Lista kart (STYLISTYKA)
   - Zaktualizowano dla efektu "ramka w ramce" (padding 8px na głównej karcie)
=========================== */

.property-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Karta Nieruchomości (Główny szary kontener) --- */
.property-card {
    display: flex;
    flex-direction: row;
    border: none;
    background-color: var(--card-bg); /* Szare tło */
    align-items: stretch; /* Rozciąga oba wewnętrzne kontenery do równej wysokości */
    
    /* KLUCZOWE ZMIANY DLA EFEKTU RAMKI: */
    border-radius: 12px; /* Zaokrąglenie głównego kontenera */
    padding: 8px;        /* Wewnętrzny odstęp od krawędzi */
    gap: 30px;           /* Odstęp między kontenerem zdjęcia a kontenerem treści */
    
    /* Usuwamy overflow: hidden stąd, bo wewnętrzne kontenery mają swoje zaokrąglenia */
    /* overflow: hidden; */ 
    
    /* Usuwamy sztywną wysokość, niech treść dyktuje wysokość, a zdjęcie się dopasuje (stretch) */
    /* min-height: 380px; */
}

/* --- LEWA KOLUMNA: ZDJĘCIE (Wewnętrzny kontener) --- */
.property-image-placeholder {
    flex: 0 0 45%; 
    width: 45%; 
    background-color: var(--dark-grey-bg);
    position: relative;
    overflow: hidden; /* Przycinanie zdjęcia wewnątrz tego kontenera */
    
    /* KLUCZOWA ZMIANA: Własne zaokrąglenie dla zdjęcia */
    border-radius: 12px; 
    
    /* Zapewnia, że kontener wypełnia wysokość narzuconą przez flex stretch */
    display: flex; 
    flex-direction: column;
}

.property-image-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center center;
    display: block;
    transition: transform 0.5s ease;
}

.property-card:hover .property-image-placeholder img {
    transform: scale(1.05);
}

/* Etykieta "Świeża oferta" */
.fresh-offer-label {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #FFFFFF;
    color: var(--primary-color);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- PRAWA KOLUMNA: TREŚĆ (Wewnętrzny kontener) --- */
.property-details {
    flex: 1; 
    /* Padding wewnętrzny treści. 
       Wizualny odstęp od krawędzi szarej karty to teraz: 8px (karta) + 20px (ten padding) */
    padding: 20px 20px 20px 0; 
    
    display: flex;
    flex-direction: column;
    justify-content: center; 
    gap: 25px; 
    min-width: 0;
}

/* 1. BLOK GÓRNY (Info) */
.property-top-info {
    display: flex;
    flex-direction: column;
}

.property-price {
    font-size: 32px;
    font-weight: 800; 
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 12px; 
}

.sale-status {
    font-size: 15px;
    color: var(--secondary-color);
    margin: 0 0 4px 0; 
    font-weight: 500;
}

.property-address {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.property-address a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.property-address a:hover {
    text-decoration: underline;
}

/* 2. BLOK ŚRODKOWY (Ikony + Kreski) */
.property-specs-wrapper {
    width: 100%;
    border-top: 1px solid #C2C2C2; 
    border-bottom: 1px solid #C2C2C2; 
    padding: 16px 0; 
}

.property-specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 25px; 
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333; 
}

.spec-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6; 
    display: block;
}

/* 3. BLOK DOLNY (Przycisk) */
.property-btn-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-end; 
}

.view-details-btn {
    width: 50%; 
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    padding: 14px 0; 
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px; 
    text-align: center; 
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.view-details-btn:hover {
    background-color: var(--button-bg-hover);
    transform: translateY(-1px);
    color: #FAFAFA;
}


/* ===========================
   Responsywność (Mobile)
=========================== */

@media (max-width: 900px) {
    .property-card {
        flex-direction: column;
        padding: 12px; /* Nieco większy padding na mobile */
        gap: 20px;
    }

    .property-image-placeholder {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        height: 260px; 
    }
    
    /* Na mobile, gdy zdjęcie jest nad tekstem,
       zaokrąglamy tylko górne rogi zdjęcia */
    .property-image-placeholder {
         border-radius: 12px 12px 0 0;
    }
    
    .property-image-placeholder img {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    .property-details {
        width: 100%; 
        padding: 10px 5px; /* Mniejszy padding wewnętrzny na mobile */
        gap: 20px;
    }

    .property-specs {
        justify-content: space-between; 
        gap: 15px;
    }
    
    .view-details-btn {
        width: 100%; 
    }
}

/* ===========================
   Paginacja (Bez zmian)
=========================== */

.pagination {
    position: relative;
    display: flex;
    align-items: center;
    padding: 40px 0 0 0;
    gap: 12px;
}

.page-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-number,
.nav-arrow {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: var(--font-size-small);
    min-width: 35px;
    text-align: center;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-number.active {
    background-color: #E3E3E3;
    border-color: #E3E3E3;
    color: #333333;
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 24px;
}

.nav-arrow {
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
}

.nav-arrow img {
    width: 14px;
    height: 14px;
    display: block;
}

.nav-arrow.disabled {
    cursor: default;
    opacity: 0.4;
}

.ellipsis {
    padding: 0 4px;
    font-size: var(--font-size-small);
}

.items-per-page-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-size: var(--font-size-small);
    position: relative;
    padding-left: 10px;
}

.per-page-label {
    margin-right: 10px;
    color: var(--secondary-color);
}

.items-per-page-dropdown {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 8px 30px 8px 10px;
    font-size: var(--font-size-small);
    color: var(--secondary-color);
    cursor: pointer;
    outline: none;
    width: 60px;
    border-radius: 4px;
}

.items-per-page-wrapper .dropdown-arrow {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
}

.items-per-page-wrapper .dropdown-arrow img {
    width: 14px;
    height: 14px;
    display: block;
}

@media (max-width: 700px) {
    .pagination {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .page-nav {
        position: static;
        transform: none;
    }

    .items-per-page-wrapper {
        margin-left: 0;
    }
}

/* =========================================
   Widget: Podobne oferty
   ========================================= */

.asari-similar {
    margin-top: 32px;
}

.asari-similar__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
}

.asari-similar__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 767px) {
    .asari-similar__grid {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .asari-similar__grid>.asari-card {
        flex: 0 0 85%;
        scroll-snap-align: start;
        flex-direction: column;
    }

    .asari-similar__grid>.asari-card .property-image-placeholder {
        height: 180px;
    }

    .asari-similar__grid::-webkit-scrollbar {
        display: none;
    }
}




/* =========================================
   Ikony specyfikacji w kartach ofert
   ========================================= */

.property-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 48x;
}

.property-specs .spec-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #333333;
}

.property-specs .spec-item::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Przykładowe ikony – podmień ścieżki na swoje SVG */

.property-specs .spec-item--rooms::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/bed.svg");
}

.property-specs .spec-item--area::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/ruler.svg");
}

.property-specs .spec-item--lot-area::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/land-plot.svg");
}

.property-specs .spec-item--floor::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/arrow-up-wide-narrow.svg");
}

.property-specs .spec-item--year::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/calendar.svg");
}

.property-specs .spec-item--building::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/house.svg");
}

.property-specs .spec-item--type::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/map-pin-house.svg");
}

.property-specs .spec-item--location::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/map.svg");
}

.property-specs .spec-item--price-m2::before {
    background-image: url("https://wroclawskienieruchomosci.com/wp-content/uploads/2025/12/circle-dollar-sign-1.svg");
}
