/*
 * Property detail page, Figma: "Property for Rent / Property Detail / *" (node 532-17952 and its states).
 * Classes are scoped with pa-pd so the template css cannot reach them; colours come from layout-v3.css.
 */

:where(.pa-pd) h1,
:where(.pa-pd) h2,
:where(.pa-pd) p,
:where(.pa-pd) ul,
:where(.pa-pd) dl,
:where(.pa-pd) dd,
:where(.pa-pd) fieldset,
:where(.pa-pd) legend {
    margin: 0;
    padding: 0;
}

:where(.pa-pd) button {
    font-family: inherit;
}

.pa-pd {
    --pa-pd-border: #e6eaf0;
    --pa-pd-field: #e2e8f0;
    --pa-pd-tile: #f6f8fb;
    --pa-pd-shadow: 0 4px 16px rgba(20, 35, 74, 0.03);
    background: #fff;
    font-family: 'Inter', sans-serif;
    color: var(--pa-brand-900);
}

/* ---------- breadcrumb and utilities (Figma: "Breadcrumb and utilities") ---------- */

.pa-pd__bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
}

.pa-pd__crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 13px;
    line-height: normal;
}

.pa-pd__crumbs img {
    display: block;
    flex-shrink: 0;
}

.pa-pd__crumb-back,
.pa-pd__crumb-back:hover,
.pa-pd__crumb-back:focus {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pa-brand-300, #7694f1);
    text-decoration: none;
    white-space: nowrap;
}

.pa-pd__crumb-back:hover span {
    text-decoration: underline;
}

.pa-pd__crumb-current {
    font-weight: 600;
    color: var(--pa-brand-500);
    white-space: nowrap;
}

.pa-pd__utilities {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.pa-pd__utility {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--pa-pd-tile);
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    color: var(--pa-brand-900);
    cursor: pointer;
}

.pa-pd__utility:hover {
    background: var(--pa-brand-50);
}

.pa-pd__utility:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pa-pd__utility img {
    display: block;
}

/* Figma: "notification/toaster" sits centred in the breadcrumb row */
.pa-pd__toast {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    max-width: calc(100% - 64px);
    padding: 8px 12px;
    background: #d1fae5;
    border: 0.5px solid #10b981;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    color: #10b981;
    transform: translate(-50%, -50%);
}

.pa-pd__toast.is-error {
    background: #fee2e2;
    border-color: var(--pa-red-500);
    color: var(--pa-red-500);
}

/* ---------- layout ---------- */

.pa-pd__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 480px;
    grid-template-areas:
        'photo side'
        'desc side'
        'facts side'
        'map side';
    align-items: start;
    gap: 20px 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 0;
}

.pa-pd__photo { grid-area: photo; }
.pa-pd__desc { grid-area: desc; }
.pa-pd__facts { grid-area: facts; }
.pa-pd__location { grid-area: map; }

.pa-pd__side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pa-pd__card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Figma's 24px padding includes its inside stroke */
    padding: 23px;
    background: #fff;
    border: 1px solid var(--pa-pd-border);
    border-radius: 16px;
    box-shadow: var(--pa-pd-shadow);
}

.pa-pd__heading {
    font-size: 18px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-brand-900);
}

/* ---------- photo (Figma: "Property photo") ---------- */

.pa-pd__photo {
    position: relative;
    height: 614px;
    overflow: hidden;
    background: var(--pa-gray-50);
    border-radius: 16px;
}

/* the photo opens the Gallery page */
.pa-pd__photo-link {
    display: block;
    height: 100%;
    cursor: zoom-in;
}

.pa-pd__photo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pa-pd__photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 14px;
    color: var(--pa-gray-500);
}

.pa-pd__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-brand-500);
    text-transform: uppercase;
}

.pa-pd__count {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    color: #fff;
}

.pa-pd__nav {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(44, 49, 59, 0.6);
    border: 0;
    border-radius: 100px;
    transform: translateY(-50%);
    cursor: pointer;
}

.pa-pd__nav:hover {
    background: rgba(44, 49, 59, 0.8);
}

.pa-pd__nav:disabled {
    opacity: 0.4;
    cursor: default;
}

.pa-pd__nav img {
    display: block;
}

.pa-pd__nav--prev {
    left: 23px;
}

.pa-pd__nav--next {
    right: 23px;
}

