/* 나라 검색 — /country */

/* mg_guide.css 전역 .country-list / .country-item 충돌 방지 */
.country-page .country-list {
    display: block;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    gap: 0;
    grid-template-columns: none;
}

.country-page .country-item {
    display: block;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: default;
    justify-content: unset;
    align-items: unset;
    gap: unset;
}

.country-page .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.country-region-tabs {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

@media (min-width: 768px) {
    .country-region-tabs {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 36rem;
    }
}

.country-region-tab {
    flex: 0 0 auto;
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #475569;
    background: transparent;
    border: none;
    border-bottom: 1px solid #fff;
    cursor: pointer;
    word-break: keep-all;
    transition: background-color 0.15s, color 0.15s;
}

.dark .country-region-tab {
    color: #cbd5e1;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

@media (max-width: 767px) {
    .country-region-tab {
        width: auto;
        min-width: 7rem;
        border-bottom: none;
        border-right: 1px solid #e2e8f0;
        white-space: nowrap;
    }

    .dark .country-region-tab {
        border-right-color: #334155;
    }
}

.country-region-tab[aria-selected="true"] {
    font-weight: 700;
    color: #0f172a;
    background: #fff;
    border-bottom-color: #e2e8f0;
}

.dark .country-region-tab[aria-selected="true"] {
    color: #f8fafc;
    background: #0f172a;
    border-bottom-color: #334155;
}

.country-panel {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    max-height: 28rem;
}

@media (min-width: 768px) {
    .country-panel {
        max-height: 36rem;
        padding: 1.25rem 1.5rem;
    }
}

.country-item {
    border-bottom: 1px solid #eff2f3;
}

.dark .country-item {
    border-bottom-color: #334155;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.95rem 0;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
}

.country-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #454545;
    white-space: normal;
    word-break: keep-all;
}

.dark .country-item-name {
    color: #e2e8f0;
}

.country-item-toggle {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s;
}

.country-item.is-open .country-item-toggle {
    transform: rotate(180deg);
}

.country-cities {
    display: none;
    padding: 0 0 1rem;
}

.country-item.is-open .country-cities {
    display: block;
}

.country-city-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}

@media (min-width: 640px) {
    .country-city-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .country-city-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.country-city-link {
    display: block;
    padding: 0.5rem 0.25rem;
    font-size: 0.9375rem;
    color: #334155;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: color 0.15s, background-color 0.15s;
}

.country-city-link:hover {
    color: #007ACC;
    background: rgba(0, 122, 204, 0.06);
}

.dark .country-city-link {
    color: #cbd5e1;
}

.dark .country-city-link:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

#countrySearchList li button,
#countrySearchList li a {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    color: inherit;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

#countrySearchList li button:hover,
#countrySearchList li a:hover {
    background: #f8fafc;
}

.dark #countrySearchList li button:hover,
.dark #countrySearchList li a:hover {
    background: #1e293b;
}

.country-search-item-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
