/* ==========================================================================
   1. ZMIENNE I KONFIGURACJA (THEME - Dopasowane do Screenów)
   ========================================================================== */
:root {
    /* Kolory Statusów (Paski i Tła) */
    --am-status-available-bg: #f3f3f3; /* Szary z screena */
    --am-status-available-bar: #28a745; /* Zielony pasek */
    --am-status-reserved-bg: #e3f2fd; /* Jasny niebieski z screena */
    --am-status-reserved-bar: #2196f3; /* Niebieski pasek */
    --am-status-sold-bg: #ffebee; /* Jasny różowy z screena */
    --am-status-sold-bar: #f44336; /* Czerwony pasek */
    /* UI Elements */
    --am-btn-gray-bg: #f0f0f0;
    --am-btn-gray-text: #333;
    --am-radius-card: 16px; /* Zaokrąglenie kart mobile */
    --am-radius-table: 16px; /* Zaokrąglenie desktop */
}
/* ==========================================================================
   2. STICKY HEADER (SENTINEL)
   ========================================================================== */
/* Sentinel - niewidoczny element techniczny */
.am-sticky-sentinel {
    position: absolute; top: 0; left: 0; right: 0; height: 1px; visibility: hidden; pointer-events: none;
}
#am-global-tooltip {
    position: absolute;
    background: #1d2327;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 100010 !important; /* Musi być wyżej niż modal */
    pointer-events: none;
    max-width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.am-apartments-container .am-apartments-table th {
    position: sticky !important;
top: 0 !important; 
z-index: 900 !important; 
	background-color:white;
    border-bottom: none !important; /* Czysty wygląd nagłówka */
}
.am-apartments-container .am-apartments-table thead.is-stuck th {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Miękki cień */
    background-color: #fff !important; /* Białe tło po przyklejeniu */
}
/* ==========================================================================
   3. WIDOK DESKTOP
   ========================================================================== */