/* ---------- description ---------- */

.pa-pd__copy {
    font-size: 14px;
    line-height: 1.5;
    color: var(--pa-gray-500);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* ---------- property details and amenities (Figma: "Frame 957") ---------- */

.pa-pd__facts {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.pa-pd__details {
    flex: 0 0 672px;
    min-width: 0;
}

.pa-pd__amenities {
    flex: 1 1 0;
    min-width: 0;
}

.pa-pd__tiles {
    display: flex;
    gap: 12px;
}

.pa-pd__tile {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    height: 116px;
    padding: 16px;
    background: var(--pa-pd-tile);
    border-radius: 12px;
}

.pa-pd__tile img {
    display: block;
}

.pa-pd__tile-value {
    font-size: 22px;
    line-height: normal;
    color: var(--pa-brand-900);
    white-space: nowrap;
}

.pa-pd__tile-label {
    font-size: 14px;
    line-height: normal;
    color: var(--pa-gray-500);
    white-space: nowrap;
}

.pa-pd__overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    font-size: 14px;
    line-height: normal;
}

.pa-pd__overview div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pa-pd__overview dt {
    font-weight: 400;
    color: var(--pa-gray-500);
}

.pa-pd__overview dd {
    margin: 0;
    font-weight: 600;
    color: var(--pa-brand-500);
}

.pa-pd__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pa-pd__pill {
    padding: 8px 12px;
    background: var(--pa-brand-500);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    line-height: normal;
    color: #fff;
    white-space: nowrap;
}

.pa-pd__muted {
    font-size: 14px;
    color: var(--pa-gray-500);
}

/* ---------- location map ---------- */

.pa-pd__map {
    position: relative;
    z-index: 0;
    height: 591px;
    overflow: hidden;
    background: var(--pa-gray-50);
    border-radius: 12px;
}

.pa-pd__map-canvas {
    position: absolute;
    inset: 0;
}

.pa-pd__map-canvas.leaflet-container {
    background: var(--pa-gray-50);
    font-family: 'Inter', sans-serif;
}

/* Figma: "Zoom and location" */
.pa-pd__map-tools {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 1px 1px 5px rgba(21, 40, 98, 0.09);
}

.pa-pd__map-tools button {
    display: block;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.pa-pd__map-tools img {
    display: block;
}

.pa-pd__map-tools hr {
    width: 22px;
    height: 1px;
    margin: 0;
    background: #e1e6ee;
    border: 0;
}

.pa-pd__map-note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-size: 14px;
    color: var(--pa-gray-500);
    text-align: center;
}

.pa-pd__map:fullscreen {
    border-radius: 0;
}

/* ---------- title, price and stats (Figma: first sidebar card) ---------- */

.pa-pd__title {
    font-size: 24px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-brand-900);
    overflow-wrap: anywhere;
}

.pa-pd__place {
    font-size: 20px;
    line-height: 1.5;
    color: var(--pa-gray-500);
}

.pa-pd__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: normal;
    color: var(--pa-brand-500);
}

.pa-pd__price small {
    font-size: 16px;
    font-weight: 600;
    color: var(--pa-gray-500);
}

.pa-pd__nego {
    padding: 4px 10px;
    background: var(--pa-brand-50);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pa-brand-500);
}

.pa-pd__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* Figma: a hairline, then 8px */
    padding-top: 7px;
    border-top: 1px solid var(--pa-gray-100);
}

.pa-pd__stat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    white-space: nowrap;
}

.pa-pd__stat img {
    display: block;
}

button.pa-pd__stat {
    cursor: pointer;
}

button.pa-pd__stat:disabled {
    cursor: default;
}

/* liked / favourited by the visitor */
button.pa-pd__stat.is-on {
    margin: -2px -6px;
    padding: 2px 6px;
}

