/* Base styles */
html {
    font-size: 16px;
    font-family: sans-serif;
    line-height: 1.5;
    color: #000;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
}
*,
*::before,
*::after {
    box-sizing: inherit;
}
/* Main container layout */
.map-container {
    display: flex;
    height: 560px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    max-width: 1920px;
    width: 100%;
    border-top: 2px solid #302C2C;
}
/* Map tab buttons */
.map-tab-buttons {
    display: none;
    justify-content: center;
    margin-bottom: 16px;
    gap: 20px;
}
.map-tab-button {
    background: #fff;
    color: #302C2C;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid #302C2C;
    cursor: pointer;
    padding: 8px 20px;
    width: 150px;
    font-size: 16px;
    border-radius: 80px;
    transition: all 0.3s ease;
}
.map-tab-button.active {
    background: #302C2C;
    color: #fff;
}

/* Sidebar with address list */
.sidebar {
    width: 400px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 5;
    position: absolute;
    top: 0;
    left: clamp(0px, 15vw, 240px);
    height: 100%;
}
/* Address list */
.address-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}
.address-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.address-item:hover {
    background-color: #F3F3F3;
}
.address-item.active {
    background-color: #F3F3F3;
}
.address-item .header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.address-item .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-right: 8px;
    min-width: 45px;
    text-align: center;
}
.badge.gym {
    background-color: #ef4444;
}
.badge.pool {
    background-color: #3b82f6;
}
.badge.school {
    background-color: #10b981;
}
.addressStreet {
    font-size: clamp( 20px, 2vw, 24px);
    color: #161414;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 4px;
    line-height: 1;
}
.addressDistrict {
    font-size: 16px;
    color: #161414;
}
.popup-content .addressDistrict {
    font-size: clamp(16px, 1.6vw, 18px);
}
.trainer-name {
    font-size: clamp(16px, 1.6vw, 18px);
}
.addressSchedule p {
    font-size: clamp(16px, 1.6vw, 18px);
    color: #161414;
    font-weight: 400;
    margin-bottom: 8px;
    line-height: 1;
}
.addressSchedule p:last-child {
    margin-bottom: 0;
}
/* Map container */
.map-block {
    width: 100%;
    position: relative;
    background: #f9fafb;
}
.map {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}
/* Address popup */
.address-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-10%, -50%);
    width: calc(100% - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 5;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    border: 1px solid #f3f4f6;
    display: flex;
    max-width: 720px;
    box-shadow: 0px 0px 16px 0px rgba(22, 20, 20, 0.2);
}
.popup-content {
    width: 50%;
}
.popup-image {
    width: 50%;
    line-height: 0;
    position: relative;
    overflow: hidden;
}
.popup-image-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}
.popup-image-container img {
    object-fit: cover;
    max-width: none;
    width: 100%;
    height: 100%;
}
.address-popup:not(.hidden) {
    opacity: 1;
}
.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}
.close-btn img {
    z-index: 1;
}
.close-btn:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 20px;
    height: 20px;
    background: rgba(22, 20, 20, 1);
    filter: blur(13px);
}
.popup-content {
    padding: 20px;
}
.popup-section {
    display: flex;
    flex-direction: column;
}
.address-header {
    display: flex;
    align-items: center;
    gap: 4px 20px;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.popupName {
    font-weight: 700;
    color: #FCFCFC;
    line-height: 1;
    padding: 4px 8px;
    background-color: #161414;
    border-radius: 8px;
    white-space: nowrap;
}
.subwayStation {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #161414;
    font-weight: 400;
    font-size: clamp(14px, 1.6vw, 16px);
    line-height: 1.2;
}
/* Custom scrollbar */
.address-list::-webkit-scrollbar {
    width: 6px;
}
.address-list::-webkit-scrollbar-track {
    background: #f9fafb;
}
.address-list::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}
.address-list::-webkit-scrollbar-thumb:hover {
    background: #1f2937;
}
/* Custom marker styles for Yandex Maps API v3 */
.custom-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    /* Set the transform origin to bottom center for proper anchoring */
    transform-origin: bottom center;
    /* Position the marker so the pin point is at the coordinate */
    transform: translate(-50%, -100%);
}
.marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Ensure the pin is properly centered */
    margin-bottom: 2px;
}
.marker-content {
    transform: rotate(45deg);
    background-color: white;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.marker-title {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    margin-top: 5px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.banner-type-1 {
    background-color: #302C2C;
    padding: 24px;
}
.banner-type-1 .banner-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1010px;
    margin: 0 auto;
    gap: clamp(16px, 4vw, 64px);
}
.banner-content_title {
    color: #FCFCFC;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    margin-bottom: 8px;
}
.banner-content_text {
    color: #FCFCFC;
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 18px);
}
.cta-button-type-2 {
    background: #F5C643;
    color: #161414;
    padding: 12px clamp(24px, 32px, 3vw);
    border: none;
    border-radius: 12px;
    font-size: clamp(18px, 2vw, 20px);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
}
.additional-address-popup {
    display: none;
}

@media (max-width: 1550px) {
    .sidebar {
        left: 0;
        width: clamp(340px, 28vw, 400px);
    }
    .address-popup {
        transform: translate(-35%, -50%)
    }
}
@media (max-width: 1350px) {
    .address-popup {
        transform: translate(-45%, -50%)
    }
}
@media (max-width: 1250px) {
    .address-popup {
        right: 40px;
        left: auto;
        transform: translateX(0) translateY(-50%);
        max-width: 608px;
    }
}
@media (max-width: 1000px) {
    .map-tab-buttons {
        display: flex;
    }
    .map-container {
        flex-direction: column;
        height: auto;
        border-top: none;
    }
    .map-block {
        display: none;
        height: 560px;
    }
    .sidebar {
        position: static;
        height: auto;
        width: 100%;
        box-shadow: none;
    }
    .additional-address-popup:not(.hidden) {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        display: block;
    }
    .additional-address-popup-container{
        top: 50%;
        left: 50%;
        transform: translate(-10%, -50%);
        width: calc(100% - 40px);
        background: #ffffff;
        border-radius: 16px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        z-index: 5;
        overflow: hidden;
        opacity: 1;
        transition: all 0.2s ease;
        display: flex;
        max-width: 720px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 40px);
        z-index: 102;
    }
    .additional-address-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 101;
    }
}
@media (max-width: 600px) {
    .address-popup {
        flex-direction: column;
        width: 320px;
        right: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
    }
    .popup-content {
        width: 100%;
    }
    .popup-image {
        display: none;
    }
    .address-popup .address-header {
        padding-right: 20px;
    }
    .address-popup .close-btn {
        top: 8px;
        right: 8px;
    }
    .additional-address-popup-container {
        flex-direction: column-reverse;
        width: 320px;
    }
    .additional-address-popup-container .popup-image {
        display: block;
        width: 100%;
        aspect-ratio: 1.5 / 1;
    }
    .banner-type-1 .banner-container {
        flex-direction: column;
    }
}
