/* =========================================================
   property-detail.css
   Include ONLY on the property detail page.
   Inherits CSS variables from the main stylesheet.
   ========================================================= */

/* ── page shell ──────────────────────────────────────────── */
.pd-main {
    background: var(--bg-light);
    padding-bottom: 80px;
}

/* ── breadcrumb ──────────────────────────────────────────── */
.pd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 22px;
    padding-bottom: 18px;
    font-size: 14px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.pd-breadcrumb a {
    color: var(--accent-color);
    font-weight: 500;
    transition: opacity .2s;
}
.pd-breadcrumb a:hover { opacity: .7; }
.pd-breadcrumb span { opacity: .5; }

/* ── gallery ─────────────────────────────────────────────── */
.pd-gallery {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto auto;
    gap: 8px;
    margin-bottom: 32px;
}

.pd-gallery-main {
    grid-column: 1;
    grid-row: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 460px;
    position: relative;
    cursor: zoom-in;
    background: var(--accent-light);
}
.pd-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.pd-gallery-main:hover img { transform: scale(1.02); }

.pd-gallery-overlay {
    position: absolute;
    bottom: 14px;
    right: 14px;
    pointer-events: none;
}
.pd-gallery-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(1,52,133,.82);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.pd-gallery-side {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pd-gallery-side-item {
    flex: 1;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    background: var(--accent-light);
    position: relative;
}
.pd-gallery-side-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.pd-gallery-side-item:hover img { transform: scale(1.04); }

/* thumbnail strip */
.pd-gallery-thumbs {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.pd-gallery-thumbs::-webkit-scrollbar { height: 4px; }
.pd-gallery-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pd-gallery-thumb {
    flex: 0 0 120px;
    height: 82px;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    border: 2px solid transparent;
    transition: border-color .2s;
    background: var(--accent-light);
}
.pd-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.pd-gallery-thumb:hover {
    border-color: var(--accent-color);
}
.pd-gallery-thumb:hover img { transform: scale(1.06); }

/* ── lightbox ────────────────────────────────────────────── */
.pd-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,10,.93);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.pd-lightbox.open { display: flex; }

.pd-lb-img-wrap {
    width: 90vw;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-lb-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    transition: opacity .25s;
}

.pd-lb-close,
.pd-lb-prev,
.pd-lb-next {
    position: absolute;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-lb-close:hover,
.pd-lb-prev:hover,
.pd-lb-next:hover { background: rgba(255,255,255,.22); }

.pd-lb-close { top: 20px; right: 24px; width: 42px; height: 42px; font-size: 1rem; }
.pd-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); width: 48px; height: 64px; }
.pd-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; }

.pd-lb-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .06em;
}

/* ── content grid ────────────────────────────────────────── */
.pd-content-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

/* ── cards ───────────────────────────────────────────────── */
.pd-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 20px;
}
.pd-card:last-child { margin-bottom: 0; }

/* ── title card ──────────────────────────────────────────── */
.pd-title-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.pd-badge-type,
.pd-badge-marketing,
.pd-badge-rented {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
}
.pd-badge-type      { background: var(--accent-light); color: var(--accent-color); }
.pd-badge-marketing { background: #e8f5e9; color: #2e7d32; }
.pd-badge-rented    { background: #fff3e0; color: #e65100; }

.pd-main-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    line-height: 1.2;
    color: var(--main-color);
    margin-bottom: 8px;
}
.pd-sub-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 14px;
    font-weight: 400;
}
.pd-location {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
}
.pd-location svg { flex-shrink: 0; color: var(--accent-color); }

/* ── facts strip ─────────────────────────────────────────── */
.pd-facts-card {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.pd-fact {
    flex: 1 1 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background .2s;
}
.pd-fact:hover { background: var(--bg-light); }
.pd-fact:nth-child(4n) { border-right: none; }
.pd-fact-icon img { width: 22px; height: 22px; opacity: .7; }
.pd-fact-val {
    font-size: 17px;
    font-weight: 700;
    color: var(--main-color);
    line-height: 1.2;
}
.pd-fact-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── section title inside card ───────────────────────────── */
.pd-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--main-color);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-light);
}

.pd-text {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.8;
    white-space: pre-line;
}
.pd-text--small { font-size: 14px; }

/* feature tag pills */
.pd-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.pd-feat-tag {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 20px;
    letter-spacing: .02em;
}

