/* 
   Property Detail Page (PDP) Specific Styles 
   Built for extreme performance and lightweight DOM.
*/

/* Layout */
.property-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    padding-top: var(--space-sm); /* Just a little breathing room */
    padding-bottom: 80px; /* space for mobile sticky cta */
}

.property-content {
    flex: 1;
    min-width: 0; /* Prevents flex flex-blowouts */
}

.property-sidebar {
    display: none; /* hidden on mobile, replaced by sticky CTA */
}

@media (min-width: 1024px) {
    .property-page {
        flex-direction: row;
        align-items: flex-start;
        padding-bottom: var(--space-xxl);
    }
    
    .property-content {
        width: calc(100% - 400px);
    }

    .property-sidebar {
        display: block;
        width: 360px;
        flex-shrink: 0;
        position: sticky;
        top: 100px; /* Navbar height + padding */
        z-index: 10;
    }
}

/* Common Section Styles */
.prop-section {
    padding: var(--space-md) 0;
}

.section-title {
    font-size: var(--text-h3);
    margin-bottom: var(--space-md);
    color: var(--color-4, #2B5C8F);
}

.divider {
    border: none;
    height: 1px;
    background-color: var(--color-2, #d3d6db);
    margin: var(--space-sm) 0;
    opacity: 0.5;
}

/* SECTION 1: HERO */
.prop-gallery {
    margin-bottom: var(--space-lg);
    background: var(--bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.main-image-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-1, #F8F9FA); /* skeleton load color */
    aspect-ratio: 21/9; /* ultra-wide aspect ratio to significantly reduce vertical height */
    margin-bottom: var(--space-sm);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--color-1, #F8F9FA);
    cursor: pointer;
}

.badge-container {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.badge-premium { background-color: #D4AF37; color: #FFFFFF; } /* Gold on dark */
.badge-verified { background-color: #e8f5e9; color: #2e7d32; } /* Green */
.badge-featured { background-color: var(--color-3, #2B5C8F); color: white; } /* Brand color */

.thumbnail-gallery {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.thumbnail-gallery::-webkit-scrollbar {
    display: none;
}

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    scroll-snap-align: start;
    flex-shrink: 0;
    opacity: 0.6;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

@media (min-width: 768px) {
    .thumb { width: 120px; height: 80px; }
}

.thumb:hover { opacity: 0.9; }
.thumb.active {
    opacity: 1;
    border-color: var(--color-4, #2B5C8F);
}

.prop-header {
    margin-bottom: var(--space-lg);
}

.prop-title {
    font-size: var(--text-h2);
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.prop-price {
    color: var(--color-4, #2B5C8F);
    margin: var(--space-md) 0;
    font-weight: 700;
}

.urgency-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md) 0;
    display: grid;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.urgency-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.urgency-list li::before {
    content: "•";
    color: var(--color-3, #2B5C8F);
    font-weight: 700;
}

.quick-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-1, #F8F9FA);
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .quick-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.quick-fact {
    display: flex;
    flex-direction: column;
}

.prop-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    background: var(--bg-white);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-1, #F8F9FA);
}

@media (min-width: 768px) {
    .prop-specs-grid { grid-template-columns: repeat(3, 1fr); }
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.spec-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* SECTION 2: DESCRIPTION */
.content-text p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* SECTION 3: AMENITIES */
.amenities-grid {
    gap: var(--space-md);
}

.amenity-snapshot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}

.amenity-chip {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--color-1, #F8F9FA);
    color: var(--color-4, #2B5C8F);
    font-size: 0.85rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .amenities-grid { grid-template-columns: repeat(4, 1fr); }
}

.amenity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: var(--space-md);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-1, #F8F9FA);
    transition: var(--transition-fast);
}

.amenity-item:hover {
    border-color: var(--color-2, #d3d6db);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.amenity-icon {
    width: 32px;
    height: 32px;
    color: var(--color-3, #2B5C8F);
}

/* SECTION 4: HIGHLIGHTS */
.highlight-card {
    background: var(--bg-white);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-3, #2B5C8F);
    box-shadow: var(--shadow-sm);
}

.highlight-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

/* Nearby Landmarks */
.landmarks-grid {
    gap: var(--space-sm);
}

.landmark-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: var(--space-sm);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-1, #F8F9FA);
    box-shadow: var(--shadow-sm);
}

.landmark-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.landmark-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* SECTION 5: MAP PLACEHOLDER */
.map-placeholder {
    width: 100%;
    height: 300px;
    background-color: var(--color-1, #F8F9FA);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed var(--color-2, #d3d6db);
}

.map-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-4, #2B5C8F);
}

/* SECTION 8: TRUST LAYER */
.trust-item {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.trust-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-4, #2B5C8F);
    box-shadow: var(--shadow-sm);
}

/* BUTTON UTILITIES & CTA */
.btn-block {
    width: 100%;
    margin-bottom: var(--space-sm);
}

.btn-compact {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #1ebc59;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.instant-actions {
    display: grid;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}

.trust-badges {
    display: grid;
    gap: 0.35rem;
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}



/* Mobile Sticky CTA */
.mobile-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: var(--space-md);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    gap: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .mobile-sticky-cta {
        display: flex;
    }
    body {
        padding-bottom: 80px; /* Space for sticky CTA */
    }
}


/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.modal-content {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary, #666);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}
.modal-close:hover {
    background: var(--color-1, #f0f0f0);
    color: var(--foreground);
}

/* LIGHTBOX STYLES */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.lightbox-img-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    user-select: none;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2001;
}
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}
.lightbox-prev {
    left: 20px;
}
.lightbox-next {
    right: 20px;
}
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px;
    border-radius: 20px;
}
.main-image {
    cursor: pointer;
}
