/* =============================================================
   CANDOR PROPERTY | PROPERTY DETAILS
   Single page-specific stylesheet for property-details.php.
   Requires existing base.css, Bootstrap 4.5.3, Swiper and Leaflet.
   Covers: header / badges / gallery / facts / description /
   media & share cards / enquiry / location / mortgage modal.

   Design colours:
     Purple: #302d67 | Gold: #b5a48f | Dark: #343a40
     Pale panel: #f5f4f2 | NEW badge: #218a52
============================================================= */

/* -------------------------------------------------------------
   01. PROPERTY HEADER
------------------------------------------------------------- */

.cp-property-header .cp-property-title {
    color: #302d67;
    font-size: clamp(1.95rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.cp-property-address {
    color: #787781;
    font-size: .98rem;
    line-height: 1.6;
}

.cp-property-price {
    color: #302d67;
    font-size: clamp(1.55rem, 2.3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}


/* -------------------------------------------------------------
   01A. EPC CURRENT & POTENTIAL RATINGS
   Used by includes/epc-rating-inline.php on property-details.php.
   NEW / SSTC / SOLD badges remain styled by status-badges.css.
------------------------------------------------------------- */

/* Status stays above the price; the EPC group is displayed below it. */
/* One neutral container around both current and potential ratings. */
.cp-property-header .cp-epc-group.cp-epc-group--scores {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    max-width: 100%;
    margin-top: .4rem;
    margin-bottom: 0;
    padding: 3px 5px;
    border: 1px solid #d5d7db;
    border-radius: 5px;
    background: #fff;
    vertical-align: middle;
    font-size: .7rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    box-sizing: border-box;
}

.cp-property-header .cp-epc-segment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.cp-property-header .cp-epc-segment--potential {
    margin-left: 10px;
}

.cp-property-header .cp-epc-label {
    color: #25252b;
    font-size: inherit;
    font-weight: 700;
}

/* A single joined letter-and-number badge with rounded OUTER corners. */
.cp-property-header .cp-epc-pair {
    --epc-band: #7fc21b;
    --epc-band-text: #121212;
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    height: 22px;
    overflow: hidden;
    border: 2px solid var(--epc-band);
    border-radius: 5px;
    box-sizing: border-box;
    vertical-align: middle;
}

.cp-property-header .cp-epc-pair .cp-epc-letter,
.cp-property-header .cp-epc-pair .cp-epc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Coloured rating letter: retain original size and padding. */
.cp-property-header .cp-epc-pair .cp-epc-letter {
    min-width: 22px;
    padding: 0 4px;
    background: var(--epc-band);
    color: var(--epc-band-text);
}

/* Smaller centred numerical score: grey fill, straight shared edge. */
.cp-property-header .cp-epc-pair .cp-epc-number {
    min-width: 20px;
    padding: 0 3px;
    border-left: 1px solid var(--epc-band);
    background: #f4f4f4;
    color: #242424;
    font-size: .61rem;
}

/* EPC bands (residential): distinct colour for each rating letter. */
.cp-property-header .cp-epc-pair--a { --epc-band: #0b6623; --epc-band-text: #fff; }
.cp-property-header .cp-epc-pair--b { --epc-band: #33a13e; --epc-band-text: #111; }
.cp-property-header .cp-epc-pair--c { --epc-band: #7fc21b; --epc-band-text: #142400; }
.cp-property-header .cp-epc-pair--d { --epc-band: #ffcb01; --epc-band-text: #1c1c1c; }
.cp-property-header .cp-epc-pair--e { --epc-band: #fea142; --epc-band-text: #1c1c1c; }
.cp-property-header .cp-epc-pair--f { --epc-band: #ff6602; --epc-band-text: #1c1c1c; }
.cp-property-header .cp-epc-pair--g { --epc-band: #fd0100; --epc-band-text: #151515; }

/* -------------------------------------------------------------
   02. SWIPER IMAGE GALLERY
------------------------------------------------------------- */

.cp-property-gallery-main {
    position: relative;
    overflow: hidden;
    height: 500px;
    border-radius: 6px;
    background: #f1f0ef;
}

.cp-property-gallery-main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

.cp-property-gallery-main .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-property-gallery-main .swiper-button-prev,
.cp-property-gallery-main .swiper-button-next {
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}

.cp-property-gallery-main .swiper-button-prev::after,
.cp-property-gallery-main .swiper-button-next::after {
    font-size: 25px;
    font-weight: 700;
}

.cp-property-gallery-thumbs {
    overflow: hidden;
}

.cp-property-gallery-thumbs .swiper-slide {
    height: 86px;
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
    opacity: .45;
    transition: opacity .2s ease;
}

.cp-property-gallery-thumbs .swiper-slide:hover,
.cp-property-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.cp-property-gallery-thumbs .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -------------------------------------------------------------
   03. FACTS BOX: BEDS / BATHS / AREA / TYPE
------------------------------------------------------------- */

.cp-property-facts-box {
    padding: 33px 18px;
    border-radius: 7px;
    background: #f5f4f2;
}

.cp-property-fact {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 5px 8px;
    text-align: center;
}

.cp-property-fact .material-icons {
    color: #b5a48f;
    font-size: 25px;
    line-height: 1.15;
}

.cp-property-fact strong {
    color: #302d67;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cp-property-fact > span:not(.material-icons) {
    color: #85838b;
    font-size: .77rem;
    line-height: 1.45;
}

.cp-property-fact .cp-property-type {
    font-size: .95rem;
}

/* -------------------------------------------------------------
   04. PROPERTY DESCRIPTION & FEATURES
------------------------------------------------------------- */

.cp-property-content .cp-content-title,
.cp-property-location .cp-content-title {
    color: #302d67;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
}

.cp-property-summary {
    color: #302d67;
    font-size: 1.03rem;
    font-weight: 600;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.cp-property-description {
    color: #4f4e55;
    font-size: .97rem;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

.cp-property-features-list h3 {
    color: #302d67;
    font-size: 1.35rem;
    font-weight: 700;
}

.cp-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: #4f4e55;
    font-size: .95rem;
    line-height: 1.55;
}

.cp-feature-item .material-icons {
    flex: 0 0 auto;
    color: #b5a48f;
    font-size: 21px;
    line-height: 1.2;
}

/* -------------------------------------------------------------
   05. RIGHT SIDEBAR: MEDIA & SHARE CARDS
------------------------------------------------------------- */

.cp-property-media-card,
.cp-property-enquiry-panel {
    padding: 24px;
    border-radius: 7px;
    background: #f5f4f2;
}

.cp-media-title {
    color: #302d67;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.012em;
}

.cp-media-buttons .btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cp-media-buttons .material-icons {
    font-size: 20px;
}

/* Keep share buttons the same height inside each 3-column row. */
.cp-property-media-card .row.text-center .btn {
    min-height: 52px;
    font-size: .85rem;
    white-space: normal;
}

.cp-property-media-card .row.text-center .btn .small {
    font-size: .68rem;
    line-height: 1.25;
}

/* -------------------------------------------------------------
   06. ENQUIRY PANEL
------------------------------------------------------------- */

.cp-property-enquiry-panel h3 {
    margin-bottom: 12px;
    color: #302d67;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.cp-property-enquiry-panel > p {
    color: #69666e;
    font-size: .95rem;
    line-height: 1.7;
}

.cp-property-enquiry label {
    color: #302d67;
    font-size: .92rem;
    font-weight: 500;
}

.cp-property-enquiry .form-control {
    min-height: 39px;
    border: 1px solid #dcdbe0;
    border-radius: 4px;
    background: #fff;
    color: #33313e;
}

.cp-property-enquiry textarea.form-control {
    min-height: 108px;
    resize: vertical;
}

.cp-property-enquiry .form-control:focus {
    border-color: #655997;
    box-shadow: 0 0 0 .15rem rgba(48, 45, 103, .13);
}

.cp-property-enquiry .form-check-label {
    color: #302d67;
    font-size: .84rem;
    font-weight: 400;
    line-height: 1.55;
}

.cp-property-enquiry .btn[type="submit"] {
    min-height: 46px;
}

/* -------------------------------------------------------------
   07. LOCATION MAP
------------------------------------------------------------- */

.cp-property-location {
    background: #f8f8f8;
}

#cp-property-map {
    width: 100%;
    height: 370px;
    overflow: hidden;
    border-radius: 6px;
    background: #e9e9e9;
}

/* -------------------------------------------------------------
   08. COMPACT MORTGAGE CALCULATOR LAUNCHER
------------------------------------------------------------- */

.cp-mortgage-trigger-card .cp-media-title {
    margin-bottom: .4rem;
}

.cp-mortgage-intro {
    color: #5b5966;
    font-size: .92rem;
    line-height: 1.55;
}

.cp-mortgage-launch {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.cp-mortgage-launch .material-icons {
    font-size: 21px;
}

/* =============================================================
   PREVENT PAGE SHIFT WHEN MODAL OPENS
============================================================= */

html {
    scrollbar-gutter: stable;
}

body.modal-open {
    padding-right: 0 !important;
}

/* -------------------------------------------------------------
   09. MORTGAGE CALCULATOR MODAL
------------------------------------------------------------- */

.cp-mortgage-dialog {
    max-width: 720px;
}

.cp-mortgage-dialog .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 8px;
}

.cp-mortgage-dialog .modal-header {
    align-items: flex-start;
    padding: 24px 26px 18px;
    border-bottom: 1px solid #e6e4e9;
}

.cp-mortgage-dialog .modal-body {
    padding: 24px 26px;
}

.cp-mortgage-dialog .modal-footer {
    padding: 13px 26px;
    border-top: 1px solid #e6e4e9;
}

.cp-mortgage-modal-title {
    color: #302d67;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.cp-mortgage-calculator label {
    display: block;
    margin-bottom: .4rem;
    color: #302d67;
    font-size: .86rem;
    font-weight: 600;
}

.cp-mortgage-calculator .form-control,
.cp-mortgage-calculator .custom-select {
    min-height: 42px;
    border: 1px solid #dcdce4;
    border-radius: 4px;
    background: #fff;
    color: #302d67;
}

.cp-mortgage-calculator .form-control:focus,
.cp-mortgage-calculator .custom-select:focus {
    border-color: #594a9a;
    box-shadow: 0 0 0 .14rem rgba(89, 74, 154, .16);
}

.cp-mortgage-result {
    padding: 17px;
    border-radius: 6px;
    background: #302d67;
    color: #fff;
}

.cp-mortgage-result-label {
    color: #e8e3f3;
    font-size: .82rem;
}

.cp-mortgage-payment {
    margin-top: .3rem;
    font-size: 1.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.cp-mortgage-breakdown {
    margin-top: .45rem;
    color: #eeeaf7;
    font-size: .78rem;
    line-height: 1.5;
}

.cp-mortgage-note {
    color: #686672;
    font-size: .72rem;
    line-height: 1.6;
}

/* -------------------------------------------------------------
   10. FLOORPLAN & VIDEO MODALS
------------------------------------------------------------- */

.cp-media-modal {
    overflow: hidden;
    border: 0;
    border-radius: 7px;
}

.cp-media-modal .modal-header {
    align-items: center;
    border-bottom: 1px solid #e8e6eb;
}

.cp-media-modal .modal-title {
    color: #302d67;
    font-weight: 700;
}

.cp-media-modal .modal-body {
    max-height: calc(100vh - 170px);
    overflow: auto;
}

.cp-media-modal .modal-body.p-0 {
    overflow: hidden;
}

.cp-modal-floorplan {
    max-width: 100%;
    height: auto;
}

/* -------------------------------------------------------------
   11. RESPONSIVE LAYOUT
------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .cp-property-gallery-main {
        height: 420px;
    }

    .cp-property-media-card,
    .cp-property-enquiry-panel {
        padding: 23px;
    }
}

@media (max-width: 767.98px) {
    .cp-property-gallery-main {
        height: 330px;
    }

    .cp-property-gallery-thumbs .swiper-slide {
        height: 70px;
    }

    .cp-property-facts-box {
        padding: 23px 8px;
    }

    .cp-property-fact {
        padding: 4px 5px;
    }

    .cp-property-fact strong {
        font-size: .98rem;
    }

    .cp-property-content .cp-content-title,
    .cp-property-location .cp-content-title {
        font-size: 1.55rem;
    }
}

@media (max-width: 575.98px) {
    .cp-property-header .cp-property-title {
        font-size: 1.9rem;
    }

    .cp-property-price {
        font-size: 1.6rem;
    }

    .cp-property-gallery-main {
        height: 260px;
    }

    .cp-property-gallery-thumbs .swiper-slide {
        height: 58px;
    }

    .cp-property-facts-box {
        padding: 21px 4px;
    }

    .cp-property-fact .material-icons {
        font-size: 22px;
    }

    .cp-property-fact .cp-property-type {
        font-size: .82rem;
    }

    .cp-property-media-card,
    .cp-property-enquiry-panel {
        padding: 20px;
    }

    .cp-mortgage-dialog {
        margin: .5rem;
        max-width: none;
    }

    .cp-mortgage-dialog .modal-header {
        padding: 18px 18px 14px;
    }

    .cp-mortgage-dialog .modal-body {
        padding: 18px;
    }

    .cp-mortgage-dialog .modal-footer {
        padding: 12px 18px;
    }

    .cp-mortgage-modal-title {
        font-size: 1.3rem;
    }

    .cp-mortgage-payment {
        font-size: 1.55rem;
    }

    #cp-property-map {
        height: 300px;
    }
}

/* Small phones: reduce EPC spacing only; allow the group to wrap as a unit. */
@media (max-width: 380px) {
    .cp-property-header .cp-epc-group.cp-epc-group--scores {
        font-size: .64rem;
        padding: 3px 4px;
    }

    .cp-property-header .cp-epc-segment {
        gap: 3px;
    }

    .cp-property-header .cp-epc-segment--potential {
        margin-left: 6px;
    }

    .cp-property-header .cp-epc-pair {
        height: 20px;
    }

    .cp-property-header .cp-epc-pair .cp-epc-letter {
        min-width: 20px;
        padding: 0 3px;
        font-size: .66rem;
    }

    .cp-property-header .cp-epc-pair .cp-epc-number {
        min-width: 19px;
        padding: 0 2px;
        font-size: .58rem;
    }
}
