/* Property detail page — Redfin-inspired layout */
body.property-detail-page {
    --pd-accent: #c52c2a;
    --pd-accent-hover: #a82422;
    --pd-text: #1b1b1b;
    --pd-muted: #6b6b76;
    --pd-border: #e2e2e7;
    --pd-bg: #f7f7f8;
    --pd-card: #fff;
    --pd-radius: 8px;
    --pd-gap: 8px;
    background: var(--pd-card);
    overflow-x: hidden;
}

body.property-detail-page .inner-header-area {
    display: none;
}

.property-detail-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

/* ---- Sub navigation ---- */
.property-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--pd-border);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--pd-card);
}

.property-detail-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pd-text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
}

.property-detail-nav__back:hover {
    color: var(--pd-accent);
}

.property-detail-nav__tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.property-detail-nav__tabs::-webkit-scrollbar {
    display: none;
}

.property-detail-nav__tab {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-muted);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.property-detail-nav__tab:hover,
.property-detail-nav__tab.is-active {
    color: var(--pd-text);
    border-bottom-color: var(--pd-text);
}

.property-detail-nav__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.property-detail-nav__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-text);
    cursor: pointer;
    text-decoration: none;
}

.property-detail-nav__action:hover {
    color: var(--pd-accent);
}

.property-detail-nav__action.is-favorited {
    color: var(--pd-accent);
}

/* ---- Bento gallery ---- */
.property-bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--pd-gap);
    /* Full-bleed: break out of the centered 1280px wrapper to span the viewport width */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 16px;
    border-radius: 0;
    overflow: hidden;
    height: clamp(380px, 40vw, 560px);
    min-height: 380px;
    background: #e8e8ec;
}

.property-bento--single {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
}

.property-bento--single .property-bento__main {
    aspect-ratio: 16 / 10;
    max-height: min(56vh, 560px);
}

.property-bento__main {
    position: relative;
    min-height: 0;
    height: 100%;
    cursor: pointer;
    background: #e8e8ec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.property-bento__main img,
.property-bento__cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.25s ease;
}

.property-bento__main:hover img,
.property-bento__cell:hover img {
    transform: scale(1.015);
}

.property-bento__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.property-bento__badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
}

.property-bento__badge--new {
    background: #2e7d32;
}

.property-bento__badge--featured {
    background: #e65100;
}

.property-bento__badge--sale {
    background: var(--pd-accent);
}

.property-bento__badge--rent {
    background: #006aff;
}

.property-bento__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--pd-gap);
    min-height: 0;
    height: 100%;
}

/* 1 side image: full-height single panel */
.property-bento__grid--count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* 2 side images: stack vertically (better for portrait photos) */
.property-bento__grid--count-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 3 side images: two on top, one wide below */
.property-bento__grid--count-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.property-bento__grid--count-3 .property-bento__cell:nth-child(3) {
    grid-column: 1 / -1;
}

/* 5-6 side images: 3 columns x 2 rows (Zillow-style) */
.property-bento__grid--count-5,
.property-bento__grid--count-6 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* 5 side images: let the last cell stretch to fill the empty slot */
.property-bento__grid--count-5 .property-bento__cell:nth-child(5) {
    grid-column: 2 / -1;
}

.property-bento__cell {
    position: relative;
    min-height: 0;
    height: 100%;
    cursor: pointer;
    background: #e8e8ec;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-bento__cell--more::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.property-bento__photos-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-text);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.property-bento__photos-btn:hover {
    background: #f5f5f5;
}

/* ---- Summary bar ---- */
.property-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    padding: 24px 0;
    border-bottom: 1px solid var(--pd-border);
}

.property-summary__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b21a8;
    margin-bottom: 8px;
}

.property-summary__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b21a8;
}

.property-summary__title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--pd-text);
    line-height: 1.25;
    margin: 0 0 8px;
}

.property-summary__price {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    color: var(--pd-text);
    line-height: 1.15;
    margin: 0 0 8px;
}

.property-summary__specs {
    font-size: 16px;
    font-weight: 600;
    color: var(--pd-text);
    margin: 0 0 8px;
}

.property-summary__specs span {
    color: var(--pd-muted);
    font-weight: 400;
    margin: 0 6px;
}

.property-summary__address {
    font-size: 15px;
    color: var(--pd-muted);
    margin: 0;
    line-height: 1.5;
}

.property-summary__map-link {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: var(--pd-radius);
    overflow: hidden;
    border: 1px solid var(--pd-border);
    background: var(--pd-bg);
    text-decoration: none;
    flex-shrink: 0;
}

.property-summary__map-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: var(--pd-muted);
    font-size: 12px;
    font-weight: 600;
}

.property-summary__map-preview i {
    font-size: 24px;
    color: var(--pd-accent);
}

/* ---- Two-column body ---- */
.property-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 40px;
    align-items: start;
    padding-top: 32px;
}