.am-apartments-container .am-table-responsive-wrapper {
    background: transparent; 
	border: none;
	max-height: var(--am-table-height, none);
	overflow-y: auto !important;
	overflow-x: hidden !important;
	width: 100%;
}
.am-apartments-container .am-apartments-table {
    border-collapse: separate !important; 
	border-spacing: 0 var(--am-row-spacing, 8px) !important;
	width: 100% !important;
	table-layout: auto;
}
.am-apartments-container .am-apartments-table th {
    background-color: var(--am-th-bg, transparent) !important;
    color: var(--am-th-color, #6c757d) !important;
    font-weight: 600;
    text-transform: uppercase;
   font-size:calc(var(--am-font-base, 14px)*0.75);
    letter-spacing: 0.05em;
    padding: 15px 0;
    border: none !important;
    text-align: center;
    white-space: nowrap;
    position: sticky !important;
    top: 0;
    z-index: 10;
}
.am-apartments-container .am-apartments-table thead tr,
.am-apartments-container .am-apartments-table thead th,
.am-apartments-container .am-apartments-table th,
.am-apartments-container .am-apartments-table thead tr:hover,
.am-apartments-container .am-apartments-table thead th:hover,
.am-apartments-container .am-apartments-table th:hover {
    transform: none !important;
box-shadow: none !important;
background-color: var(--am-th-bg, white) !important;
border-color: transparent !important;
}
.am-apartments-container .am-apartments-table thead.is-stuck th,
.am-apartments-container .am-apartments-table thead.is-stuck th:hover {
background-color: var(--am-th-bg, white) !important; 
    box-shadow: none !important; /* Brak cienia */
    border-bottom: none !important; /* Brak ramki */
    color: var(--am-th-color, #6c757d) !important;
    transform: translateZ(0) !important;
	z-index: 900 !important;
	opacity: 1 !important;
	filter: none !important
}
.am-apartments-container .am-apartments-table th.sortable {
    cursor: pointer;
text-align:center !important;
}
.am-apartments-container .am-apartments-table th.sortable::after {
    border-top-color: var(--am-th-color, #ccc); /* Strzałka dziedziczy kolor nagłówka */
    opacity: 0.4;
}
.am-apartments-container .am-apartments-table th.sortable:hover::after {
    opacity: 1;
}
/* Wiersze - Styl "Kapsuła" */
.am-apartments-container .am-apartments-table tbody tr {
    box-shadow: none; transition: none;
}

.am-apartments-container .am-apartments-table tbody tr:hover td {
	background-color: var(--am-tr-bg-hover, #fdfdfd) !important;
}

.am-apartments-container .am-apartments-table tbody tr:hover,
.am-apartments-container .am-apartments-table tbody tr:not(.group-sold):hover,
.am-apartments-container:not(.am-view-mode-cards) .am-apartments-table tbody tr,
.am-apartments-container:not(.am-view-mode-cards) .am-apartments-table tbody tr:hover {
    transform: none !important; 
    box-shadow: none !important;
    transition: none !important;
    background-color: transparent; 
}
.am-apartments-container .am-apartments-table td {
    background-color: var(--am-tr-bg, #ffffff);
    padding: var(--am-padding, 18px 20px); 
	vertical-align: middle; 
	border-top: var(--am-border, none);
	border-bottom: var(--am-border, none);
	border-left:none;
	border-right:none;
    color: var(--am-text-dark); 
	font-size: var(--am-font-base, 14px);
	white-space: nowrap;
}

.am-apartments-container .am-apartments-table tr {
	filter: none !important;
}

.am-apartments-container .am-apartments-table tr.am-details-view-row {
    filter: none !important;
    box-shadow: none !important;
    transform: none !important;
    background-color: transparent !important;
    border: none !important;
}

/* 2. Stylizacja komórki */
.am-apartments-container .am-apartments-table tr.am-details-view-row td {
    background-color: transparent !important; 
    cursor: default !important;
    white-space: normal !important;
    box-shadow: none !important;
    border: none !important;
}

.am-apartments-container .am-apartments-table tbody tr.am-details-view-row:hover,
.am-apartments-container .am-apartments-table tbody tr.am-details-view-row:hover td {
	background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
	filter: none !important
}

/* Zaokrąglenia wierszy */
.am-apartments-container .am-apartments-table td:first-child { 
    border-top-left-radius: var(--am-radius, 30px); 
    border-bottom-left-radius: var(--am-radius, 30px); 
    border-left: var(--am-border, none); 
}

.am-apartments-container .am-apartments-table td:last-child { 
    border-top-right-radius: var(--am-radius, 30px); 
    border-bottom-right-radius: var(--am-radius, 30px); 
    border-right: var(--am-border, none);
}

/* KOLORY STATUSÓW (DESKTOP) */
tr.group-available td { background-color: var(--am-status-available-bg)  }
tr.group-reserved td { background-color: var(--am-status-reserved-bg)  }
tr.group-sold td { 
    background-color: var(--am-status-sold-bg);
    opacity: 0.5 !important;
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
}

.am-apartments-container .am-apartments-table td.am-cell-am_property_status {
    display: table-cell !important; 
    vertical-align: middle !important; 
    text-align: center !important;
    white-space: nowrap !important;;
}


/* Overlay (Inteligentny Blur - Warstwa Frosted Glass) */
tr.am-has-overlay {
    position: relative; /* Pozycjonowanie kontekstu */
	pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
}
/* 1. Reset starego blura i ustawienie relatywności dla warstw */
tr.am-has-overlay td {
    filter: none !important;
    opacity: 1 !important;
    position: relative; 
    border-color: transparent !important; /* Ukrywa linie w zblurowanym wierszu */
}
/* 2. Matowa szyba nakładana NA treść komórki */
tr.am-has-overlay td::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.65); /* Półprzezroczysta biel */
    backdrop-filter: blur(3px); /* Rozmywa to co jest POD spodem */
    z-index: 5;
    pointer-events: none !important;
}
/* 3. Kontener pastylki (generowany przez JS w pierwszej komórce) */
.am-js-overlay {
    position: absolute;
    top: 50%;
    left: 0;
    /* width jest ustawiane przez JS, więc nie nadpisujemy */
    transform: translateY(-50%);
    z-index: 10; /* Musi być wyżej niż ::before (5) */
    display: flex;
    justify-content: center;
    pointer-events: none; /* Przepuszcza kliki, żeby nie blokować scrolla */
}
/* 4. Sama pastylka z tekstem */
.am-js-overlay span {
    background: #FF9F43;
    color: white;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
    pointer-events: none !important; /* Blokada hovera i kliknięć */
    white-space: nowrap;
}
/* Ceny i Detale */
.am-price-values strong { font-size: var(--am-font-base, 1.16em); font-weight: 700; color: var(--am-td-color, #1d1d1d); }
tr.is-promotional .am-price-values strong {
    color: var(--am-price-promo, #28a745) !important;
}
.am-regular-price { 
     font-size: 0.8em; 
    color: var(--am-price-old, #999999) !important; 
    text-decoration: line-through; 
    display: block; 
}

.am-details-toggle.is-icon { 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 5px; 
    opacity: 0.6; 
    transition: opacity 0.2s;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
width: 40px;
}
.am-details-toggle.is-icon:hover { opacity: 1; }

.am-price-cell {
    display: grid !important;       /* Grid zamiast flex */
    grid-template-columns: auto auto; /* Dwie kolumny dla dolnego rzędu */
    align-items: center !important;
    justify-content: center;
    justify-items: center;
    gap: 2px 6px;                   /* 2px pionowo, 6px poziomo między starą ceną a ikoną */
    vertical-align: middle;
}
/* Flattening struktury DOM dla .am-price-values, aby elementy dzieci stały się dziećmi Grida */
.am-price-values {
    display: contents !important; 
}
/* Wiersz 1: Cena Promocyjna (Strong) - na całą szerokość */
.am-price-values strong {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
}
/* Wiersz 2, Kolumna 1: Stara Cena */
.am-regular-price {
    grid-column: 1;
    display: block !important;
    margin: 0 !important;
    line-height: 1;
}
/* Wiersz 2, Kolumna 2: Ikona Omnibusa */
.am-price-cell .am-tooltip-trigger {
    grid-column: 2;
    display: inline-flex !important;
    margin: 0 !important;
    line-height: 1;
}
/* Reset kontenera ikonki, aby nie zajmował zbędnego miejsca */
.am-tooltip-trigger {
    display: inline-flex;
    margin: 0 !important;
    line-height: 1; /* Reset wysokości linii dla obrazka */
}
/* Kontener samych tekstów cen (Aktualna + Przekreślona) */
.am-price-values {
    display: flex;
    flex-direction: column; /* Ceny pozostają jedna pod drugą */
    justify-content: center;
    line-height: 1.2; 
}
/* ==========================================================================
   4. MOBILE CORE - KARTY
   ========================================================================== */
.am-mobile-modal { display: none; }
@media (max-width: 768px) {
.am-mobile-modal { display: block; }
/* ==========================================================================
       MOBILE LIST VIEW 
       ========================================================================== */
   .am-apartments-container:not(.am-view-mode-cards) table {
        border-collapse: separate !important; 
        border-spacing: 0 var(--am-row-spacing, 8px) !important;
        width: 100%;
    }
	
	
.am-addon-promo{
	display:none !important
}
	
    /* Aktywacja Sticky Header na Mobile */
    .am-apartments-container:not(.am-view-mode-cards) thead {
		background-color:white;
        display: table-header-group !important;
        position: sticky;
        top: 0;
        z-index: 100;
box-shadow: none !important;
    }
.am-apartments-container:not(.am-view-mode-cards) .am-apartments-table thead.is-stuck th,
    .am-apartments-container:not(.am-view-mode-cards) .am-apartments-table th {
        /* Przywracamy style typograficzne z desktopu */
        font-size: 0 !important; 
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: var(--am-th-color, #6c757d) !important;
        /* Reset tła i obramowania specyficznego dla mobile */
        background: transparent !important;
        background-color: transparent !important;
        border-bottom: none !important;
        box-shadow: none !important;
        /* Padding dostosowany, aby tekst się mieścił, ale w stylu desktop */
        padding: 15px 2px !important; 
        text-align: center !important;
    }
    /* Wstrzykiwanie skróconych nazw z data-short-label */
    .am-apartments-container:not(.am-view-mode-cards) th::after {
        content: attr(data-short-label);
        font-size: calc(var(--am-font-base, 12px) * 0.75);
        font-weight: 700;
        text-transform: uppercase;
        color: #666;
        display: block;
    }
    /* Ukrywanie zbędnych kolumn w nagłówku (Synchronizacja z body) */
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-cena_m2,
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-balkon,
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-rzut,
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-kontakt,
    .am-apartments-container:not(.am-view-mode-cards) th.am-details-toggle-col,
.am-apartments-container:not(.am-view-mode-cards) th[class*="am-cell-attr_"] {
        display: none !important;
    }
    /* Dopasowanie szerokości nagłówka do szerokości body zdefiniowanej wcześniej */
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-title,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-title { width: 18%; text-align: center !important; padding-left: 10px !important; }
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-pietro,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pietro { width: 8%; text-align: center !important; }
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-area,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-area { width: 17%;text-align: center !important; }
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-pokoje,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pokoje { width: 8%; text-align: center !important;}
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-cena_brutto,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-cena_brutto { width: 27%; text-align: center !important; }
    .am-apartments-container:not(.am-view-mode-cards) th.am-cell-am_property_status,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-am_property_status { width: 22%; text-align: center !important; }
.am-apartments-container:not(.am-view-mode-cards) tbody tr.is-promotional td.am-cell-cena_brutto strong {
         color: var(--am-price-promo, #28a745) !important;
    }
.am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-cena_brutto .am-regular-price {
        display: block !important;       /* Pokazujemy element */        
        font-size: .85em !important;
        color: var(--am-price-old, #999) !important; /* Kolor starej ceny */
        text-decoration: line-through;
        font-weight: 400;
        margin-top: 2px; /* Lekki odstęp od głównej ceny */
        line-height: 1.1;
    }
    /* 1. Globalny reset komórek - domyślnie ukryte */
    .am-apartments-container:not(.am-view-mode-cards) tbody td {
        display: none;
    }
    /* 2. Konfiguracja widocznych kolumn: Ujednolicony font i wyśrodkowanie */
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-title,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-area,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pietro,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pokoje,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-cena_brutto,
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-am_property_status {
        display: table-cell !important;
        font-size: calc(var(--am-font-base, 12px) * 0.8) !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding: 10px 2px !important;
        line-height: 1.3;
        white-space: normal !important;
        border-bottom: 1px solid #eee;
        color: #333;
    }


    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-cena_brutto strong {
        font-size: calc(var(--am-font-base, 12px) * 0.8) !important; 
        font-weight: 700 !important;
        display: block; /* Żeby ładnie siedziało w komórce */
    }
    /* 4. Dostosowanie szerokości kolumn (Suma ~100%) */
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-title { 
        width: 18%; 
        font-weight: 600; 
        text-align: left !important; 
        padding-left: 5px !important;
    }
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pietro { width: 8%; color: #666; }
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-area { width: 17%; }
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-pokoje { width: 8%; color: #666; }
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-cena_brutto { width: 27%; } 
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-am_property_status { 
        width: 22%; 
        font-size: calc(var(--am-font-base, 12px) * 0.8) !important
    }
    /* Reset stylów wiersza (płaski wygląd na liście) */
    .am-apartments-container:not(.am-view-mode-cards) tbody tr {
        box-shadow: none !important;
        transform: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    .am-apartments-container:not(.am-view-mode-cards) tbody td:first-child {
        border-top-left-radius: var(--am-radius, 10px) !important;
        border-bottom-left-radius: var(--am-radius, 10px) !important;
    }
    .am-apartments-container:not(.am-view-mode-cards) tbody td.am-cell-am_property_status {
        border-top-right-radius: var(--am-radius, 10px) !important;
        border-bottom-right-radius: var(--am-radius, 10px) !important;
    }

    /* Zmniejszamy go i centrujemy, żeby nie zasłaniał wszystkiego */
    .am-apartments-container:not(.am-view-mode-cards) .am-js-overlay span {
        font-size: 10px !important;
        padding: 2px 8px !important;
        background: rgba(255, 159, 67, 0.95) !important; /* Lekka przezroczystość */
    }
	
	
	
/* ==========================================================================
       MOBILE TOOLBAR (Filtry | Sortuj | Widok)
       ========================================================================== */
    .am-toolbar-wrapper {
        display: flex !important;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 15px;
        align-items: stretch; /* Równa wysokość */
position: relative; 
        z-index: 600;
    }
    /* Kontenery przycisków - podział na 3 równe części */
    .am-filters-wrapper,
    .am-mobile-sort-wrapper {
        flex: 1;
        width: auto !important;
        min-width: 0; /* Zapobiega rozpychaniu flexa */
        display: block !important;
    }
    /* Przycisk Zmiany Widoku (Lista/Karty) */
    .am-view-switcher-button {
        display: inline-flex !important; /* Nadpisuje style="display:none" z PHP */
        flex: 1;
        width: 100% !important;
        justify-content: center;
        /* Ikona i tekst są stylowane globalnie w sekcji 6, tu tylko layout */
    }
    /* Wewnętrzne przyciski filtrów i sortowania na pełną szerokość kontenera */
    .am-filters-toggle-button,
    .am-sort-toggle-button {
        width: 100% !important;
        justify-content: center;
        display: inline-flex !important;
    }
    .am-apartments-container.am-view-mode-cards .am-apartments-table thead { 
        display: none !important; 
    }
.am-apartments-container:not(.am-view-mode-cards) .am-table-responsive-wrapper { 
    padding: 5px;
    /* Przywracamy scrollowanie w liście, używając zmiennej z ustawień */
    overflow-y: auto !important;
    max-height: var(--am-table-height, none); 
}

.am-apartments-container.am-view-mode-cards .am-table-responsive-wrapper { 
    padding: 5px;
    /* Karty mają się wylewać (page scroll), overflow visible zapobiega ucinaniu cieni */
    overflow-y: auto !important;
    max-height: var(--am-table-height, none); 
}
	
    /* Kontener Karty */
    .am-apartments-container.am-view-mode-cards tbody tr {
        display: grid !important;
        /* Layout: Pasek(6px) | Dane(auto) | Obrazek(120px) */
        grid-template-columns: 6px 1fr 130px !important;
        /* Wiersze: Tytuł | Parametry | Cena | Stopka */
        grid-template-rows: auto auto 1fr auto !important;
        gap: 0 15px !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: var(--am-radius-card) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
        margin-bottom: 20px !important;
        padding: 5px 5px 5px 0 !important; /* Padding z prawej dla obrazka */
        position: relative; overflow: hidden;
        height: auto !important;
		cursor: pointer;
		pointer-events: auto;
    }
	
	
.am-apartments-container.am-view-mode-cards tbody tr td,
	.am-apartments-container.am-view-mode-cards tbody tr:hover td{
        background-color: transparent !important;
        background: transparent !important;
        box-shadow: none !important;
    }
	/* 1. Dostępne -> Pobieramy kolor paska z konfiguracji globalnej */
	.am-apartments-container.am-view-mode-cards tr.group-available {
        --status-color: var(--am-status-available-bar, #28a745);
    }
    /* 2. Zarezerwowane -> Pobieramy kolor paska (ciemniejszy) a nie tła */
    .am-apartments-container.am-view-mode-cards tr.group-reserved {
        --status-color: var(--am-status-reserved-bar, #2196f3);
    }
    /* 3. Sprzedane -> Pobieramy kolor paska z konfiguracji globalnej */
    .am-apartments-container.am-view-mode-cards tr.group-sold {
        --status-color: var(--am-status-sold-bar, #f44336);
        opacity: 0.5 !important;
	}
	
/* 1. Dostępne -> Kolor Ceny Promocyjnej */
    .am-apartments-container.am-view-mode-cards tr.group-available {
        --status-color: var(--am-status-available-bar, #28a745);
    }
    /* 2. Zarezerwowane -> Kolor tła wiersza Zarezerwowane (zdefiniowany w kroku 1) */
    .am-apartments-container.am-view-mode-cards tr.group-reserved {
        --status-color: var(--am-status-reserved-bar, #2196f3);
    }
    /* 3. Sprzedane -> Kolor Ceny przed obniżką (Starej) */
    .am-apartments-container.am-view-mode-cards tr.group-sold {
        --status-color: var(--am-status-sold-bar, #f44336);
opacity: 0.5 !important;           /* 50% przeźroczystości (czytelne, ale blade) */
        pointer-events: none !important;   /* Blokada klikania (nie otwiera modala) */
        user-select: none !important;      /* Blokada zaznaczania tekstu */
        cursor: default !important;
    }
.am-apartments-container:not(.am-view-mode-cards) .am-price-values {
        align-items: center !important;
        text-align: center !important;
    }
		
	.am-addon-status {
	font-size:12px;
}

.am-addon-current-price{
	font-size:12px;
}
.am-addon-regular-price{
	font-size:12px;
}
/* ==========================================================================
       WARIANT: Kafelki bez zdjęcia (Styl "Bilet/Karta")
       Odwzorowanie układu: Tytuł góra, Dane lewo, Cena prawo (z linią)
       ========================================================================== */
    .am-apartments-container.am-view-mode-cards tr.am-no-image {
        /* Definicja siatki: 
           Col 1: 6px (Pasek koloru)
           Col 2: auto (Dane - lewa strona)
           Col 3: 1fr (Cena - prawa strona, zajmuje resztę)
        */
        display: grid !important;
        grid-template-columns: 6px 1.4fr 1fr !important;
        /* Wiersze dopasowują się do treści */
        grid-template-rows: auto auto auto auto auto !important;
        gap: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 16px !important; /* Zaokrąglenie jak na screenie */
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
        overflow: hidden;
        margin-bottom: 20px !important;
        height: auto !important;
        position: relative;
    }

    /* Ukrywamy placeholder obrazka (prawa strona w zwykłych kartach) */
    .am-apartments-container.am-view-mode-cards tr.am-no-image::after {
        display: none !important;
    }

    /* --- 1. PASEK KOLORU (Lewa krawędź) --- */
    .am-apartments-container.am-view-mode-cards tr.am-no-image::before {
        grid-column: 1 / 2;
        grid-row: 1 / -1; /* Rozciągnij na całą wysokość */
        width: 100% !important;
        border-radius: 0 !important; /* Prostokątny pasek wewnątrz */
    }

    /* --- 2. TYTUŁ (Lokal 5) --- */
  .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-title {
        grid-column: 2 / -1 !important;
        grid-row: 1 !important;
        display: block !important;
        font-size: 18px !important;   /* MATCH: Standard */
        font-weight: 700 !important;  /* MATCH: Standard (było 800) */
        padding: 15px 15px 5px 15px !important;
        border: none !important;
        margin-bottom: 5px !important;
        color: #111;
        background: transparent !important;
        line-height: 1.3;
    }

    /* --- 3. DANE (Lewa kolumna: Powierzchnia, Piętro, Pokoje) --- */
    /* Wspólne style dla komórek danych */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-area,
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pietro,
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pokoje {
        grid-column: 2 / 3 !important;
        display: flex !important;
        align-items: center;
        padding: 2px 15px !important;
        font-size: 14px !important;
        font-weight: 600 !important;  /* MATCH: Standard (było 700) */
        color: #111;
        border: none !important;
        min-height: 24px;
    }
    
    /* Układamy je w kolejnych wierszach */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-area   { grid-row: 2 !important; }
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pietro { grid-row: 3 !important; }
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pokoje { grid-row: 4 !important; }

    /* Etykiety (Małe szare: POWIERZCHNIA, PIĘTRO...) */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-area::before,
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pietro::before,
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-pokoje::before {
        content: attr(data-label) " "; /* Pobiera tekst z atrybutu HTML */
        font-size: 10px !important;
        color: #999;
        font-weight: 600;
        text-transform: uppercase;
        margin-right: 8px;
        min-width: 80px; /* Stała szerokość etykiet dla równego układu */
        display: inline-block;
    }

    /* --- 4. CENA (Prawa kolumna z linią) --- */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-cena_brutto {
        grid-column: 3 / 4 !important;
        grid-row: 2 / 5 !important;
        display: flex !important;
        /* FIX: Wymuszamy kolumnę (pionowo) dla widoku bez obrazka */
        flex-direction: column !important; 
        justify-content: center !important;
        align-items: flex-start !important; /* Wyrównanie do lewej */
        padding: 0 15px !important;
        border-left: 1px solid #e0e0e0 !important; 
        margin: 5px 0 !important;
        gap: 0 !important; /* Resetujemy gap ustawiony globalnie dla kart */
    }

    /* Etykieta "CENA" */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-cena_brutto::before {
        content: 'CENA';
        font-size: 10px !important;
        color: #999;
        font-weight: 600;
        /* FIX: Przywracamy odstęp pod etykietą, bo jest nad ceną */
        margin-bottom: 4px !important; 
        display: block !important;
    }

    /* Styl samej ceny */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-cena_brutto strong {
        font-size: 20px !important;
        font-weight: 800 !important;
        color: #111;
        white-space: nowrap;
    }
    
    /* Ukrycie starej ceny w tym widoku, aby nie psuła układu (opcjonalne) */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-cena_brutto .am-regular-price {
        font-size: 10px !important;
    }

    /* --- 5. STOPKA (Ikony i Strzałka) --- */
    
    /* Ikony (Kontakt / Rzut) - Lewy dół */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-kontakt,
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-rzut {
        grid-column: 2 / 3 !important;
        grid-row: 5 !important;
        display: inline-flex !important;
        width: auto !important;
        padding: 15px 0 15px 15px !important;
        align-items: flex-end;
    }
    
    /* Odsunięcie ikon od siebie */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-rzut {
        padding-left: 20px !important; 
        pointer-events: none; /* Żeby klik w rzut nie blokował ikony pod spodem, jeśli się nakładają */
    }
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-rzut a {
        pointer-events: auto;
    }

    .am-apartments-container.am-view-mode-cards tr.am-no-image .am-table-icon {
        width: 24px !important;       /* MATCH: Standard (było 25px) */
        height: 24px !important;      /* MATCH: Standard (było 25px) */
        opacity: 0.7;                 /* MATCH: Standard (było 0.6) */
        transition: opacity 0.2s;
		border: none;
		border-radius: 0 !important;
    }
    
    /* Strzałka rozwijania - Prawy dół */
    .am-apartments-container.am-view-mode-cards tr.am-no-image td.am-cell-details-toggle {
        grid-column: 3 / 4 !important;
        grid-row: 5 !important;
        display: flex !important;
        justify-content: flex-end;
        align-items: flex-end;
        padding: 15px !important;
        background: transparent !important;
        border: none !important;
    }
    
    /* Ikona strzałki */
    .am-apartments-container.am-view-mode-cards tr.am-no-image .am-details-toggle-icon-img {
        width: 18px !important;
        height: 18px !important;
        opacity: 0.4;
        transform: rotate(0deg); /* Domyślnie w dół */
    }
}

/* FIX: "Deny All" - Domyślnie ukrywamy WSZYSTKIE komórki w widoku kart */
    .am-apartments-container.am-view-mode-cards td {
        display: none !important;
        background-color: transparent !important; /* Reset tła przy okazji */
        border: none !important;
    }
    /* 1. Kolorowy Pasek (Lewa krawędź) */
    .am-apartments-container.am-view-mode-cards tr::before {
        content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
        background-color: var(--status-color); z-index: 2;
        border-top-left-radius: var(--am-radius-card);
        border-bottom-left-radius: var(--am-radius-card);
    }
    /* 2. Obrazek (Rzut Izometryczny - Prawa Strona) */
    .am-apartments-container.am-view-mode-cards tr::after {
        content: ''; display: block !important;
        grid-column: 3 / 4; 
grid-row: 1 / 6; /* Zajmuje górę, środek i dół (obok ceny) */
        background-image: var(--bg-image, none);
        background-size: contain; background-repeat: no-repeat; background-position: center;
        margin-top: 10px;
    }
    /* 3. Tytuł (Apartament 1A) */
    .am-apartments-container.am-view-mode-cards td.am-cell-title {
        display: block !important; grid-column: 2 / 3; grid-row: 1;
        font-size: 18px !important; /* STANDARD: 18px */
        font-weight: 700 !important; /* STANDARD: Bold */
        color: #111;
        margin-bottom: 15px; 
        padding: 4px 0 !important;
        line-height: 1.3;
    }

    /* 4. Parametry (Powierzchnia, Piętro, Pokoje) */
    /* Generujemy etykiety "fake" za pomocą CSS ::before aby odwzorować screen */
    .am-apartments-container.am-view-mode-cards td.am-cell-area,
    .am-apartments-container.am-view-mode-cards td.am-cell-pietro,
    .am-apartments-container.am-view-mode-cards td.am-cell-pokoje {
        display: flex !important; grid-column: 2 / 3;
        font-size: 14px; font-weight: 600; color: #111;
        padding: 4px 0;
align-items: center;
    }
    /* Szare Etykiety */
    .am-apartments-container.am-view-mode-cards td.am-cell-area::before,
    .am-apartments-container.am-view-mode-cards td.am-cell-pietro::before,
    .am-apartments-container.am-view-mode-cards td.am-cell-pokoje::before {
        width: 80px; 
        font-size: 10px; 
        color: #888; 
        text-transform: uppercase; 
        font-weight: 400;
        display: inline-block; /* Bezpiecznik dla width */
    }

    /* Treść etykiet */
    .am-apartments-container.am-view-mode-cards td.am-cell-area::before { content: 'Powierzchnia'; }
    .am-apartments-container.am-view-mode-cards td.am-cell-pietro::before { content: 'Piętro'; }
    .am-apartments-container.am-view-mode-cards td.am-cell-pokoje::before { content: 'Pokoje'; }

    /* Ustawienie kolejności wierszy CSS Grid dla parametrów */
    .am-apartments-container.am-view-mode-cards td.am-cell-area { grid-row: 2; }
    .am-apartments-container.am-view-mode-cards td.am-cell-pietro { grid-row: 3; }
    .am-apartments-container.am-view-mode-cards td.am-cell-pokoje { grid-row: 4; }
    /* 5. Cena */
    .am-apartments-container.am-view-mode-cards td.am-cell-cena_brutto {
        /* ZMIANA: Flexbox zamiast Block - układa elementy obok siebie */
        display: flex !important; 
        flex-direction: row !important;
        align-items: baseline !important; /* Wyrównanie do linii tekstu */
        gap: 8px !important; /* Odstęp między etykietą a ceną */
        grid-column: 2 / 3; grid-row: 5;
        padding: 4px 0 !important;
    }
    .am-apartments-container.am-view-mode-cards td.am-cell-cena_brutto::before { 
        content: 'CENA'; /* ZMIANA: Etykieta wielkimi literami dla spójności */
        display: block; 
        font-size: 10px; 
        color: #888; 
        font-weight: 600; /* Lekko pogrubiona etykieta */
        text-transform: uppercase; 
        margin-bottom: 0 !important; /* Reset marginesu dolnego */
    }
    .am-apartments-container.am-view-mode-cards td.am-cell-cena_brutto strong { font-size: 18px; color: #111; font-weight: 800; }
    .am-apartments-container.am-view-mode-cards .am-regular-price { color: #f44336; font-size: 12px; font-weight: 600; }
    /* 6. Stopka (Ikony + Przycisk) */
    /* Grupujemy ikony (Kontakt/Rzut) */
    .am-apartments-container.am-view-mode-cards td.am-cell-kontakt,
    .am-apartments-container.am-view-mode-cards td.am-cell-rzut {
        display: inline-flex !important; grid-row: 6; grid-column: 2 / 3;
        width: auto !important; 
padding: 20px 0 !important; 
align-self: center;
    }

   .am-apartments-container.am-view-mode-cards td.am-cell-rzut { margin-left: 55px !important; } 
    .am-table-icon { width: 24px;
    height: 24px !important;
    opacity: 0.7;
    border: 0 !important;
    border-radius: 0 !important;align-content
}

    /* Przycisk "Zobacz szczegóły" */
    .am-apartments-container.am-view-mode-cards td.am-cell-details-toggle {
        display: block !important; grid-column: 2 / -1; grid-row: 6;
        padding: 15px 15px 0 0 !important; text-align: right; 
        pointer-events: none; /* Pozostawiamy none, aby klik "przelatywał" do tr */
        z-index: 5; /* Fix: Upewniamy się, że nie przykrywa warstwy klikalnej wiersza */
    }
    .am-apartments-container.am-view-mode-cards .am-details-toggle.is-button {
        display: inline-flex; 
        pointer-events: auto;
        width: auto !important;
    }
    /* Ukrycie zbędnych elementów na mobile */
    .am-apartments-container.am-view-mode-cards td.am-cell-cena_m2,
    .am-apartments-container.am-view-mode-cards td.am-cell-am_property_status,
    .am-apartments-container.am-view-mode-cards td.am-cell-balkon {
        display: none !important;
    }
.am-apartments-container.am-view-mode-cards tr.am-has-overlay td::before {
        /* W kartach ::before to etykiety (np. "Powierzchnia"), więc nie możemy tu robić blura */
        backdrop-filter: none !important;
        background: transparent !important;
        /* Etykiety muszą być widoczne pod spodem, więc usuwamy style z Desktopu */
        content: attr(data-label-text); /* lub przywracamy content z definicji wyżej */
    }
.am-apartments-container.am-view-mode-cards tr.am-has-overlay td:first-child {
        position: static !important; 
    }



/* 2. Stylizacja głównego kontenera Overlay */
    .am-apartments-container.am-view-mode-cards tr.am-has-overlay .am-js-overlay {
        /* Pozycjonowanie względem TR (Karty), a nie TD */
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        /* Wymiary: Cała karta */
        width: 100% !important;
        height: 100% !important;
        /* Flexbox do idealnego wycentrowania pastylki */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        /* Reset transformacji JS */
        transform: none !important;
        margin: 0 !important;
        /* Warstwa wizualna (Matowe szkło) */
        background: rgba(255, 255, 255, 0.7) !important; /* Bardziej mleczne tło */
        backdrop-filter: blur(5px) !important;           /* Rozmycie */
        -webkit-backdrop-filter: blur(5px) !important;
        /* Z-Index: Musi przykryć obrazek (zazwyczaj ma z-index 1) i etykiety */
        z-index: 50 !important; 
        border-radius: var(--am-radius-card);
        pointer-events: none !important;
    }
    /* 3. Wygląd samej pastylki */
    .am-apartments-container.am-view-mode-cards tr.am-has-overlay .am-js-overlay span {
        font-size: 15px !important;
        font-weight: 700 !important;
        padding: 10px 25px !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2) !important;
        background: #FF9F43 !important;
        color: #fff !important;
        border-radius: 50px !important;
        white-space: nowrap !important;
        /* Reset ewentualnych marginesów */
        margin: 0 !important;
        transform: none !important;
        opacity: 1 !important;
    }
    /* 4. Reset starego blura na komórkach (ważne!) */
    /* Usuwamy rozmycie z poszczególnych komórek, bo teraz overlay załatwia wszystko */
    .am-apartments-container.am-view-mode-cards tr.am-has-overlay td::before {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: transparent !important;
    }
    /* 5. Ukrycie "starych" zawartości wiersza, jeśli przebijają */
    /* Opcjonalnie: Zmniejszamy widoczność elementów pod spodem, jeśli blur to za mało */
    .am-apartments-container.am-view-mode-cards tr.am-has-overlay td {
        opacity: 1 !important; /* Overlay sam zrobi robotę */
    }

.am-apartments-container.am-view-mode-cards tr.am-has-overlay {
        pointer-events: none !important;
        user-select: none !important;
}
/* ==========================================================================
       MOBILE MODAL (Slide-up Sheet)
       ========================================================================== */
    .am-mobile-modal {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        z-index: 9999;
        /* Domyślnie niewidoczny i nieinteraktywny */
        visibility: hidden; 
        opacity: 0;
        pointer-events: none;
        transition: visibility 0s linear 0.3s, opacity 0.3s ease;
    }



    /* Stan otwarty */
    .am-mobile-modal.is-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0s;
    }
    .am-mobile-modal-overlay {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
    }
    .am-mobile-modal-content {
        position: absolute; bottom: 0; left: 0; width: 100%;
        background: #fff;
        border-top-left-radius: 20px; border-top-right-radius: 20px;
        padding: 0; /* Reset paddingu kontenera */
        box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
        /* Stan zamknięty: Przesunięty w dół poza ekran */
        transform: translateY(100%); 
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        max-height: 90vh; /* Modal zajmuje max 90% wysokości ekranu */
max-height: 90dvh;
        display: flex; flex-direction: column;
        overflow: hidden;
touch-action: none;
    }
.am-mobile-drag-handle {
        width: 100%;
        height: 24px;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: grab;
        flex-shrink: 0;
    }
    .am-mobile-drag-handle::after {
        content: '';
        width: 40px;
        height: 5px;
        background-color: #e0e0e0;
        border-radius: 5px;
    }
    .am-mobile-modal.is-open .am-mobile-modal-content {
        transform: translateY(0); /* Wjazd na ekran */
    }
    /* Wnętrze modala */
    .am-mobile-modal-header {
        padding: 15px 20px; border-bottom: 1px solid #eee;
        display: flex; justify-content: space-between; align-items: center;
        background: #fff; z-index: 2;
    }
    .am-mobile-header-info { display: flex; flex-direction: column; }
    .am-mobile-title { font-weight: 700; font-size: 16px; color: #111; }
/* Pastylka statusu w nagłówku */
    .am-mobile-status-pill {
        display: inline-block;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        padding: 4px 10px;
        border-radius: 12px;
        margin-left: 10px;
        vertical-align: middle;
        line-height: 1;
        letter-spacing: 0.5px;
    }
    /* Mapowanie kolorów pastylki na podstawie zmiennych globalnych */
    .am-mobile-status-pill.group-available { 
        background-color:  var(--am-status-available-bar); 
        color: var(--am-status-available-bg);
    }
    .am-mobile-status-pill.group-reserved { 
        background-color:  var(--am-status-reserved-bar); 
        color: var(--am-status-reserved-bg);
    }
    .am-mobile-status-pill.group-sold { 
        background-color: var(--am-status-sold-bar); 
        color: var(--am-status-sold-bg);
    }
    .am-mobile-modal-close {
    top: 10px; 
    right: 20px;
    background: #f0f0f0 !important;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #555 !important;
    cursor: pointer;
    z-index: 10;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.am-mobile-modal-close:hover {
    background: #e0e0e0 !important;
    color: #000;
    transform: rotate(90deg); /* Mikro-interakcja */
}
    .am-mobile-modal-body {
        padding: 20px; 
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px; /* Miejsce na stopkę */
    }
    /* SIATKA PARAMETRÓW (GRID) */
    .am-mobile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Dwie kolumny */
        gap: 12px;
        margin-bottom: 25px;
    }
    .am-mobile-grid-item {
        background: #f7f7f7;
        border-radius: 8px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .am-mobile-grid-label {
        font-size: 10px;
        color: #888;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
    .am-mobile-grid-value {
        font-size: 12px;
    font-weight: 700;
    color: #111;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    }
    /* STATUS (Pełna szerokość) */
    .am-mobile-status-box {
        background: #f7f7f7;
        border-radius: 8px;
        padding: 15px;
        text-align: center;
        margin-bottom: 25px;
        font-weight: 700;
        font-size: 14px;
}
		
		.am-mobile-status-box.status-available { 
        color: var(--am-status-available-bar, #28a745); 
        background: var(--am-status-available-bg, #f3f3f3); 
    }
    .am-mobile-status-box.status-reserved { 
        color: var(--am-status-reserved-bar, #2196f3); 
        background: var(--am-status-reserved-bg, #e3f2fd); 
    }
    .am-mobile-status-box.status-sold { 
        color: var(--am-status-sold-bar, #f44336); 
        background: var(--am-status-sold-bg, #ffebee); 
    }
		

    /* SEKCJE DANYCH (Udziały, Garaż) */
    .am-mobile-section { margin-bottom: 25px; }
    .am-mobile-section h4 { 
        font-size: 14px; color: #888; text-transform: uppercase; 
        margin: 0 0 10px 0; border-bottom: 1px solid #eee; padding-bottom: 5px; 
    }
.am-mobile-separator {
        height: 1px;
        background-color: #eee;
        margin: 10px -20px; /* -20px niweluje padding kontenera rodzica */
        width: calc(100% + 40px);
    }
    .am-mobile-section-title {
        font-size: 13px; font-weight: 700; color: #333; 
        margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px;
    }
    /* Wybór dodatków (Checkbox Style) */    
.am-mobile-addon-row{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: #f7f7f7;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    .am-mobile-addon-price { font-weight: 700; color: #111; }
    /* PRZYCISKI AKCJI (Prospekt, Historia) */
    .am-mobile-actions { 
        display: grid; 
        grid-template-columns: 1fr 1fr; /* Dwie kolumny */
        gap: 10px; 
        margin-top: 10px;
    }


.am-mobile-actions .am-mobile-action-btn:last-child:nth-child(odd) {
        grid-column: span 2;
    }
    /* STOPKA (Dark Bar) */
    .am-mobile-modal-footer {
        position: absolute; bottom: 0; left: 0; width: 100%;
        background: #1d2327; /* Ciemny kolor z projektu */
        padding: 15px 20px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        display: flex; justify-content: space-between; align-items: center;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
        z-index: 10;
    }
    .am-mobile-total-wrapper { display: flex; flex-direction: column; }
    .am-mobile-total-label { font-size: 10px; text-transform: uppercase; color: #aaa; margin-bottom: 2px; }
    .am-mobile-price-value { font-size: 20px; font-weight: 700; color: #fff; }
/* ==========================================================================
   5. WIDOK SZCZEGÓŁOWY (ROZWIJANY)
   ========================================================================== */
.am-details-wrapper {  
background: transparent; }

.am-all-components-section { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 20px; }
/* Kafelki dodatków (Szare boxy z Desktop Screena) */
.am-detail-item {
    background-color: #f5f5f5; border-radius: 6px; padding: 10px 15px; min-width: 140px;
    display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.am-detail-label { font-size: 10px; text-transform: uppercase; color: #888; font-weight: 600; margin-bottom: 4px; }

.am-detail-value, .am-mobile-addon-row {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 8px;
	color: var(--am-text-primary) !important;
}

/* Sekcja Ceny Całkowitej */
.am-details-footer { 
    display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 20px; margin-top: 10px; 
}
.am-total-price-value { font-size: 22px; font-weight: 800; color: #111; }
.am-total-price-label { font-size: 12px; color: #888; text-transform: uppercase; margin-right: 10px; }
/* ==========================================================================
   6. UI SYSTEM - UNIFIED BUTTONS & ICONS
   ========================================================================== */
.am-custom-select-wrapper { position: relative; width: 100%; }
.am-custom-select-trigger {
    width: 100% !important;
    justify-content: space-between !important;
}
.am-custom-select-trigger::after {
    content: '\f347'; font-family: dashicons; margin-left: 10px;
}
.am-custom-select-options {
    display: none; position: absolute; top: calc(100% + 5px); left: 0; width: 100%;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); z-index: 1000; padding: 5px;
}
.am-custom-option {
    padding: 10px 15px; cursor: pointer; border-radius: 10px;
    font-size: 13px; border-bottom: 1px solid #f0f0f0;
}
.am-custom-option:last-child { border-bottom: none; }
.am-custom-option:hover { background: #f8f8f8; }
.am-custom-option.selected { color: #007bff; font-weight: 700; background: #f0f7ff; }

.am-filter-item-slider{
	padding-top:8px;
}


/* Poprawka suwaków i etykiet */
.am-filter-item label { display: flex; justify-content: space-between; margin-bottom: 10px; }
.am-slider-label-title::after { content: ':'; }
.am-slider-value { font-weight: 700; color: #111; margin-left: auto; }
/* Stylizacja suwaków jQuery UI */
.am-slider-range.ui-slider {
    height: 4px; 
	background: #d5d5d5; 
	border: none; 
	border-radius: 10px; 
	margin: 15px 5px;
	width: calc(100% - 15px); /* Zostawiamy miejsce na uchwyty */
    display: block;
    position: relative;
}
.am-slider-range .ui-slider-range {
	background: #464646; 
	position: absolute; 
	height: 100%; 
	border-radius: 10px; 
}

.am-slider-range .ui-slider-handle {
    width: 20px !important; 
    height: 20px !important; 
    border-radius: 50% !important; 
    background: #fff !important;
    border: 3px solid #464646 !important; 
    top: -8px !important; 
    cursor: pointer !important; 
    outline: none !important;
    /* Reset layoutu */
    padding: 0 !important; 
    margin-left: -9px !important; /* Centrowanie uchwytu względem wartości */
    position: absolute !important;
    z-index: 2 !important;
    display: block !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}
.am-sort-options-container {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}
.am-sort-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 5px !important;
}
.am-sort-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}
.am-sort-option:last-child {
    border-bottom: none;
}
.am-sort-option:hover {
    background: #f8f9fa;
}
.am-sort-option.selected {
    background: #f0f7ff;
    color: #007bff;
}
.am-sort-option .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: inherit;
}
/* 1. Reset i Stylizacja Bazowa Przycisków */
.am-button,
.am-filters-toggle-button,
.am-sort-toggle-button,
.am-view-switcher-button,
.am-details-toggle.is-button,
.am-price-history-btn,
.am-details-button,
.am-mobile-contact-btn,
.am-filter-item select.am-button,
.am-mobile-action-btn{
    /* Pobieramy zmienne z ustawień */
    background-color: var(--am-btn-bg, #f0f0f0) !important;
    color: var(--am-btn-text, #333333) !important;
    border-radius: var(--am-btn-radius, 4px) !important;
    border: var(--am-btn-border-width, 1px) solid var(--am-btn-border-color, transparent) !important;
    /* Wspólna typografia i spacing */
    padding: 8px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: none;
    text-decoration: none !important;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Flex dla ikon */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none !important;
    /* Reset marginesów specyficznych */
    margin: 0 !important;
    width: auto;
}
/* 2. Hover State */
.am-button:hover,
.am-filters-toggle-button:hover,
.am-sort-toggle-button:hover,
.am-view-switcher-button:hover,
.am-details-toggle.is-button:hover,
.am-price-history-btn:hover,
.am-details-button:hover,
.am-mobile-contact-btn:hover,
.am-mobile-action-btn:hover {
    background-color: var(--am-btn-bg-hover, #e0e0e0) !important;
    border-color: var(--am-btn-border-hover, transparent) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}
/* 3. Ikony wewnątrz przycisków (Obrazki i Dashicons) */
.am-button img,
.am-filters-toggle-button img,
.am-view-switcher-button img,
.am-details-toggle.is-button img,
.am-details-toggle.is-icon img,
.am-price-history-btn img,
.am-details-button img,
.am-mobile-action-btn img {
    width: 20px !important; 
    height: 20px !important; 
    object-fit: contain; 
    opacity: 0.8;
    display: block;
	border-radius: 0 !important;
	text-decoration: none !important;
	border: none !important;
}
/* Obsługa ikon Dashicons (np. w Sortowaniu) */
.am-sort-toggle-button .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    opacity: 0.8;
    color: inherit; /* Dziedzicz kolor tekstu przycisku */
}
/* ==========================================================================
   7. GLOBAL DESKTOP MODALS (Addons & History)
   ========================================================================== */
.am-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100000; /* Musi być wyżej niż sticky header (500) i mobile menu */
    display: flex;
    align-items: center;
    justify-content: center;
}
.am-modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1;
}
.am-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: hidden; /* Zmiana: Scrollujemy tylko body, header zostaje */
    border-radius: 20px; /* Zgodne z mobile-modal */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    display: flex;
    flex-direction: column;
    animation: amFadeInUp 0.2s ease-out;
}

.am-modal-body {
    padding: 0 20px;
    overflow-y: auto;
    flex: 1;
}

.am-modal-actions {
    padding: 15px 20px; /* Taki sam padding jak w nagłówku (am-modal-header-placeholder) */
    background: #fff;
    display: flex;
    justify-content: flex-end; /* Przycisk po prawej stronie */
    align-items: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Header symulowany (dla spójności z mobile) */
.am-modal-header-placeholder {
    padding: 15px 20px; /* Adjusted to match .am-mobile-modal-header */
    border-bottom: 1px solid #eee;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px; /* Explicit height to match typical mobile headers */
}

.am-modal-close {
    top: 10px;
    right: 20px;
    background: #f0f0f0 !important;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    z-index: 10;
    width: 24px !important;
	height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 16px !important;
}

.am-modal-close:hover {
    background: #e0e0e0 !important;
    color: #000;
    transform: rotate(90deg); /* Mikro-interakcja */
	width: 24px !important;
}

/* Zakładki w Modalu (Tabs) */
.am-modal-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 0 20px;
    margin-top: 20px;
}
.am-modal-tab {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    color: #888 !important;
    font-weight: 700 !important;
    font-size: 13px;
    text-transform: uppercase;
    padding: 10px 0 !important;
    margin-right: 25px;
    cursor: pointer;
    box-shadow: none !important;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.am-modal-tab.active {
    color: #111 !important;
    border-bottom-color: #111 !important;
}

.am-modal-tab-content { 
	display: none; 
	padding: 20px 0; 
}

.am-addon-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px; /* Odstęp między nazwą a ceną */
}

/* Checkbox */
.am-addon-item input[type="checkbox"] {
    margin-right: 0; /* Reset, flex gap załatwia sprawę */
    flex-shrink: 0;
}

/* Nazwa i status (lewa strona) */
.am-addon-main {
    flex: 1; /* Zajmuje całą dostępną przestrzeń */
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Zapobiega wypychaniu flexa przez długi tekst */
}

.am-addon-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px; /* Lekko zaokrąglony kwadrat */
    flex-shrink: 0;
    background-color: #ccc; /* Fallback */
}

/* Mapowanie kolorów statusu (zgodne z widokiem kart) */
.am-addon-status-indicator.group-available {
    background-color: var(--am-status-available-bar, #28a745);
}
.am-addon-status-indicator.group-reserved {
    background-color: var(--am-status-reserved-bar, #2196f3);
}
.am-addon-status-indicator.group-sold {
    background-color: var(--am-status-sold-bar, #f44336);
}

.am-addon-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.am-addon-price-wrapper {
    text-align: right;
    display: flex;
    flex-direction: column; /* Cena pod ceną */
    justify-content: center;
    line-height: 1.2;
}

/* 1. Cena Aktualna (Strong) - domyślnie czarna */
.am-addon-price-wrapper strong {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

/* 2. Cena Promocyjna (Strong w kontenerze is-promotional) - Zielona */
.am-addon-price-wrapper.is-promotional strong {
    color: var(--am-price-promo, #28a745) !important;
}

/* 3. Stara Cena (korzysta z globalnej klasy .am-regular-price) - Dopasowanie */
.am-addon-price-wrapper .am-regular-price {
    font-size: 11px !important;
    margin-top: 2px;
    /* Kolor #999 i przekreślenie dziedziczy z definicji globalnej w sekcji 3 */
}

.am-addon-pricing{
	display: flex;
    gap: 8px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}

.am-addon-promo{
	    display: flex;
    padding: 4px 12px;
    background-color: var(--am-price-promo);
    color: white;
    font-weight: 500;
    border-radius: 1000px;
    font-size: 12px;
}
}

/* 2. STATUS SPRZEDANY: Wyszarzenie tekstu, ceny i checkboxa (ALE NIE WSKAŹNIKA) */
.am-addon-item.group-sold input,
.am-addon-item.group-sold .am-addon-title,
.am-addon-item.group-sold .am-addon-price-wrapper, 
.am-addon-item.group-sold .am-addon-omnibus,
.am-addon-item.group-sold .am-addon-promo {
    opacity: 0.5;
    filter: grayscale(100%); /* Tekst i ceny stają się szare */
}

/* 3. STATUS REZERWACJA: Tylko przygaszenie (Opacity), kolor zostaje */
.am-addon-item.group-reserved input,
.am-addon-item.group-reserved .am-addon-title,
.am-addon-item.group-reserved .am-addon-price-wrapper {
    opacity: .85; /* Elementy są bledsze, ale zachowują kolor (np. promo) */
}

/* 4. EXPLICIT PROTECTION: Wskaźnik i przycisk historii zawsze w pełni widoczne */
.am-addon-item .am-addon-status-indicator,
.am-addon-item .am-addon-history-btn {
    opacity: 1 !important;
    filter: none !important;
}

.am-addon-price-wrapper {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Przycisk Historii - dopasowanie do linii */
.am-addon-history-btn {
    background: transparent !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 50% !important; /* Okrągły przycisk */
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

.am-modal-tab-content.active { display: block; }
/* Animacja wejścia */
@keyframes amFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === GLOBAL RESET DLA TABELI HISTORII (FIXED) === */
/* Agresywny reset wszystkich krawędzi i teł, które narzuca motyw */
.am-history-table,
.am-history-table thead,
.am-history-table tbody,
.am-history-table tr,
.am-history-table th,
.am-history-table td {
    border: none !important;        /* Usuwa ramki */
    border-top: none !important;    /* Usuwa linię nad nagłówkiem */
    border-bottom: none !important; /* Usuwa linie podziału */
    background: transparent !important; /* Usuwa niebieskie tła motywu */
    box-shadow: none !important;
}

/* Konfiguracja layoutu tabeli */
.am-history-table {
    width: 100%;
    border-collapse: separate !important; /* Niezbędne dla border-radius w TD */
    border-spacing: 0 8px !important;     /* Odstęp między wierszami (kafelkami) */
    margin-top: 5px !important;
}

/* Stylizacja nagłówków - czysta typografia, bez ramek */
.am-history-table th {
    text-align: left !important;
    padding: 0 15px 5px 15px !important; /* Padding dopasowany do braku linii */
    color: #888 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Stylizacja danych - przywracamy wygląd "Kafelka" */
.am-history-table tbody td {
    background-color: #f7f7f7 !important; /* Nadpisujemy transparent z resetu */
    padding: 15px !important;
    font-size: 14px !important;
    color: #333 !important;
    font-weight: 500 !important;
    vertical-align: middle !important;
}

/* Zaokrąglenia rogów kafelka */
.am-history-table tbody td:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}
.am-history-table tbody td:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    text-align: right !important;
    font-weight: 700 !important;
}

/* Opcjonalny hover */
.am-history-table tbody tr:hover td {
    background-color: #f0f0f0 !important;
}

.am-history-table td { 
    background: #f7f7f7; /* Tło "kafelka" */
    border: none;
    border-bottom: none; 
    padding: 15px; 
    font-size: 14px; 
    color: #333; 
    font-weight: 500;
}

/* Zaokrąglenia pierwszego i ostatniego elementu w wierszu */
.am-history-table td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.am-history-table td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: right;
    font-weight: 700; /* Cena lub data pogrubiona */
}

/* Wiersze tabeli jako interaktywne elementy (opcjonalnie) */
.am-history-table tr:hover td {
    background: #f0f0f0;
}

/* ==========================================================================
   8. DESKTOP SPECIFIC OVERRIDES (min-width: 769px)
   Strict cleanup of mobile elements on desktop screens.
   ========================================================================== */
@media (min-width: 769px) {
    /* 1. Ukryj elementy interfejsu mobilnego */
    .am-mobile-sort-wrapper,
    .am-view-switcher-button {
        display: none !important;
    }
	
	.am-filters-form {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap; 
		justify-content: flex-start; 
		align-items: flex-end; 
		padding: 24px 0;
		gap: 48px;
		width: 100%;
	}
	
	.am-filter-item {
		flex: 1 1 auto; /* Grow: 1 (rozciągnij się), Shrink: 1, Basis: auto */
		width: auto !important; /* Resetujemy 100% width */
		min-width: 140px; /* Zapobiega zgnieceniu suwaków */
	}

	/* Opcjonalnie: Przycisk 'Wyczyść' (ostatni element) nie powinien być gigantyczny */
	.am-filter-item:last-child {
		flex: 0 0 auto; /* Nie rozciągaj przycisku, niech zajmie tyle ile potrzebuje */
		min-width: auto;
	}
	
	.am-details-links{
		display:flex;
		gap:8px
	}
	
	.am-apartments-container .am-apartments-table th.sortable::after {
        content: '\f156'; /* Dashicon: Sort (Podwójna strzałka) */
        font-family: 'dashicons';
        display: inline-block;
        vertical-align: middle;
        margin-left: 8px;
        opacity: 0.3;
        font-size: 14px;
        line-height: 1;
        font-weight: 400;
        color: var(--am-th-color, #ccc);
        transition: all 0.2s ease;
    }

    /* 2. Hover - podświetlenie */
    .am-apartments-container .am-apartments-table th.sortable:hover::after {
        opacity: 0.8;
        color: var(--am-th-color, #6c757d);
    }

    /* 3. Sortowanie Rosnące (ASC) - Strzałka w górę */
    .am-apartments-container .am-apartments-table th.sortable.sorting-asc::after,
    .am-apartments-container .am-apartments-table th.sortable.asc::after,
    .am-apartments-container .am-apartments-table th.sortable.sorted.asc::after,
    .am-apartments-container .am-apartments-table th.sortable[aria-sort="ascending"]::after,
    .am-apartments-container .am-apartments-table th.sortable[data-sort="asc"]::after {
        content: '\f142'; /* Dashicon: Arrow Up */
        opacity: 1;
        color: var(--am-status-reserved-bar, #2196f3);
    }

    /* 4. Sortowanie Malejące (DESC) - Strzałka w dół */
    .am-apartments-container .am-apartments-table th.sortable.sorting-desc::after,
    .am-apartments-container .am-apartments-table th.sortable.desc::after,
    .am-apartments-container .am-apartments-table th.sortable.sorted.desc::after,
    .am-apartments-container .am-apartments-table th.sortable[aria-sort="descending"]::after,
    .am-apartments-container .am-apartments-table th.sortable[data-sort="desc"]::after {
        content: '\f140'; /* Dashicon: Arrow Down */
        opacity: 1;
        color: var(--am-status-reserved-bar, #2196f3);
    }
	
    /* 2. Stylowanie kolumny "Więcej / Szczegóły" na Desktopie */
    .am-apartments-container .am-apartments-table th.am-details-toggle-col,
    .am-apartments-container .am-apartments-table td.am-cell-details-toggle {
        width: 1%;              /* Zajmuje tylko tyle miejsca ile potrzebuje */
        white-space: nowrap;    /* Zapobiega łamaniu tekstu w przycisku */
        text-align: right;      /* Wyrównanie do prawej dla estetyki */
        padding-right: 20px;
    }
    /* Centrowanie przycisku w komórce */
    .am-apartments-container .am-apartments-table td.am-cell-details-toggle .am-details-toggle {
        margin-left: auto;      /* Dopycha do prawej (zgodnie z text-align rodzica) */
        margin-right: 0;
		background-color: transparent;
        box-shadow: none;
    }
    /* Jeśli Toolbar jest pusty (bo ukryliśmy sortowanie i switcher, a filtry są wyłączone), ukryj go */
    .am-toolbar-wrapper:empty {
        display: none;
    }
    /* Poprawka layoutu Toolbara na desktopie - żeby filtry nie rozciągały się na całą szerokość */
    .am-toolbar-wrapper {
        justify-content: flex-start;
    }
    .am-filters-wrapper {
        flex: 0 0 auto;         /* Nie rozciągaj przycisku filtrów */
        width: auto !important;
    }
	
	.am-detail-value, .am-mobile-addon-row {
    justify-content: center;
	text-align: center;
}
	
}

.am-energy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}
.am-energy-item {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.am-energy-label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.am-energy-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.am-energy-unit {
    font-size: 10px;
    color: #999;
    font-weight: 400;
}

/* Wizualny pasek EP (Suwak) */
.am-energy-bar-wrapper {
    margin-bottom: 25px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
}
.am-energy-bar-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
    text-align: center;
}
.am-energy-gradient {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 50%, #e74c3c 100%);
    position: relative;
    margin: 15px 0 5px 0;
}
.am-energy-marker {
    position: absolute;
    top: -6px; /* Wychodzi ponad pasek */
    width: 4px;
    height: 24px;
    background: #333;
    border: 1px solid #fff;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.am-energy-marker-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.am-energy-marker-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
.am-price-warning-icon {
    color: #ff9f43 !important; /* Wymuszony pomarańczowy */
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    cursor: help;
    vertical-align: middle;
}
.am-price-warning-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: inherit;
}