/* --- BASE & GLOBAL --- */
.property-single-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}
.property-single-container h1 { font-weight: 700; }
.property-single-container h2 { font-weight: 600; }
.property-single-container h3 { font-weight: 500; }

/* --- LIGHTBOX (UPDATED) --- */
.real-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999;
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.real-lightbox.is-visible { opacity: 1; visibility: visible; }
.real-lightbox.is-visible .lightbox-content { transform: scale(1); }
.lightbox-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); cursor: pointer; }

/* New container for main image to handle padding for thumbnails */
.lightbox-main-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 80px 120px 80px; /* Top, Sides, Bottom padding */
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    transform: scale(0.95);
    transition: transform 0.4s ease;
    line-height: 0; /* Fixes potential spacing issues */
}
.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

/* Controls (Close, Prev, Next) */
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: fixed; /* Fixed position relative to viewport */
    background-color: rgba(30, 30, 30, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: sans-serif;
    z-index: 10001; /* Above overlay */
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background-color: rgba(0, 0, 0, 0.8); }

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    border-radius: 50%;
}

.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    width: 50px;
    height: 70px;
    border-radius: 4px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Thumbnail Gallery */
.lightbox-thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Fixed height for the strip */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 0 20px;
    box-sizing: border-box;
}
.thumbnails-inner {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    scrollbar-width: thin;
    scrollbar-color: #555 #222;
}
.lightbox-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    margin: 0 5px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, border-color 0.3s;
}
.lightbox-thumb:hover {
    opacity: 1;
}
.lightbox-thumb.is-active {
    opacity: 1;
    border-color: #fff;
}

