.scroll-hidden {
    overflow: hidden;
}
.agents-container {
    background-color: #fff;
    padding: 81px 0;
}

.page-title {
    color: #0D0F10;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 40px;
}
.filters-container {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex-grow: 2;
}

.metro-popup {
    flex-grow: 1;
}
@media (max-width: 1024px) {
    .filters-container {
        flex-direction: column;
        gap: 12px;
    }
    .filter-button.has-arrow {
        flex-basis: 100%;
    }
}
.filter-button {
    border-radius: 60px;
    background: #F2F2F2;
    cursor: pointer;
    padding: 16px 24px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    border: none;
    color: #0D0F10;
}

@media (max-width: 1176px) {
    .filter-button {
        padding: 16px;
    }
}
.filter-button.active {
    background: #FFD83A;
}

.filter-button.has-arrow {
    min-width: 169px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.filter-button.has-arrow:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.card-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.card-list .card-item {
    flex: 0 1 calc((100% - (3 * 24px)) / 4);
}
.card-list .card-item.hidden-card {
    display: none;
}
@media (max-width: 1176px) {
    .card-list .card-item {
        flex: 0 1 calc((100% - (2 * 12px)) / 3);
    } 
}
@media (max-width: 1024px) {
    .card-list .card-item {
        flex: 0 1 calc((100% - 24px) / 2);
    } 
}
@media (max-width: 767px) {
    .card-list .card-item {
        flex: 0 1 100%;
    } 
}
.card {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 4.9px 0 rgba(143, 147, 151, 0.21), 0 1px 12px 0 rgba(143, 147, 151, 0.16);
}
.photo_fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}
.card_img {
    height: 162px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.card_body {
    display: flex;
    flex-direction: column;
    padding: 25px 20px 27px;
    gap: 24px 0;
    flex-grow: 1;
    justify-content: space-between;
}

.address {
    display: -webkit-box;
    display: box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    line-clamp: 2; 
    color: #0D0F10;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    -webkit-box-orient: vertical;
}

.contact-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}

.contact-list__item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.contact-list__item:not(:first-child) {
    margin-left: -8px;
}

.more-agents {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.17;
    color: #0D0F10;
}

.button {
    display: block;
    border-radius: 58px;
    background: #0D85FF;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    padding: 13px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.popup-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    display: flex;
    opacity: 0;
    visibility: hidden;
}

.popup-overlay.active{
    opacity: 1;
    visibility: visible;
}

.chose-city-popup {
    border: 1px solid #E1E1E1;
    background-color: #fff;
    max-width: 1248px;
    width: 100%;
    min-height: 100%;
}

.popup-header {
    border-bottom: 1px solid #DDDEE0;
    display: flex;
    align-items: center;
    padding: 23px 24px 23px 18px;
    color: #0D0F10;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.popup-title {
    color: #0D0F10;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    text-align: center;
}

.close-button {
    width: 32px;
    height: 32px;
    border-radius: 61px;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0D0F10;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
}

.back-button {
    color: #170436;
    font-size: 15px;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .popup-header {
        background: #F2F2F2;
        position: relative;
    }
    .back-button {
        font-size: 0;
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
    }
    .close-button {
        display: none;
    }
}
.back-button .arrow {
    transform: rotate(90deg);
}

.popup-content {
    padding: 40px 23px;
    height: calc(100vh - 80px);
}

@media (max-width: 768px) {
    .chose-city-popup .filters {
        display: block;
    }

    .chose-city-popup .filters .filters-item{
        background: none;
    }

    .chose-city-popup .filter-button{
        display: block;
        background: none;
    }
}
.agency {
    padding: 80px 0;
    background-color: #fff;
    color: #0D0F10;
}

.agency__nav {
    display: flex;
    gap: 15px;
    margin-bottom: 46px;
}

.agency__back,
.agency__city {
    background: #f3f3f3;
    border: none;
    border-radius: 24px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
}
  
.agency__address {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 31px;
}
@media (min-width: 1024px) {
    .agency__info {
        display: grid;
        gap: 20px 24px;
        margin-bottom: 32px;
        grid-template-columns: 1fr 2fr;
        grid-template-rows: 225px 50px auto;
        grid-template-areas:
            "agency-photo agency-team"
            "agency-socials agency-team"
            "agency-stats agency-team";
    }

    .agency__info--has_map {
        grid-template-areas:
            "agency-photo agency-map"
            "agency-socials agency-team"
            "agency-stats agency-team";
    }
}

@media (max-width: 1023px) {

    .agency__info {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 32px;
    }
}

.agency__photo {
    grid-area: agency-photo;
    overflow: hidden;
    border-radius: 12px;
}

.agency__photo img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.agency__socials {
    display: flex;
    gap: 8px;
    grid-area: agency-socials;
}
@media (max-width: 1176px) {
    .agency__socials {
        flex-wrap: wrap;
    }
}

