/*
 * Agent profile page, Figma: "Agents / Agent Profile / Listings Displayed" (node 532-18748).
 * Classes are scoped with pa-ap so the template css cannot reach them; colours come from layout-v3.css.
 */

:where(.pa-ap) h1,
:where(.pa-ap) h2,
:where(.pa-ap) p {
    margin: 0;
    padding: 0;
}

.pa-ap {
    --pa-ap-border: #e1e6ee;
    background: #fff;
    font-family: 'Inter', sans-serif;
    color: var(--pa-brand-900);
}

.pa-ap__body {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 0;
}

/* ---------- agent card (Figma: "header") ---------- */

.pa-ap__agent {
    position: sticky;
    top: 24px;
    display: flex;
    flex: 0 0 402px;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(180deg, #2e57d5 0%, #6699ff 100%);
    border-radius: 24px;
}

.pa-ap__avatar {
    position: relative;
    z-index: 0;
    flex-shrink: 0;
    width: 170px;
    height: 170px;
    margin-bottom: -16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
}

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

.pa-ap__avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 64px;
    font-weight: 700;
    color: #fff;
}

/* Figma "contact-card": frosted glass over the photo's lower edge */
.pa-ap__contact {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.pa-ap__name {
    font-size: 20px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
    overflow-wrap: anywhere;
}

.pa-ap__meta {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: normal;
    color: #fbfbfb;
    opacity: 0.9;
}

.pa-ap__company {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: normal;
    color: #fff;
}

/* explicit on the p, the template colours p elements directly */
.pa-ap__company p {
    color: #fff;
}

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

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

/* ---------- listings (Figma: "Property results") ---------- */

.pa-ap__results {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.pa-ap__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pa-ap__heading {
    font-size: 26px;
    font-weight: 700;
    line-height: normal;
    color: var(--pa-brand-900);
    white-space: nowrap;
}

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

/* Figma: the row scrolls inside the panel, its scrollbar hidden like the search page */
.pa-ap__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 651px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.pa-ap__list::-webkit-scrollbar {
    display: none;
}

.pa-ap__card {
    position: relative;
    display: flex;
    flex-shrink: 0;
    min-height: 176px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pa-ap-border);
    border-radius: 16px;
}

.pa-ap__card:hover {
    border-color: var(--pa-brand-500);
}

/* the whole card opens the listing, the share button sits above it */
.pa-ap__card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.pa-ap__photo {
    position: relative;
    flex: 0 0 360px;
    background: var(--pa-gray-50);
}

.pa-ap__photo img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.pa-ap__photos {
    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-ap__details {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 15px 15px 15px 16px;
}

.pa-ap__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

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

.pa-ap__share {
    position: relative;
    z-index: 2;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--pa-brand-500);
    border: 0;
    border-radius: 18px;
    cursor: pointer;
}

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

.pa-ap__share img {
    display: block;
}

.pa-ap__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 14px;
    line-height: normal;
    color: var(--pa-gray-500);
}

.pa-ap__text p {
    color: var(--pa-gray-500);
}

.pa-ap__text .pa-ap__title {
    overflow: hidden;
    font-size: 16px;
    line-height: 17px;
    color: var(--pa-brand-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.pa-ap__stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    white-space: nowrap;
}

.pa-ap__stat img {
    display: block;
}

.pa-ap__stat--like { color: var(--pa-red-500); }
.pa-ap__stat--fav { color: #f59e0b; }
.pa-ap__stat--views { color: var(--pa-brand-500); }

.pa-ap__empty {
    padding: 48px 24px;
    border: 1px dashed var(--pa-ap-border);
    border-radius: 16px;
    font-size: 14px;
    color: var(--pa-gray-500);
    text-align: center;
}

/* ---------- pagination (Figma: "Pagination") ---------- */

.pa-ap__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.pa-ap__pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.pa-ap__page,
.pa-ap__page:hover,
.pa-ap__page:focus {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    background: #fff;
    border: 1px solid var(--pa-brand-500);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    color: var(--pa-brand-500);
    text-decoration: none;
    white-space: nowrap;
}

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

.pa-ap__page.is-current {
    background: var(--pa-brand-600);
    border-color: var(--pa-brand-600);
    color: #fff;
}

.pa-ap__page--gap {
    border-color: transparent;
}

.pa-ap__page img {
    display: block;
}

.pa-ap__page--prev img {
    transform: rotate(180deg);
}

/* ---------- copy toast ---------- */

.pa-ap__toast {
    position: fixed;
    top: 112px;
    left: 50%;
    z-index: 1060;
    max-width: calc(100% - 32px);
    padding: 8px 12px;
    background: #d1fae5;
    border: 0.5px solid #10b981;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #10b981;
    transform: translateX(-50%);
}

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

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

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

@media (max-width: 1199px) {
    .pa-ap__agent {
        flex-basis: 340px;
    }

    .pa-ap__photo {
        flex-basis: 280px;
    }
}

@media (max-width: 991px) {
    .pa-ap__body {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .pa-ap__agent {
        position: static;
        flex-basis: auto;
    }

    .pa-ap__list {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 575px) {
    .pa-ap__card {
        flex-direction: column;
    }

    .pa-ap__photo {
        flex-basis: auto;
        height: 200px;
    }

    .pa-ap__summary,
    .pa-ap__pagination {
        flex-wrap: wrap;
    }

    .pa-ap__heading {
        font-size: 22px;
    }
}