.pa-pd__stat--like { color: var(--pa-red-500); }
.pa-pd__stat--like.is-on { background: #fee2e2; }
.pa-pd__stat--fav { color: #f59e0b; }
.pa-pd__stat--fav.is-on { background: #fef3c7; }
.pa-pd__stat--views { color: var(--pa-brand-500); }

/* ---------- agent and contact ---------- */

.pa-pd__agent {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pa-pd__avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    background: var(--pa-brand-50);
    border-radius: 50%;
}

.pa-pd__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pa-pd__avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 22px;
    font-weight: 700;
    color: var(--pa-brand-500);
}

.pa-pd__agent-name {
    flex: 1 1 0;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--pa-brand-900);
}

.pa-pd__company {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: normal;
    color: var(--pa-gray-500);
}

/* explicit on the p, the template colours p elements directly */
.pa-pd__company p {
    color: var(--pa-gray-500);
}

.pa-pd__company img {
    display: block;
    flex-shrink: 0;
}

.pa-pd__company strong {
    display: block;
    font-weight: 700;
}

.pa-pd__contact {
    display: flex;
    gap: 12px;
}

.pa-pd__contact-btn,
.pa-pd__contact-btn:hover,
.pa-pd__contact-btn:focus {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 15px 8px;
    background: #fff;
    border: 1px solid var(--pa-brand-500);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    color: var(--pa-brand-500);
    text-decoration: none;
    cursor: pointer;
}

.pa-pd__contact-btn:hover {
    background: var(--pa-brand-50);
}

.pa-pd__contact-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pa-pd__contact-btn img {
    display: block;
}

.pa-pd__primary,
.pa-pd__primary:hover,
.pa-pd__primary:focus {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 24px;
    background: var(--pa-brand-500);
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.pa-pd__primary:hover {
    background: var(--pa-brand-600);
}

/* ---------- mortgage calculator (Figma component "Mortgage calculator", Default / Expand) ---------- */

.pa-pd__calc {
    box-shadow: 1px 1px 5px rgba(20, 35, 74, 0.03);
}

.pa-pd__calc-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-brand-900);
    text-align: left;
    cursor: pointer;
}

.pa-pd__calc-toggle span {
    flex: 1 1 0;
}

.pa-pd__calc-toggle img {
    display: block;
    flex-shrink: 0;
}

.pa-pd__calc-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-pd__calc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    line-height: normal;
    white-space: nowrap;
}

.pa-pd__calc-row span {
    color: var(--pa-gray-500);
}

.pa-pd__calc-row strong {
    font-weight: 600;
    color: var(--pa-brand-900);
}

.pa-pd__calc-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* ---------- form fields (calculator and appointment) ---------- */

.pa-pd__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.pa-pd__label {
    display: flex;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-gray-500);
}

.pa-pd__label em {
    font-style: normal;
    color: var(--pa-red-500);
}

.pa-pd__input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--pa-pd-field);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: normal;
    color: var(--pa-brand-900);
}

.pa-pd__input::placeholder {
    color: #bac0ca;
}

.pa-pd__input:focus {
    border-color: var(--pa-brand-500);
    outline: none;
}

textarea.pa-pd__input {
    min-height: 46px;
    resize: vertical;
}

.pa-pd__date {
    position: relative;
}

.pa-pd__date img {
    position: absolute;
    top: 50%;
    left: 14px;
    display: block;
    transform: translateY(-50%);
    pointer-events: none;
}

.pa-pd__date .pa-pd__input {
    padding-left: 46px;
}

.pa-pd__error {
    font-size: 12px;
    color: var(--pa-red-500);
}

/* ---------- appointment modal (Figma: "appointment-modal") ---------- */

.pa-pd__overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 16px;
    overflow-y: auto;
    background: rgba(21, 40, 98, 0.4);
}

.pa-pd__modal {
    display: flex;
    flex-direction: column;
    width: 582px;
    max-width: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pa-gray-100);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

.pa-pd__modal-title {
    padding: 16px;
    font-size: 22px;
    font-weight: 800;
    line-height: normal;
    color: var(--pa-brand-900);
    text-align: center;
}

.pa-pd__modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.pa-pd__row {
    display: flex;
    gap: 16px;
}

.pa-pd__row > * {
    flex: 1 1 0;
}

.pa-pd__slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-pd__slot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: 1px 1px 2.5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    color: var(--pa-brand-900);
    cursor: pointer;
}

.pa-pd__slot.is-on {
    background: var(--pa-brand-50);
    border-color: var(--pa-brand-500);
}

/* already started today */
.pa-pd__slot.is-off {
    opacity: 0.45;
    cursor: not-allowed;
}

.pa-pd__slot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pa-pd__slot input:focus-visible + .pa-pd__radio {
    outline: 2px solid var(--pa-brand-500);
    outline-offset: 2px;
}