.agency__map {
    grid-area: agency-map;
    cursor: pointer;
}

.agency__map img{
    width: 100%;
}
  
.social {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f6f6f6;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    width:calc((100% - (8 * 2)) / 3);
}

@media (max-width: 767px) {
    .social {
        width: calc((100% - 8px) / 2);
    }
}


@media (hover: hover) {
    .social:hover {
        text-decoration: none;
        background: #DDDEE0;
    }
    .button:hover {
        background-color: #0072ed;
        text-decoration: none;
        color: #fff;
    }
    .agency__back:hover,
    .agency__city:hover,
    .filter-button:hover:not(:disabled) {
        background-color: #DDDEE0;
        text-decoration: none;
        color: #0D0F10;
    }
}

.agency__stats {
    padding: 19px 0 0;
    grid-area: agency-stats;
}
  
.agency__subtitle {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 23px;
}

.agency__countries {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 16px;
    list-style: none;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: #0D0F10;
}

.agency__countries li {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    width: 47%;
}

.agency__team {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    grid-area: agency-team;
    flex-wrap: wrap;
}
  
.agent-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px 7px 7px;
    box-shadow: 0 1px 2px #DDDEE0;
    flex-basis: calc((100% - 16px) / 2);
}

@media (max-width: 767px) {
    .agent-card {flex-basis: 100%;}
}
.agent-card__photo--small-avatar {
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 50%;
}

.agent-card__info {
    display: flex;
    align-items: center;
    gap: 0 20px;
}
  
.agent-card__name {
    font-size: 15px;
    font-weight: 700;
    color: #0D0F10;
}

.agent-card__exp {
    font-size: 15px;
    font-weight: 500;
    color: #0D0F10;
}

.agent-card__contacts {
    display: flex;
    flex-wrap: wrap;
    margin-top: auto;
}

.agent-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 10px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #0D0F10;
    transition: background 0.3s ease;
    flex-basis: 33.3%;
}
@media (hover: hover) {
    .agent-card__link:hover {
        background: #DDDEE0;
        text-decoration: none;
    }
}

@media (max-width: 768px) {
    .agency__info {
        grid-template-columns: 1fr;
    }
}
.form-popup {
    border-radius: 32px;
    background: #FFF;
    position: relative;
    max-width: 496px;
    width: 100%;
}
.form-popup .close-button {
    position: absolute;
    top: 41px;
    right: 39px;
    width: 24px;
    height: 24px;
    background: none;
    padding: 0;
}

.form-popup .popup-content {
    padding: 40px;
}

@media (max-width: 768px) {
    .form-popup .popup-content {
        padding: 40px 20px;
    }

    .form-popup .close-button {
        top: 21px;
        right: 29px;
    }
}

.form-popup .agent-card__name {
    font-size: 24px;
}

.form-popup .agent-card__exp {
    font-weight: 600;
}

.form-popup .agent-card__exp .address {
    display: block;
}

.form-popup .popup-title {
    display: flex;
    align-items: center;
    gap: 0 27px;
    margin: 0 0 26px;
}

.form-popup .agent-card__info {
    margin: 0 0 32px;
    padding: 0;
}

.input-row {
    margin-bottom: 20px;
}

.input-row .label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 12px;
    color: #170436;
}

.input-row .input {
    border-radius: 12px;
    border: 1px solid #C2BAD2;
    background: #FFF;
    padding: 10px 16px;
    width: 100%;
    height: 57px;
}

.input-row .input::placeholder {
    color: #808080;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
}

.popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 12px;
    color: #FFF;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    border: none;
    cursor: pointer;
    padding: 18px 10px;
    transition: all 0.3s ease;
    gap: 0 10px;
}
@media (hover: hover) {
    .popup-button:hover {
        text-decoration: none;
    }
}

.popup-button.blue {
    background: #0072ED;
    margin: 40px 0 0;
}

.popup-button.yellow {
    background: #FFC700;
    color: #170436;
}
.popup-footer  {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 26px;
    border-top: 1px solid #DDDEE0;
}

.popup-footer-title {
    color: #170436;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

#map { height: 100%; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 8px;
    margin: 20px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.pagination__ellipsis,
.pagination__page {
    border-radius: 12px;
    border: 1px solid #DDDEE0;
    display: flex;
    height: 48px;
    min-width: 48px;
    justify-content: center;
    align-items: center;
    color: #170436;
}

.pagination__page:hover,
.pagination__page.is-active {
    background: #F2F2F2;
    text-decoration: none;
}

.pagination__ellipsis {
    color: #8F9397;
}

.pagination__nav {
    margin: 0 16px;
}

.pagination__nav.is-disabled {
    color: #ACAFB2;
    cursor: text;
    pointer-events: none;
}

@media (max-width: 767px) {
    .pagination__nav {
        display: none;
    }
}