/* --- GALLERY --- */
.property-gallery { margin-bottom: 30px; height: 450px; }
.sp-gallery-container { display: flex; gap: 10px; height: 100%; }
.sp-gallery-main, .sp-gallery-side-item { cursor: pointer; position: relative; }
.sp-gallery-main::after, .sp-gallery-side-item::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-shadow: inset 0 0 40px 0 rgba(0,0,0,0); transition: box-shadow 0.3s ease-in-out; border-radius: 8px; }
.sp-gallery-main:hover::after, .sp-gallery-side-item:hover::after { box-shadow: inset 0 0 40px 20px rgba(0,0,0,0.5); }
.sp-gallery-main { flex: 2; height: 100%; overflow: hidden; border-radius: 8px; }
.sp-gallery-side { flex: 1; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.sp-gallery-side-item { flex: 1; overflow: hidden; border-radius: 8px; }
.gallery-image { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s ease-in-out; }

/* --- HEADER & PRICE --- */
.property-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 25px;
    margin-bottom: 30px;
}
.entry-title {
    margin: 0 0 5px;
    font-size: 2.5em;
    line-height: 1.2;
}
.property-address {
    color: #666;
    font-size: 1.1em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.property-header-price {
    width: 100%;
    margin-top: 25px;
    padding: 20px 25px;
    background-color: #f8f8fa; /* Lighter blueish gray */
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.price-main {
    font-size: 2.6em;
    font-weight: 700;
    color: #3b5998; /* Darker blue for price */
    line-height: 1;
}
.price-note {
    color: #556b55;
    font-size: 1em;
    margin-top: 0;
    text-align: right;
    flex-grow: 1;
}

/* --- TAGS (Bubbles) --- */
.property-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.property-tag {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    background-color: #fff;
}
.property-tag i {
    font-size: 1.1em;
}

/* Tag Colors - Updated to new blue/neutral theme */
.tag-type-1, .tag-type-3 { color: #4f84c9; border-color: #4f84c94d; } /* Prodej, Pronájem - Primary Blue */
.tag-type-6, .tag-type-8 { color: #6a7a9c; border-color: #6a7a9c4d; } /* Dražba, Aukce - Secondary Blue */
.tag-status-20 { color: #28a745; border-color: #28a7454d; } /* Aktivní - Green */
.tag-status-30 { color: #ffc107; border-color: #ffc1074d; } /* Rezervovana - Yellow */
.tag-status-40 { color: #dc3545; border-color: #dc35454d; } /* Prodana - Red */
.tag-status-50 { color: #6c757d; border-color: #6c757d4d; } /* Archivní - Gray */


/* --- KEY FEATURES --- */
.property-key-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    gap: 20px;
    border: 1px solid #eee;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1em;
    color: #333;
}
.feature-item i {
    color: var(--primary-color); /* Use primary blue */
    font-size: 28px;
    width: 30px; /* Align icons */
    text-align: center;
}
.feature-item span strong {
    display: block;
    color: #666;
    font-size: 0.65em; /* Made the font smaller */
    font-weight: 600; /* Increased weight for better emphasis */
    text-transform: uppercase;
    letter-spacing: 0.5px; /* Added spacing for readability */
}

/* --- DETAILS SECTION (CARD LAYOUT) --- */
.property-description h2, .property-details-tables h2, .property-media h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color); /* Use primary blue */
    display: inline-block;
}

.details-card {
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden; /* Keeps child borders inside radius */
}

.details-card h3 {
    font-size: 1.4em;
    margin: 0;
    padding: 18px 22px;
    color: #333;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e9e9e9;
}

.details-grid {
    display: flex;
    flex-wrap: wrap;
}

.detail-item {
    flex: 1 1 25%; /* 4 columns by default */
    padding: 15px 22px;
    box-sizing: border-box;
    border-right: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9;
    transition: background-color 0.2s;
}

.detail-item:hover {
    background-color: #f5f8fa; /* Lighter blueish gray for hover */
}

.detail-item:nth-child(4n) {
    border-right: none;
}

.detail-item-label {
    display: block;
    color: #666;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-item-value {
    color: #222;
    font-size: 1.0em;
    font-weight: 500;
}

.detail-item .icon-check, 
.detail-item .icon-cross {
    font-size: 1.5em;
    line-height: 1;
}
.icon-check { color: #28a745; } /* Green for check */
.icon-cross { color: #dc3545; }

.detail-item.is-placeholder {
    background-color: #fafafa;
}
.detail-item.is-placeholder:hover {
    background-color: #fafafa; /* Disable hover */
}


/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .detail-item {
        flex-basis: 50%; /* 2 columns */
    }
    .detail-item:nth-child(4n) {
        border-right: 1px solid #e9e9e9; /* Re-add border */
    }
    .detail-item:nth-child(2n) {
        border-right: none; /* Remove border from new last item */
    }
}

@media (max-width: 768px) {
    .entry-title { font-size: 2em; }
    
    /* NEW: Mobile styles for price container */
    .property-header-price {
        flex-direction: column; /* Stack items vertically */
        align-items: flex-start; /* Align to the left */
        gap: 5px;
    }
    .price-main {
        font-size: 1.75em; /* Slightly smaller price on mobile */
    }
    .price-note {
        text-align: left; /* Align note to the left */
        margin-top: 5px;
    }

    .lightbox-prev, .lightbox-next { display: none; } /* Hide arrows on small screens */
    .lightbox-main-container { padding: 50px 10px 110px 10px; }
}

@media (max-width: 500px) {
    .detail-item {
        flex-basis: 100%; /* 1 column */
        border-right: none !important; /* Remove all right borders */
    }
}

/* --- VIDEO SECTION --- */
.property-media {
    margin-bottom: 30px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- MAP SECTION --- */
.property-map {
    margin-bottom: 30px;
}
.property-map h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}
#property-map-container .leaflet-popup-content-wrapper {
    border-radius: 6px;
}
#property-map-container .leaflet-popup-content {
    font-family: 'Poppins', sans-serif;
}

.custom-div-icon {
    background: transparent;
    border: none;
}

.property-description-full {
    text-align: justify;
}