.pa-pd__radio {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid var(--pa-gray-100);
    border-radius: 8px;
}

.pa-pd__slot img {
    display: block;
    flex-shrink: 0;
}

.pa-pd__modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.pa-pd__cancel {
    padding: 16px 24px;
    background: #fff;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
    color: var(--pa-red-500);
    cursor: pointer;
}

.pa-pd__submit {
    height: 50px;
    padding: 0 24px;
    background: var(--pa-brand-600);
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
    color: #fff;
    cursor: pointer;
}

/* Figma "Appointment Modal Open": grey until every field is filled */
.pa-pd__submit:disabled {
    background: var(--pa-gray-100);
    color: #fff;
    cursor: not-allowed;
}

/* ---------- app download prompt (Figma: Bookings / Booking List / Download App), used by bookings-v3 ---------- */
.pa-pd__app {
    position: relative;
    margin-top: 150px;
}

.pa-pd__app-logo {
    display: flex;
    justify-content: center;
    padding: 24px 16px 16px;
}

.pa-pd__app-logo img {
    display: block;
    width: 284px;
    max-width: 100%;
    height: auto;
}

.pa-pd__app-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0 40px 40px;
    text-align: center;
}

.pa-pd__app-title {
    margin: 0 0 -16px;
    font-size: 18px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 0.3px;
    color: var(--pa-brand-900);
}

.pa-pd__app-text {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    letter-spacing: 0.3px;
    color: var(--pa-gray-500);
}

.pa-pd__stores {
    display: flex;
    gap: 16px;
    width: 400px;
    max-width: 100%;
}

.pa-pd__store,
.pa-pd__store:hover,
.pa-pd__store:focus {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 15px;
    background: #fff;
    border: 1px solid var(--pa-brand-500);
    border-radius: 8px;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    line-height: normal;
    color: #000;
    text-align: left;
    text-decoration: none;
}

.pa-pd__store:hover {
    background: var(--pa-brand-50);
}

.pa-pd__store img {
    display: block;
    flex-shrink: 0;
}

.pa-pd__store small {
    display: block;
    font-size: 10px;
}

.pa-pd__app-close {
    position: absolute;
    top: 12px;
    right: 16px;
    padding: 0 4px;
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--pa-gray-500);
    cursor: pointer;
}

@media (max-width: 575px) {
    .pa-pd__app-body {
        padding: 0 20px 28px;
    }

    .pa-pd__stores {
        flex-direction: column;
    }
}

/* ---------- preview (CMS) ---------- */

.pa-pd__preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px 0;
}

.pa-pd__preview-bar h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--pa-brand-900);
}

.pa-pd__preview-actions {
    display: flex;
    gap: 8px;
}

/* ---------- smaller screens (design is desktop only) ---------- */

@media (max-width: 1679px) {
    .pa-pd__body {
        padding: 32px;
    }

    .pa-pd__details {
        flex-basis: auto;
        flex-grow: 1.6;
    }
}

@media (max-width: 1399px) {
    .pa-pd__body {
        grid-template-columns: minmax(0, 1fr) 400px;
    }

    .pa-pd__photo {
        height: 480px;
    }

    .pa-pd__facts {
        flex-direction: column;
    }

    .pa-pd__contact-btn {
        padding-right: 4px;
        padding-left: 4px;
    }
}

@media (max-width: 991px) {
    .pa-pd__body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            'photo'
            'side'
            'desc'
            'facts'
            'map';
        padding: 16px;
    }

    .pa-pd__bar {
        flex-wrap: wrap;
        padding: 16px;
    }

    .pa-pd__toast {
        position: fixed;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%);
        width: max-content;
        max-width: calc(100% - 32px);
    }

    .pa-pd__photo {
        height: 56vw;
        min-height: 240px;
    }

    .pa-pd__map {
        height: 360px;
    }

    .pa-pd__preview-bar {
        padding: 16px 16px 0;
    }
}

@media (max-width: 575px) {
    .pa-pd__tiles {
        flex-wrap: wrap;
    }

    .pa-pd__tile {
        flex-basis: calc(50% - 6px);
    }

    .pa-pd__row {
        flex-direction: column;
    }

    .pa-pd__place {
        font-size: 16px;
    }

    .pa-pd__crumb-back span {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
