.jcm-lista-mieszkan {

}
.jcm-td-cena button.jcm-popup-link {
    display: inline-block;
    vertical-align: middle !important;
    margin-top: -2px;
}

td.jcm-td-cena_m2 {
    white-space: nowrap;
}

td.jcm-td-metraz {
    white-space: nowrap;
}

td.jcm-td-dzialka {
    white-space: nowrap;
}
.jcm-lista-mieszkan thead {
    position: sticky !important;
    top: calc(80px + var(--wp-admin--admin-bar--height, 0px));
    background: #fff;
    z-index: 2;
}

.jcm-lista-mieszkan th,
.jcm-lista-mieszkan td {
   
}

.jcm-lista-mieszkan th {
    white-space: nowrap;
}

.jcm-lista-mieszkan td {
    
}

.jcm-lista-mieszkan tbody tr:hover {
    background-color: #fafafa;
}

.jcm-lista-mieszkan a {
    
}

.jcm-td-plan a {
    /* width: 40px; */
    /* height: 40px; */
    /* display: block; */
}

.jcm-lista-mieszkan a:hover {
    /* text-decoration: underline; */
}

.jcm-lista-mieszkan img {
    max-width: unset !important;
    max-height: unset;
    width: 100%;
    height: 100% !important;
    margin: 0;
    object-fit: cover;
}

.jcm-lista-mieszkan .jcm-popup-link {
    /* background-color: #f4f4f4; */
    /* color: #333; */
    padding: 0 14px;
    --buttonMinHeight: 30px;
    --buttonFontSize: 12px;
    /* font-size: 12px; */
    /* border: none; */
    /* border-radius: 4px; */
    /* font-weight: 500; */
    /* cursor: pointer; */
}
.jcm-lista-mieszkan .jcm-popup-link:hover {
    border-color: var(--button-border-hover-color);
    color: var(--buttonTextHoverColor);
    background-color: var(--buttonHoverColor);
}

.jcm-lista-domow {
    /* width: 100%; */
    /* border-collapse: collapse; */
    /* table-layout: fixed; */
}
.jcm-lista-domow td {
    /* padding: 16px; */
    /* text-align: center; */
    /* vertical-align: middle; */
    /* font-size: 16px; */
    /* font-weight: 700; */
    /* border-bottom: 3px solid #ededed; */
}
.jcm-lista-domow td:first-child {
    /* font-size: 20px; */
    /* text-transform: uppercase; */
}
td.jcm-td-status {
    position: relative;
    color: #4ea300;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
    padding-left: 30px;
}
td.jcm-td-status::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    aspect-ratio: 1/1;
    background: #4da204;
    vertical-align: middle;
    border-radius: 18px;
}
td.status-sold {
    color: #000;
}
td.status-sold::after {
    background: #a3a3a3;
}
td.status-reserved, td.status-reserved::after {
    color: #aaa;
}
.jcm-lista-domow td span {
    /* display: block; */
    /* font-weight: 400; */
    /* font-size: 12px; */
    /* line-height: 1; */
    /* margin-top: 4px; */
    /* margin-bottom: 4px; */
    /* color: #4f5459; */
}
.jcm-lista-domow .jcm-popup-link {
    /* background-color: #f4f4f4; */
    /* color: #333; */
    /* padding: 8px 16px; */
    /* font-size: 12px; */
    /* border: none; */
    /* border-radius: 4px; */
    /* font-weight: 700; */
    /* cursor: pointer; */
}
.jcm-lista-domow .jcm-popup-link:hover {
    /* background-color: #ededed; */
}

@media(max-width: 1000px) {
    .jcm-lista-domow tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .jcm-lista-domow td {
        padding: 6px;
        display: block;
        border: none;
        width: 50%;
    }
    .jcm-lista-domow td:empty {
        display: none;
    }
    .jcm-lista-domow td:first-child { 
        width: 100%;
        padding-top: 16px;
    }
    .jcm-lista-domow td:last-child {
        width: 100%;
        padding-bottom: 16px;
        border-bottom: 2px solid #ededed;
    }
    td.status-sold::after {
        display: none;
    }
    .jcm-lista-mieszkan td.jcm-td-cena {
        white-space: initial !important;
    }
}

