/**
 * Flavor CPT Table - Frontend Styles
 */

/* === WRAPPER === */
.flavor-cpt-table-wrapper {
    position: relative;
    font-family: inherit;
}

/* === FILTRY === */
.flavor-cpt-table__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #ddd;
    align-items: flex-start;
}

.flavor-cpt-table__filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flavor-cpt-table__filter-label {
    font-size: 14px;
    font-weight: 400;
    color: #333;
}

.flavor-cpt-table__filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flavor-cpt-table__filter-btn {
    min-width: 70px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__filter-btn:hover {
    border-color: #666 !important;
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__filter-btn.active,
.flavor-cpt-table-wrapper .flavor-cpt-table__filter-btn.active:hover,
button.flavor-cpt-table__filter-btn.active,
button.flavor-cpt-table__filter-btn.active:hover {
    background-color: #333 !important;
    border-color: #333 !important;
    color: #fff !important;
}

/* Dropdown z kolorową kropką */
.flavor-cpt-table__filter-select {
    height: 42px;
    padding: 0 40px 0 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    font-size: 14px;
    cursor: pointer;
    min-width: 140px;
}

.flavor-cpt-table__filter-select:focus {
    outline: none;
    border-color: #666;
}

/* Status dropdown z kropką */
.flavor-cpt-table__filter-group[data-filter-key="status"] .flavor-cpt-table__filter-select,
.flavor-cpt-table__filter-group[data-filter-key="dostepnosc"] .flavor-cpt-table__filter-select {
    padding-left: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Ccircle cx='5' cy='5' r='4' fill='%2322c55e'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-position: 12px center, right 14px center;
    background-repeat: no-repeat, no-repeat;
}

.flavor-cpt-table__filter-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flavor-cpt-table__range-min,
.flavor-cpt-table__range-max {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.flavor-cpt-table__range-min:focus,
.flavor-cpt-table__range-max:focus {
    outline: none;
    border-color: #666;
}

.flavor-cpt-table__range-separator {
    color: #999;
}

/* Przycisk wyczyść z "×" */
.flavor-cpt-table__clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    align-self: flex-end;
}

.flavor-cpt-table__clear-btn::before {
    content: '×';
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
}

.flavor-cpt-table__clear-btn:hover {
    color: #333;
}

/* === LICZNIK WYNIKÓW === */
.flavor-cpt-table__results-count {
    display: none; /* Domyślnie ukryty */
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.flavor-cpt-table__results-count.visible {
    display: block;
}

.flavor-cpt-table__count {
    font-weight: 600;
    color: #333;
}

/* === TABELA === */
.flavor-cpt-table__container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flavor-cpt-table-wrapper .flavor-cpt-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #333 !important;
    border: none !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table thead {
    background: #ffffff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table thead tr {
    background: #ffffff !important;
    border: none !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table thead th {
    padding: 16px 20px !important;
    text-align: center !important;
    font-weight: 400 !important;
    color: #666 !important;
    font-size: 13px !important;
    border: none !important;
    border-bottom: 1px solid #e5e5e5 !important;
    background: #ffffff !important;
    white-space: nowrap !important;
    background: transparent !important;
}

/* Bez zebra striping - czyste białe tło */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr {
    background-color: #ffffff !important;
    transition: background-color 0.15s ease !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr:nth-child(odd),
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr:nth-child(even) {
    background-color: #ffffff !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr:last-child {
    border-bottom: 1px solid #e5e5e5 !important;
}

/* Hover bazowy - fallback */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr:hover {
    background-color: #fafafa !important;
}

/* Hover zależny od statusu - zielony dla dostępnych */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="dostępny"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="dostepny"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="wolny"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="available"]:hover {
    background-color: rgba(34, 197, 94, 0.08) !important;
}

/* Hover zależny od statusu - żółty dla zarezerwowanych */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="zarezerwowany"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="zarezerwowane"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="niedostępny"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="niedostepny"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="reserved"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="rezerwacja"]:hover {
    background-color: rgba(234, 179, 8, 0.08) !important;
}

/* Hover zależny od statusu - szary dla sprzedanych */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sprzedany"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sprzedane"]:hover,
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sold"]:hover {
    background-color: rgba(156, 163, 175, 0.08) !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table tbody td {
    padding: 24px 20px !important;
    border: none !important;
    vertical-align: middle !important;
    color: #333 !important;
    background: transparent !important;
    text-align: center !important;
}

/* Pierwsza kolumna (Numer) - pogrubiona */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child {
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* === SORTOWANIE === */
.flavor-cpt-table-wrapper .flavor-cpt-table__sortable {
    cursor: pointer !important;
    user-select: none !important;
    transition: color 0.15s ease !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sortable:hover {
    color: #333 !important;
}

/* Ładniejsze strzałki sortowania */
.flavor-cpt-table-wrapper .flavor-cpt-table__sort-icon {
    display: inline-flex !important;
    flex-direction: column !important;
    width: 10px !important;
    height: 14px !important;
    vertical-align: middle !important;
    margin-left: 6px !important;
    position: relative !important;
    top: -1px !important;
    background: none !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sort-icon::before,
.flavor-cpt-table-wrapper .flavor-cpt-table__sort-icon::after {
    content: '' !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    background: none !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sort-icon::before {
    border-bottom: 5px solid #ccc !important;
    margin-bottom: 2px !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sort-icon::after {
    border-top: 5px solid #ccc !important;
}

/* Aktywne sortowanie - góra */
.flavor-cpt-table-wrapper .flavor-cpt-table__sortable.sort-asc .flavor-cpt-table__sort-icon::before {
    border-bottom-color: #333 !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sortable.sort-asc .flavor-cpt-table__sort-icon::after {
    border-top-color: #ddd !important;
}

/* Aktywne sortowanie - dół */
.flavor-cpt-table-wrapper .flavor-cpt-table__sortable.sort-desc .flavor-cpt-table__sort-icon::before {
    border-bottom-color: #ddd !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__sortable.sort-desc .flavor-cpt-table__sort-icon::after {
    border-top-color: #333 !important;
}

/* === STATUS === */
.flavor-cpt-table-wrapper .flavor-cpt-table__status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__status::before {
    content: '' !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: var(--status-color, #9ca3af) !important;
    flex-shrink: 0 !important;
}

/* === PRZYCISK CTA === */
.flavor-cpt-table-wrapper .flavor-cpt-table__cta-header {
    width: 1% !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__cell--cta {
    text-align: right !important;
    white-space: nowrap !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn,
.flavor-cpt-table-wrapper button.flavor-cpt-table__cta-btn {
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 4px !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn:hover,
.flavor-cpt-table-wrapper button.flavor-cpt-table__cta-btn:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

/* Ukryj przycisk dla sprzedanych */
.flavor-cpt-table tr[data-status="sprzedany"] .flavor-cpt-table__cta-btn,
.flavor-cpt-table tr[data-status="sprzedane"] .flavor-cpt-table__cta-btn,
.flavor-cpt-table tr[data-status="sold"] .flavor-cpt-table__cta-btn {
    display: none;
}

/* === OBRAZEK / MINIATURA === */
.flavor-cpt-table__thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* === BRAK WYNIKÓW === */
.flavor-cpt-table__no-results td {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* === PAGINACJA === */
.flavor-cpt-table__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
}

.flavor-cpt-table__page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.flavor-cpt-table__page-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.flavor-cpt-table__page-btn.active {
    color: #333;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* === LOADING === */
.flavor-cpt-table__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.flavor-cpt-table__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: flavor-cpt-spin 0.8s linear infinite;
}

@keyframes flavor-cpt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* === TYPY KOMÓREK === */
.flavor-cpt-table__cell--currency,
.flavor-cpt-table__cell--currency_m2,
.flavor-cpt-table__cell--number,
.flavor-cpt-table__cell--area {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Superscript dla m² */
.flavor-cpt-table__cell--area sup,
.flavor-cpt-table__filter-btn sup {
    font-size: 0.7em;
    vertical-align: super;
}

/* === RESPONSYWNOŚĆ === */
@media (max-width: 1024px) {
    .flavor-cpt-table__filters {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .flavor-cpt-table__filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        margin-bottom: 20px !important;
        padding-bottom: 16px !important;
    }

    .flavor-cpt-table__filter-group {
        width: 100% !important;
    }

    .flavor-cpt-table__filter-buttons {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .flavor-cpt-table__filter-select {
        width: 100% !important;
    }

    .flavor-cpt-table__clear-btn {
        align-self: flex-start !important;
    }

    .flavor-cpt-table__hide-mobile {
        display: none !important;
    }

    /* Responsywna tabela - karty w GRID 2 kolumny */
    .flavor-cpt-table-wrapper .flavor-cpt-table thead,
    .flavor-cpt-table thead {
        display: none !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody,
    .flavor-cpt-table tbody {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr,
    .flavor-cpt-table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        padding: 10px 12px !important;
        border: 1px solid #eee !important;
        margin: 0 !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded,
    .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded {
        background: #f8f8f8 !important;
    }

    /* Pierwszy wiersz karty - numer lokalu jako nagłówek */
    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child,
    .flavor-cpt-table tbody td:first-child {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #1a1a1a !important;
        padding: 0 0 6px 0 !important;
        margin-bottom: 4px !important;
        border-bottom: 1px solid #eee !important;
        text-align: left !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child::before,
    .flavor-cpt-table tbody td:first-child::before {
        display: none !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td,
    .flavor-cpt-table tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 3px 0 !important;
        border: none !important;
        font-size: 11px !important;
        background: transparent !important;
        line-height: 1.3 !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td::before,
    .flavor-cpt-table tbody td::before {
        content: attr(data-label) !important;
        font-weight: 400 !important;
        color: #999 !important;
        font-size: 10px !important;
        flex-shrink: 0 !important;
        margin-right: 6px !important;
    }

    /* Status - kompaktowy */
    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td.flavor-cpt-table__cell--status .flavor-cpt-table__status {
        font-weight: 500 !important;
        font-size: 10px !important;
        gap: 4px !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody td.flavor-cpt-table__cell--status .flavor-cpt-table__status::before {
        width: 6px !important;
        height: 6px !important;
    }

    /* Przycisk CTA */
    .flavor-cpt-table-wrapper .flavor-cpt-table tbody .flavor-cpt-table__cell--cta,
    .flavor-cpt-table__cell--cta {
        justify-content: center !important;
        padding: 8px 0 0 0 !important;
        margin-top: 4px !important;
        border-top: 1px solid #eee !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table tbody .flavor-cpt-table__cell--cta::before,
    .flavor-cpt-table__cell--cta::before {
        display: none !important;
    }

    .flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn,
    .flavor-cpt-table__cta-btn {
        width: 100% !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
        border-radius: 5px !important;
    }

    /* Paginacja */
    .flavor-cpt-table__pagination {
        margin-top: 16px !important;
        padding-top: 12px !important;
        gap: 6px !important;
    }

    .flavor-cpt-table__page-btn {
        min-width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
    }

    /* Licznik wyników */
    .flavor-cpt-table__results-count {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }
}

@media (max-width: 480px) {
    .flavor-cpt-table__filters {
        gap: 10px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    .flavor-cpt-table__filter-btn {
        min-width: 50px !important;
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
    }

    .flavor-cpt-table__filter-select {
        height: 32px !important;
        font-size: 12px !important;
    }

    .flavor-cpt-table__range-min,
    .flavor-cpt-table__range-max {
        width: 60px !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
    }

    .flavor-cpt-table tbody {
        gap: 6px !important;
    }

    .flavor-cpt-table tbody tr {
        padding: 8px 10px !important;
        border-radius: 6px !important;
    }

    .flavor-cpt-table tbody td:first-child {
        font-size: 13px !important;
        padding-bottom: 5px !important;
        margin-bottom: 3px !important;
    }

    .flavor-cpt-table tbody td {
        padding: 2px 0 !important;
        font-size: 10px !important;
    }

    .flavor-cpt-table tbody td::before {
        font-size: 9px !important;
    }

    .flavor-cpt-table__cta-btn,
    .flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn {
        padding: 6px 8px !important;
        font-size: 10px !important;
    }

    .flavor-cpt-table__cell--cta {
        padding: 6px 0 0 0 !important;
        margin-top: 3px !important;
    }
}

/* === TRYB KAFELKOWY (DESKTOP) === */
.flavor-cpt-table--cards .flavor-cpt-table thead {
    display: none !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody {
    display: grid !important;
    gap: var(--card-gap, 12px) !important;
}

/* 2 kolumny */
.flavor-cpt-table--cards.flavor-cpt-table--cols-2 .flavor-cpt-table tbody {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* 3 kolumny */
.flavor-cpt-table--cards.flavor-cpt-table--cols-3 .flavor-cpt-table tbody {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* 4 kolumny */
.flavor-cpt-table--cards.flavor-cpt-table--cols-4 .flavor-cpt-table tbody {
    grid-template-columns: repeat(4, 1fr) !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody tr:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded {
    background: #f9f9f9 !important;
}

/* Numer lokalu jako nagłówek karty */
.flavor-cpt-table--cards .flavor-cpt-table tbody td:first-child {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    padding: 0 0 6px 0 !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid #eee !important;
    text-align: left !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody td:first-child::before {
    display: none !important;
}

/* Pozostałe komórki */
.flavor-cpt-table--cards .flavor-cpt-table tbody td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 3px 0 !important;
    border: none !important;
    font-size: 12px !important;
    background: transparent !important;
    line-height: 1.3 !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody td::before {
    content: attr(data-label) !important;
    font-weight: 400 !important;
    color: #999 !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
    margin-right: 8px !important;
}

/* Status w kafelku */
.flavor-cpt-table--cards .flavor-cpt-table tbody td.flavor-cpt-table__cell--status .flavor-cpt-table__status {
    font-size: 11px !important;
    gap: 5px !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody td.flavor-cpt-table__cell--status .flavor-cpt-table__status::before {
    width: 7px !important;
    height: 7px !important;
}

/* Przycisk CTA w kafelku */
.flavor-cpt-table--cards .flavor-cpt-table tbody .flavor-cpt-table__cell--cta {
    padding: 8px 0 0 0 !important;
    margin-top: 4px !important;
    border-top: 1px solid #eee !important;
    justify-content: center !important;
}

.flavor-cpt-table--cards .flavor-cpt-table tbody .flavor-cpt-table__cell--cta::before {
    display: none !important;
}

.flavor-cpt-table--cards .flavor-cpt-table__cta-btn {
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

/* Responsywność kafelków na mniejszych ekranach */
@media (max-width: 1024px) {
    .flavor-cpt-table--cards.flavor-cpt-table--cols-4 .flavor-cpt-table tbody {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .flavor-cpt-table--cards.flavor-cpt-table--cols-4 .flavor-cpt-table tbody,
    .flavor-cpt-table--cards.flavor-cpt-table--cols-3 .flavor-cpt-table tbody {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .flavor-cpt-table--cards .flavor-cpt-table tbody tr {
        padding: 12px !important;
    }

    .flavor-cpt-table--cards .flavor-cpt-table tbody td:first-child {
        font-size: 14px !important;
    }

    .flavor-cpt-table--cards .flavor-cpt-table tbody td {
        font-size: 11px !important;
        padding: 3px 0 !important;
    }

    .flavor-cpt-table--cards .flavor-cpt-table tbody td::before {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .flavor-cpt-table--cards .flavor-cpt-table tbody {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .flavor-cpt-table--cards .flavor-cpt-table tbody tr {
        padding: 10px !important;
    }
}

@media (max-width: 400px) {
    .flavor-cpt-table--cards .flavor-cpt-table tbody {
        grid-template-columns: 1fr !important;
    }
}

/* === HIGHLIGHT ANIMATION (from interactive estate map) === */
.flavor-cpt-table tbody tr.iem-highlight {
    animation: iemHighlightRow 2s ease-out;
}

@keyframes iemHighlightRow {
    0% {
        background-color: rgba(26, 26, 26, 0.15) !important;
        box-shadow: 0 0 0 2px #1a1a1a inset;
    }
    50% {
        background-color: rgba(26, 26, 26, 0.1) !important;
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Mobile highlight */
@media (max-width: 768px) {
    .flavor-cpt-table tbody tr.iem-highlight {
        animation: iemHighlightCard 2s ease-out;
    }

    @keyframes iemHighlightCard {
        0% {
            box-shadow: 0 0 0 3px #1a1a1a, 0 4px 12px rgba(0, 0, 0, 0.2) !important;
            transform: scale(1.01);
        }
        50% {
            box-shadow: 0 0 0 2px #1a1a1a, 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        }
        100% {
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
            transform: scale(1);
        }
    }
}

/* === MOBILE OVERRIDES - Ultra high specificity === */
@media (max-width: 768px) {
    /* Reset Elementor overrides for mobile - GRID 2 kolumny */
    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody,
    html body .elementor-element .flavor-cpt-table tbody,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody tr,
    html body .elementor-element .flavor-cpt-table tbody tr,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border: 1px solid #eee !important;
        border-radius: 8px !important;
        padding: 10px 12px !important;
        margin: 0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded {
        background: #f8f8f8 !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td,
    html body .elementor-element .flavor-cpt-table tbody td,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 3px 0 !important;
        border: none !important;
        text-align: right !important;
        font-size: 11px !important;
        background: transparent !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td:first-child,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child {
        text-align: left !important;
        padding: 0 0 6px 0 !important;
        margin-bottom: 4px !important;
        border-bottom: 1px solid #eee !important;
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td:first-child::before,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child::before {
        display: none !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td::before,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td::before {
        font-size: 10px !important;
        color: #999 !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody .flavor-cpt-table__cell--cta,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody .flavor-cpt-table__cell--cta {
        padding: 8px 0 0 0 !important;
        margin-top: 4px !important;
        border-top: 1px solid #eee !important;
        justify-content: center !important;
    }

    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table__cta-btn,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn {
        width: 100% !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
}

/* === VERY SMALL SCREENS - 1 kolumna === */
@media (max-width: 400px) {
    html body .elementor-widget-flavor-cpt-table .flavor-cpt-table tbody,
    html body .flavor-cpt-table-wrapper .flavor-cpt-table tbody,
    .flavor-cpt-table tbody {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
}

/* === ELEMENTOR EDITOR === */
.elementor-editor-active .flavor-cpt-table-wrapper {
    min-height: 200px;
}

/* === ELEMENTOR OVERRIDES - High Specificity === */
.elementor-widget-flavor-cpt-table .flavor-cpt-table,
.elementor-element .flavor-cpt-table,
body .flavor-cpt-table-wrapper .flavor-cpt-table {
    border: none !important;
    background: transparent !important;
    border-collapse: collapse !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table thead,
.elementor-element .flavor-cpt-table thead,
body .flavor-cpt-table-wrapper .flavor-cpt-table thead {
    background: #ffffff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table thead tr,
.elementor-element .flavor-cpt-table thead tr,
body .flavor-cpt-table-wrapper .flavor-cpt-table thead tr {
    background: #ffffff !important;
    border: none !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table thead th,
.elementor-element .flavor-cpt-table thead th,
body .flavor-cpt-table-wrapper .flavor-cpt-table thead th {
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #e5e5e5 !important;
    padding: 16px 20px !important;
    color: #666 !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    text-align: center !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table tbody tr,
.elementor-element .flavor-cpt-table tbody tr,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr {
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table tbody tr:hover,
.elementor-element .flavor-cpt-table tbody tr:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr:hover {
    background: #fafafa !important;
}

/* Status hover - Elementor overrides */
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="dostępny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="dostepny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="wolny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="available"]:hover {
    background: rgba(34, 197, 94, 0.08) !important;
}

body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="zarezerwowany"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="zarezerwowane"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="niedostępny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="niedostepny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="reserved"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="rezerwacja"]:hover {
    background: rgba(234, 179, 8, 0.08) !important;
}

body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sprzedany"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sprzedane"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr[data-status="sold"]:hover {
    background: rgba(156, 163, 175, 0.08) !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td,
.elementor-element .flavor-cpt-table tbody td,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td {
    background: transparent !important;
    border: none !important;
    padding: 24px 20px !important;
    color: #333 !important;
    text-align: center !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table tbody td:first-child,
.elementor-element .flavor-cpt-table tbody td:first-child,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody td:first-child {
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* CTA Button Override */
.elementor-widget-flavor-cpt-table .flavor-cpt-table__cta-btn,
.elementor-element .flavor-cpt-table__cta-btn,
body .flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn,
body button.flavor-cpt-table__cta-btn {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 12px 24px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.elementor-widget-flavor-cpt-table .flavor-cpt-table__cta-btn:hover,
.elementor-element .flavor-cpt-table__cta-btn:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table__cta-btn:hover,
body button.flavor-cpt-table__cta-btn:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

/* === FILTER BUTTON ACTIVE - Ultra High Specificity === */
html body .flavor-cpt-table-wrapper .flavor-cpt-table__filter-btn.active,
html body .flavor-cpt-table-wrapper button.flavor-cpt-table__filter-btn.active,
html body .elementor-widget-flavor-cpt-table .flavor-cpt-table__filter-btn.active,
.flavor-cpt-table__filter-btn.active[style] {
    background-color: #333333 !important;
    border-color: #333333 !important;
    color: #ffffff !important;
}

html body .flavor-cpt-table-wrapper .flavor-cpt-table__filter-btn.active:hover,
html body .flavor-cpt-table-wrapper button.flavor-cpt-table__filter-btn.active:hover {
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #ffffff !important;
}

/* === KARTA LOKALU / FILE LINK === */
.flavor-cpt-table__file-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
}

.flavor-cpt-table__file-link:hover {
    color: #1a1a1a;
}

.flavor-cpt-table__file-link svg {
    width: 22px;
    height: 22px;
}

.flavor-cpt-table__file-icon {
    width: 28px;
    height: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.flavor-cpt-table__file-link:hover .flavor-cpt-table__file-icon {
    opacity: 1;
}

/* === KONDYGNACJA - NAPRZEMIENNE TŁA === */
/* Nieparzyste kondygnacje (1, 3, 5...) - delikatne szare tło */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded {
    background-color: #f9f9f9 !important;
}

/* Shaded hover - fallback (bez statusu) */
.flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded:hover {
    background-color: #f5f5f5 !important;
}

/* Shaded + status hover - zielony dla dostępnych */
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="dostępny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="dostepny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="wolny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="available"]:hover {
    background-color: rgba(34, 197, 94, 0.12) !important;
}

/* Shaded + status hover - żółty dla zarezerwowanych */
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="zarezerwowany"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="zarezerwowane"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="niedostępny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="niedostepny"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="reserved"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="rezerwacja"]:hover {
    background-color: rgba(234, 179, 8, 0.12) !important;
}

/* Shaded + status hover - szary dla sprzedanych */
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="sprzedany"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="sprzedane"]:hover,
body .flavor-cpt-table-wrapper .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded[data-status="sold"]:hover {
    background-color: rgba(156, 163, 175, 0.12) !important;
}

/* Na mobile zachowaj też tło */
@media (max-width: 768px) {
    .flavor-cpt-table tbody tr.flavor-cpt-table__row--shaded {
        background-color: #f9f9f9 !important;
    }
}
