/* ==========================================================================
   Ukraine Map page
   ========================================================================== */

.ukraine-map-page {
    padding-block: var(--i1);
}

.ukraine-map-page__title {
    font-size: var(--h2);
    font-weight: 700;
    color: var(--decorative);
    margin-block-end: var(--i2);
}

/* --- Map wrap --- */
.ukraine-map-wrap {
    width: 100%;
}

/* --- SVG --- */
.ukraine-map__svg-wrap {
    width: 100%;
}

.ukraine-map__svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- SVG paths (регіони) --- */
.ukraine-map__svg-wrap svg path {
    cursor: pointer;
    transition: fill-opacity 0.4s ease;
}


/* Текстові path (назви регіонів) — не інтерактивні */
.ukraine-map__svg-wrap svg path[fill="#A28E8E"],
.ukraine-map__svg-wrap svg path[fill="#a28e8e"] {
    pointer-events: none;
    cursor: default;
}

/* --- Flags --- */
.ukraine-map__svg-wrap {
    position: relative;
}

.ukraine-map__flag {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    z-index: 10;
}

.ukraine-map__flag img {
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
    transition: transform 0.2s ease;
}

.ukraine-map__flag:hover img {
    transform: scale(1.2);
}

.ukraine-map__flag-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #fff;
    color: #7A6060;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    padding: 12px 24px;
    border-radius: 12px;
    border: 2px solid #522B2B;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ukraine-map__flag:hover .ukraine-map__flag-tooltip,
.ukraine-map__flag.is-hovered .ukraine-map__flag-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Hint --- */
.ukraine-map__hint {
    margin-block-start: var(--i3);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--i3);
}

.ukraine-map__hint p {
    font-size: var(--small);
    color: var(--gray-text);
    line-height: 1.5;
    margin: 0;
}

.ukraine-map__hint-inner {
    display: inline-flex;
    flex-direction: column;
}

.ukraine-map__hint-inner img {
    width: 50%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Map Modal Popup
   ========================================================================== */

.map-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.map-popup.is-open {
    display: flex;
}

.map-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.map-popup__dialog {
    position: relative;
    z-index: 1;
    background: #F7F7EE;
    border-radius: 16px;
    width: 80vw;
    height: 75vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.map-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F7F7EE;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #522B2B;
    z-index: 2;
    padding: 0 !important;
    min-width: 0 !important;
    transition: background 0.2s;
}

.map-popup__close:hover {
    background: #ece9df;
    opacity: 1 !important;
}

.map-popup__close svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

.map-popup__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.map-popup__left {
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    overflow-y: auto;
    background: #F7F7EE;
    box-sizing: border-box;
}

.map-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
}

.map-popup__search-wrap {
    margin-bottom: 16px;
}
.map-popup__search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    outline: none;
}
.map-popup__search:focus {
    border-color: var(--btn-bg, #522B2B);
}
.map-popup__no-results {
    font-size: 14px;
    color: #999;
    margin: 8px 0 0;
}
.map-popup__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-popup__right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #F7F7EE;
    overflow: hidden;
    min-height: 0;
}

/* Region SVG — width/height via CSS, no attributes */
.map-popup__region-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-popup__region-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Flag pin hover highlight */
[data-pin] {
    transition: transform 0.2s ease;
}

[data-pin].pin-active {
    transform: scale(1.1);
}

/* Shared item styles */
.map-popup__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: #fff;
    box-shadow: 0px 1px 2px 0px #0000000D;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.map-popup__item:hover {
    box-shadow: 0px 4px 12px 0px #0000001A;
}

.map-popup__item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #F0EDE8;
}

.map-popup__item-img--empty {
    background: #F0EDE8;
}

.map-popup__item-info {
    flex: 1;
    min-width: 0;
}

.map-popup__item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.map-popup__item-region {
    font-size: 12px;
    color: #9B8888;
    margin-top: 2px;
}

.map-popup__item-arrow {
    flex-shrink: 0;
    color: #9B8888;
    font-size: 20px;
    line-height: 1;
    font-style: normal;
}

.map-popup__empty {
    font-size: 14px;
    color: #9B8888;
}
