:root {
    --background-color: #fbf8ec;
    --black-color: #170436;
    --blue-color: #0d85ff;
    --white-color: #fff;
    --gray-color: #F5F5F5;
    --heading-color: #4e117e;
    --subheading-color: #2a004a;
    --accent-color: #ff5935;
}

.wrapper {
    background-color: var(--background-color);
    font-size: 15px;
    line-height: 1;
    color: var(--black-color);
    padding-bottom: 141px;
}

.wrapper--contacts {
    padding-bottom: 80px;
}

.container {
    max-width: 1392px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrapper--light {
    background-color: var(--white-color);
    padding-top: 40px;
    padding-bottom: 64px;
}

.wrapper--light .title-block {
    background-color: var(--gray-color);
}

.wrapper--light .title-block__title {
    font-weight: 700;
    line-height: 1.2;
}

.wrapper--light .text-block__heading {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
}

.wrapper--light .text-block__item {
    font-weight: 400;
    line-height: 1.4;
}

.wrapper--light .container {
    max-width: 1216px;
}

@media (max-width: 767px) {
    .wrapper {
        padding-bottom: 40px;
    }
    .wrapper--light {
        padding-top: 16px;
    }
}

@media (max-width: 425px) {
    .container {
        padding: 0 20px;
    }
}

.title-block {
    background-color: #fff;
    border-radius: 32px;
    padding: 24px 32px;
    gap: 8px;
    display: flex;
    flex-direction: column;
}

.title-block__title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
}

.title-block__subtitle {
    font-weight: 400;
    font-size: 15px;
    line-height: 1.35;
}

.title-block__link {
    color: var(--blue-color);
    text-decoration: underline;
    font-weight: 500;
}

.text-blocks {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.text-block__heading {
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.35;
}

.text-block__item {
    line-height: 1.5;
}

.text-block__item--sub {
    padding-left: 16px;
}

.text-block__item--link {
    text-decoration: underline;
    color: var(--blue-color);
}

.text-block__properties {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-block__property-label {
    font-weight: 700;
    line-height: 1.5;
}

.text-block__property-value {
    margin-left: 0;
    line-height: 1.5;
}

.contacts__head-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.contacts__head-title svg {
    width: 56px;
    height: 56px;
}

.contacts__title {
    font-family: "Baloo 2", sans-serif;
    font-weight: 800;
    font-size: 56px;
    line-height: 1;
    color: var(--heading-color);
}

.contacts__head .header__link-back {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--heading-color);
    font-size: 15px;
    font-weight: 700;
    padding: 10px 16px 10px 40px;
    text-decoration: none;
}

.contacts__cards {
    flex: 0 0 318px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contacts__card {
    background-color: #fff;
    border-radius: 32px;
    padding: 24px;
}

.contacts__card-head,
.contacts__info-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contacts__card-head svg,
.contacts__info-head svg {
    width: 32px;
    height: 32px;
    color: var(--subheading-color);
}

.contacts__card-title,
.contacts__info-title {
    font-weight: 800;
    font-size: 20px;
    line-height: 1;
    color: var(--subheading-color);
}

.contacts__card-head {
    margin-bottom: 16px;
}

.contacts__card-btn {
    display: block;
    text-align: center;
    padding: 10px 12px;
    border-radius: 96px;
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.35;
    text-decoration: none;
}

.contacts__card-btn--outline {
    background-color: transparent;
    color: var(--black-color);
}

.contacts__card .contacts__card-btn {
    text-decoration: none;
}


.contacts__map {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}

.contacts__map picture {
    display: block;
    height: 100%;
}

.contacts__map-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.3s ease-in-out;
}

.contacts__info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 130px;
}

.contacts__info-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contacts__info-text {
    font-weight: 500;
    line-height: 1.35;
}

.contacts__info-link {
    font-weight: 700;
    color: inherit;
    text-decoration: underline;
}

#popup-map {
    background: radial-gradient(rgba(255, 255, 255, 0.9) 0%, rgba(63, 204, 217, 0.9) 37%, rgba(15, 162, 182, 0.9) 100%);
}

.contacts__map-modal {
    width: 100%;
    height: 100%;
    padding: 24px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contacts__map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contacts__map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.7);
}

.contacts__map-btn svg {
    width: 32px;
    height: 32px;
    color: var(--heading-color);
}

.contacts__map-caption {
    padding: 15px 24px;
    border-radius: 48px;
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--heading-color);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.contacts__map-view {
    flex: 1;
    border-radius: 24px;
    margin-bottom: 20px;
    overflow: hidden;
}

.contacts__map-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 12px 8px 12px 12px;
    font-size: 15px;
}

.contacts__map-card svg,
.contacts__map-card-close svg {
    width: 24px;
    height: 24px;
}

.contacts__map-card-close {
    position: absolute;
    top: 8px;
    right: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--subheading-color);
}

@media (hover: hover) {
    .contacts__card-btn--outline:hover {
        background-color: var(--accent-color);
        color: #fff;
        text-decoration: none;
    }

    .contacts__info-link:hover {
        color: var(--blue-color);
    }

    .contacts__map-btn:hover {
        background-color: #fff;
    }

    .contacts__map:hover {
        box-shadow: 0 8px 24px rgba(0, 114, 237, 0.18);
    }

    .contacts__map:hover .contacts__map-preview {
        transform: scale(1.01);
    }
}

@media (min-width: 768px) {
    .contacts__map {
        flex: 1;
        min-width: 0;
        height: 464px;
    }

    .contacts__head {
        margin-bottom: 44px;
    }

    .contacts__top {
        display: flex;
        gap: 24px;
        margin-bottom: 56px;
    }
    .contacts__info {
        padding-left: 24px;
    }
}

@media (max-width: 1176px) and (min-width: 768px) {
    .contacts__info {
        gap: 40px 24px;
    }
}

@media (max-width: 767px) {
    .contacts__head {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 24px;
        padding: 24px 0;
    }

    .contacts__head-title {
        margin-bottom: 0;
    }

    .contacts__head .header__link-back {
        background-color: rgba(255, 255, 255, 0.6);
    }

    .contacts__title {
        font-size: 28px;
    }

    .contacts__cards {
        margin-bottom: 56px;
    }

    .contacts__map {
        margin-bottom: 56px;
        aspect-ratio: 335 / 148;
    }

    .contacts__info {
        grid-template-columns: 1fr;
    }

    #popup-map {
        background: #fff;
    }

    .contacts__map-modal {
        padding: 0;
        gap: 0;
    }

    .contacts__map-header {
        justify-content: flex-start;
        gap: 8px;
        padding: 18px 32px 18px 16px;
        background-color: #fff;
    }

    .contacts__map-btn {
        width: auto;
        height: auto;
        background: none;
    }

    .contacts__map-btn svg {
        width: 16px;
        height: 16px;
    }

    .contacts__map-caption {
        flex: 1;
        padding: 0;
        border-radius: 0;
        background: none;
        color: var(--subheading-color);
        font-size: 20px;
        text-align: center;
    }

    .contacts__map-btn--close {
        display: none;
    }

    .contacts__map-view {
        border-radius: 0;
        margin-bottom: 0;
    }

}