.jcm-popup {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.jcm-popup-content {
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    width: 450px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}
.jcm-popup-content.big {
    width: 800px;
}

.jcm-popup-close {
    position: absolute;
    top: 0;
    right: 8px;
    font-size: 24px;
    cursor: pointer;
}

.jcm-popup p {
    font-size: 14px;
}
.jcm-popup p.small {
    font-size: 10px;
}

.jcm-popup p a {
    border-bottom: 1px solid;
}
.jcm-popup p a:hover {
    border-bottom: 1px solid transparent;
}

.jcm-popup .row {
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
}
.jcm-popup .row .col-6 {
    width: 50%;
    margin: 0 0 4px 0;
}
.jcm-popup .row .col-12 {
    width: 100%;
}

.jcm-popup ul {
    margin-top: 10px;
}
.jcm-popup ul li {
    font-size: 12px;
    color: #6e6e73;
}

.jcm-popup .history-container {
    margin-top: 15px;
    display: none;
}

.jcm-przynalezne-btn-container {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.jcm-przynalezne-btn {
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
}

/* Responsive table styles for mobile */
@media screen and (max-width: 1000px) {
    .jcm-lista-mieszkan {
        display: block;
        width: 100%;
    }
    .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
        background: transparent;
    }
    
    .jcm-lista-mieszkan thead {
        display: none;
    }
    
    .jcm-lista-mieszkan tbody {
        display: grid;
        width: 100%;
        gap: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jcm-lista-mieszkan tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        /* background: #fff; */
        /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    }
    .jcm-lista-mieszkan tbody tr:hover {
        background: transparent;
    }
    
    .jcm-lista-mieszkan td {
        display: flex;
        align-items: center;
        /* width: 100%; */
        padding: 8px 0;
        border: none;
        /* text-align: left; */
        position: relative;
        /* padding-left: 40%; */
    }
    
    .jcm-lista-mieszkan td:before {
        content: attr(data-title);
        /* position: absolute; */
        /* left: 0; */
        /* top: 8px; */
        width: 160px;
        font-weight: bold;
        color: #333;
        display: block;
        text-transform: initial;
    }
    
    .jcm-lista-mieszkan td.jcm-td-actions {
        /* text-align: center; */
        padding-left: 0;
        margin-top: 10px;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
    .jcm-lista-mieszkan td+td {
        border-top: 1px solid #dddddd;
    }
    
    .jcm-lista-mieszkan td.jcm-td-actions:before {
        display: none;
    }
    .jcm-lista-mieszkan .jcm-popup-link {
        display: block;
        padding: 12px 12px;
        width: 100%;
    }
    
    /* Special styling for file fields */
    .jcm-lista-mieszkan td.jcm-td-plan img,
    .jcm-lista-mieszkan td.jcm-td-rzut img {
        max-width: 80px;
        height: auto;
    }
    td.jcm-td-etap {
        font-size: inherit !important;;
    }
    .jcm-lista-mieszkan td.jcm-td-cena small {
        margin-left: 10px;
    }
    td.jcm-td-status::after {
        display: none;
    }
    .jcm-td-cena button.jcm-popup-link {
        width: auto;
    }
}

/* Omnibus price styling */
.jcm-lista-mieszkan td small {
    display: block;
    font-size: 10px;
    color: #666;
    /* margin-top: 4px; */
    line-height: 1.2;
    font-weight: normal;
    white-space: normal;
}

.jcm-lista-mieszkan td small strong {
    color: #333;
    font-weight: 600;
}

/* Price column specific styling */
.jcm-lista-mieszkan td.jcm-td-cena {
    /* font-weight: 600; */
    /* color: #2c5aa0; */
    white-space: nowrap;
}

.jcm-lista-mieszkan td.jcm-td-cena small {
    color: #666;
    font-weight: normal;
}

.jcm-lista-mieszkan td.jcm-td-cena small strong {
    color: #444;
    font-weight: 600;
    font-size: 10px;
    line-height: 1.2 !important;
}

/* Price history styling in popup */
.jcm-popup .price-history-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.jcm-popup .price-history-date {
    font-size: 14px;
    font-weight: 600;
    /* color: #2c5aa0; */
    margin-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}

.jcm-popup .price-history-details {
    font-size: 13px;
    line-height: 1.4;
}

.jcm-popup .price-history-label {
    color: #666;
    font-weight: 500;
}

.jcm-popup .price-history-value {
    /* color: #2c5aa0; */
    font-weight: 600;
}

.jcm-td-cena button.jcm-popup-link {
    display: inline-block;
    vertical-align: middle !important;
    margin-top: -2px;
}

td.jcm-td-cena_m2 {
    white-space: nowrap;
}

td.jcm-td-metraz {
    white-space: nowrap;
}

td.jcm-td-dzialka {
    white-space: nowrap;
}



.jcm-lista-mieszkan-table {
    max-width: var(--container-max-width) !important;
    overflow-x: initial;
}

td.jcm-td-etap {
    font-size: .7em;
}
td.jcm-td-plan a {
    white-space: nowrap;
    font-size: 12px;
    margin: auto 0;
    display: inline-block;
    text-decoration: none !important;
}



@media (max-width: 880px) {
     .jcm-lista-mieszkan tbody {
       
        grid-template-columns: repeat(1, 1fr);
    }
    .jcm-lista-mieszkan td {
        flex-direction: column;
    }
    .jcm-lista-mieszkan td, .jcm-lista-mieszkan td *:not(.jcm-popup-link) {
        text-align: left !important;
        align-items: start;
    }
    .jcm-lista-mieszkan td.jcm-td-cena small {
        margin-left: 0;
    }
}