/* ── energy certificate ──────────────────────────────────── */
.pd-energy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}
.pd-energy-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pd-energy-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-light);
    font-weight: 600;
}
.pd-energy-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--main-color);
}
.pd-energy-class {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 900;
    color: #fff;
}
/* class colours */
.pd-energy-class[data-class="A+"]{ background:#00a651; }
.pd-energy-class[data-class="A"] { background:#4caf50; }
.pd-energy-class[data-class="B"] { background:#8bc34a; }
.pd-energy-class[data-class="C"] { background:#cddc39; color:#333; }
.pd-energy-class[data-class="D"] { background:#ffeb3b; color:#333; }
.pd-energy-class[data-class="E"] { background:#ffc107; color:#333; }
.pd-energy-class[data-class="F"] { background:#ff9800; }
.pd-energy-class[data-class="G"] { background:#f44336; }
.pd-energy-class[data-class="H"] { background:#b71c1c; }

/* scale bar */
.pd-energy-scale {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    height: 28px;
}
.pd-scale-seg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,.85);
    transition: flex .3s;
}
.pd-scale-seg.active {
    flex: 2;
    outline: 3px solid var(--main-color);
    outline-offset: -2px;
    color: #fff;
    font-size: 14px;
}

/* ── notes card ──────────────────────────────────────────── */
.pd-notes-card {
    border-left: 4px solid var(--accent-color);
    background: #f0f6ff;
}

/* ── sidebar ─────────────────────────────────────────────── */
.pd-sidebar {
    position: sticky;
    top: 24px;
}

/* price card */
.pd-price-card {
    border: 2px solid var(--main-color);
    background: linear-gradient(160deg, #f0f6ff 0%, #fff 100%);
}
.pd-price-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 6px;
}
.pd-price {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--main-color);
    line-height: 1;
    margin-bottom: 10px;
}
.pd-price-secondary {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

/* CTA button */
.pd-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
    padding: 15px 20px;
    background: var(--alt-color);
    color: #fff;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .25s, transform .2s, box-shadow .25s;
    box-shadow: 0 4px 20px rgba(201,35,35,.3);
}
.pd-cta-btn:hover {
    background: #a51c1c;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(201,35,35,.4);
}
.pd-cta-btn svg { flex-shrink: 0; transition: transform .2s; }
.pd-cta-btn:hover svg { transform: translateX(4px); }

.pd-cta-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* details table */
.pd-card-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    letter-spacing: .02em;
}
.pd-details-table {
    width: 100%;
    border-collapse: collapse;
}
.pd-details-table tr {
    border-bottom: 1px solid var(--bg-light);
}
.pd-details-table tr:last-child { border-bottom: none; }
.pd-dt-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 0;
    white-space: nowrap;
    width: 40%;
}
.pd-dt-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--main-color);
    padding: 8px 0 8px 12px;
    text-align: right;
}

/* contact card */
.pd-contact-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 2px;
}
.pd-contact-role,
.pd-contact-firm {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 2px;
}
.pd-contact-tel,
.pd-contact-web {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
    transition: opacity .2s;
    text-decoration: none;
}
.pd-contact-tel { display: flex; }
.pd-contact-web { display: block; font-size: 13px; font-weight: 500; color: var(--text-light); margin-top: 4px; }
.pd-contact-tel:hover,
.pd-contact-web:hover { opacity: .7; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 1050px) {
    .pd-content-grid {
        grid-template-columns: 1fr;
    }
    .pd-sidebar {
        position: static;
    }
    /* reorder: sidebar first on mobile */
    .pd-sidebar { order: -1; }
}

@media (max-width: 780px) {
    .pd-gallery {
        grid-template-columns: 1fr;
    }
    .pd-gallery-main { height: 260px; }
    .pd-gallery-side { flex-direction: row; }
    .pd-gallery-side-item { height: 120px; }

    .pd-energy-grid {
        grid-template-columns: 1fr 1fr;
    }
    .pd-facts-card .pd-fact:nth-child(3n) { border-right: none; }
    .pd-facts-card .pd-fact:nth-child(4n) { border-right: 1px solid var(--border); }
    .pd-facts-card .pd-fact:nth-child(2n) { border-right: none; }
}

@media (max-width: 500px) {
    .pd-card { padding: 20px 18px; }
    .pd-price { font-size: 1.7rem; }
    .pd-energy-grid { grid-template-columns: 1fr; }
}