.property-main section {
    scroll-margin-top: 72px;
    margin-bottom: 40px;
}

.property-main h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--pd-text);
    margin: 0 0 20px;
}

.property-main p {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
}

/* Highlights grid */
.property-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.property-highlight {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.property-highlight__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pd-text);
}

.property-highlight__icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.property-highlight--no-icon {
    padding-inline-start: 52px;
}

.property-highlight__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--pd-text);
    margin: 0 0 2px;
}

.property-highlight__label {
    font-size: 13px;
    color: var(--pd-muted);
    margin: 0;
}

.property-featured-banner {
    background: #e8f5e9;
    border-radius: var(--pd-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.property-featured-banner__tag {
    font-size: 13px;
    font-weight: 800;
    color: #2e7d32;
    white-space: nowrap;
}

.property-featured-banner p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Amenities */
.property-amenities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 24px;
}

.property-amenity {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--pd-text);
}

.property-amenity img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

/* Details grid */
.property-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 32px;
}

.property-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pd-border);
    font-size: 14px;
}

.property-detail-row__label {
    color: var(--pd-muted);
    font-weight: 500;
}

.property-detail-row__value {
    color: var(--pd-text);
    font-weight: 600;
    text-align: end;
}

#property-map {
    width: 100%;
    height: 400px;
    min-height: 400px;
    border-radius: var(--pd-radius);
    overflow: hidden;
    background: var(--pd-bg);
}

/* ---- Sticky sidebar ---- */
.property-sidebar {
    position: sticky;
    top: 64px;
}

.property-inquiry-card {
    background: var(--pd-card);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.property-inquiry-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--pd-text);
}

.property-inquiry-card > p {
    font-size: 14px;
    color: var(--pd-muted);
    margin: 0 0 20px;
}

.property-inquiry-card .alert {
    font-size: 13px;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 6px;
}

.property-inquiry-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.property-inquiry-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pd-text);
    margin-bottom: 6px;
}

.property-inquiry-form label .required {
    color: var(--pd-accent);
}

.property-inquiry-form .form-group {
    margin-bottom: 14px;
}

.property-inquiry-form input,
.property-inquiry-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pd-border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--pd-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.property-inquiry-form input:focus,
.property-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--pd-text);
    box-shadow: 0 0 0 1px var(--pd-text);
}

.property-inquiry-form textarea {
    min-height: 100px;
    resize: vertical;
}

.property-inquiry-submit {
    width: 100%;
    padding: 14px 20px;
    background: var(--pd-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.property-inquiry-submit:hover {
    background: var(--pd-accent-hover);
}

.property-related {
    margin-top: 24px;
}

.property-related h4 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 12px;
}

.property-related-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--pd-border);
    text-decoration: none;
    color: inherit;
}

.property-related-item:hover .property-related-item__title {
    color: var(--pd-accent);
}

.property-related-item__img {
    width: 72px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--pd-bg);
}

.property-related-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-related-item__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--pd-text);
}

.property-related-item__meta {
    font-size: 12px;
    color: var(--pd-muted);
    margin: 0;
}

.property-related-item__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pd-accent);
    margin-top: 4px;
}

/* ---- Lightbox ---- */
.property-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
}

.property-lightbox.is-open {
    display: flex;
}

.property-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    padding: 4px 8px;
}

.property-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.property-lightbox__nav--prev {
    left: 16px;
}

.property-lightbox__nav--next {
    right: 16px;
}

.property-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.property-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .property-bento {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        background: transparent;
    }

    .property-bento:not(.property-bento--single) .property-bento__main {
        aspect-ratio: 16 / 10;
        height: auto;
        max-height: min(50vh, 420px);
    }

    .property-bento__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: none;
        height: auto;
        margin-top: var(--pd-gap);
    }

    .property-bento__grid--count-1,
    .property-bento__grid--count-2,
    .property-bento__grid--count-3 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .property-bento__grid--count-3 .property-bento__cell:nth-child(3),
    .property-bento__grid--count-5 .property-bento__cell:nth-child(5) {
        grid-column: auto;
    }

    .property-bento__cell {
        aspect-ratio: 4 / 3;
        height: auto;
    }

    .property-body {
        grid-template-columns: 1fr;
    }

    .property-sidebar {
        position: static;
    }

    .property-highlights {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .property-detail-wrap {
        padding: 0 12px 32px;
    }

    .property-detail-nav__tabs {
        display: none;
    }

    .property-bento__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .property-bento__grid--count-1 {
        grid-template-columns: 1fr;
    }

    .property-bento__cell {
        aspect-ratio: 4 / 3;
    }

    .property-summary {
        grid-template-columns: 1fr;
    }

    .property-summary__map-link {
        width: 100%;
        height: 80px;
    }

    .property-highlights,
    .property-details-grid,
    .property-amenities {
        grid-template-columns: 1fr;
    }

    .property-inquiry-form .form-row {
        grid-template-columns: 1fr;
    }
}
