@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

:root {
    --dm-purple: #8b2fc9;
    --dm-purple-light: #b168ef;
    --dm-purple-deep: #65209b;
    --dm-ink: #0d0a12;
    --dm-ink-soft: #1a1032;
    --dm-mid: #7a6f88;
    --dm-bg: #f7f4f0;
    --dm-card: rgba(255, 255, 255, 0.86);
    --dm-line: rgba(18, 10, 26, 0.08);
    --dm-radius-lg: 32px;
    --dm-radius-md: 20px;
    --dm-shadow-lg: 0 28px 60px rgba(22, 15, 32, 0.12);
    --dm-shadow-md: 0 16px 34px rgba(22, 15, 32, 0.08);
}

.dm-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 100%;
    color: var(--dm-ink);
    background:
        radial-gradient(circle at top center, rgba(139, 47, 201, 0.11) 0%, transparent 28%),
        linear-gradient(180deg, #fbf9f6 0%, var(--dm-bg) 100%);
    padding: 24px 0 8px;
}

.dm-wrap,
.dm-wrap * {
    box-sizing: border-box;
}

.dm-wrap h1,
.dm-wrap h2,
.dm-wrap h3,
.dm-wrap p,
.dm-wrap section,
.dm-wrap .dm-page-intro,
.dm-wrap .dm-section,
.dm-wrap .dm-section-shell,
.dm-wrap .dm-section-header,
.dm-wrap .dm-section-heading,
.dm-wrap .dm-section-copy,
.dm-wrap .dm-section-meta,
.dm-wrap .dm-eyebrow,
.dm-wrap .dm-region-picker {
    margin-top: 0;
}

.dm-page-intro {
    max-width: 1080px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 24px;
    position: relative;
}

.dm-page-intro::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(139, 47, 201, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.dm-page-intro,
.dm-page-intro * {
    box-sizing: border-box;
}

.dm-alt-bg {
    background: linear-gradient(180deg, #f0ebf5 0%, var(--dm-bg, #f7f4f0) 100%);
    padding: 60px 24px;
    border-radius: 20px;
    margin-bottom: 40px;
}

.dm-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dm-eyebrow::before,
.dm-eyebrow::after {
    content: '';
    display: block;
    width: 36px;
    height: 1px;
    background: var(--dm-purple);
}

.dm-eyebrow span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--dm-purple);
}

.dm-page-title,
.dm-section__title,
.dm-result__title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    color: var(--dm-ink);
    line-height: 1.1;
    margin: 0 0 18px;
    text-align: center;
}

.dm-page-title {
    font-size: clamp(32px, 4.5vw, 56px);
}

.dm-section__title {
    font-size: clamp(28px, 3.5vw, 42px);
}

.dm-page-title em,
.dm-section__title em,
.dm-result__title em {
    color: var(--dm-purple);
    font-style: italic;
}

.dm-page-subtitle,
.dm-section__subtitle {
    font-size: 16px;
    color: var(--dm-mid);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
    text-align: center;
}

.dm-section {
    margin: 0 auto 18px;
    padding: 0 24px;
}

.dm-section-shell {
    max-width: 1220px;
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.68) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    border-radius: var(--dm-radius-lg);
    padding: 24px 28px 26px;
    box-shadow: 0 28px 62px rgba(21, 13, 31, 0.1), inset 0 1px 0 rgba(255,255,255,0.62);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.dm-section-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(139, 47, 201, 0.1) 0%, transparent 24%),
        radial-gradient(circle at bottom right, rgba(177, 104, 239, 0.08) 0%, transparent 26%);
    pointer-events: none;
}

.dm-section-header,
.dm-map-stage,
.dm-result {
    position: relative;
    z-index: 1;
}

.dm-section-header {
    margin-bottom: 16px;
}

.dm-section-header .dm-eyebrow {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.dm-section-header .dm-eyebrow::after {
    display: none;
}

.dm-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(18, 10, 26, 0.08);
}

.dm-section-copy {
    max-width: 760px;
}

.dm-section__title {
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
    margin: 0 0 8px;
}

.dm-section__subtitle {
    margin: 0;
    max-width: 760px;
}

.dm-section-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dm-section-pill,
.dm-map-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.dm-wrap .dm-section-pill {
    background: linear-gradient(135deg, var(--dm-purple), var(--dm-purple-light)) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(139, 47, 201, 0.22);
}

.dm-wrap .dm-section-pill--soft {
    background: rgba(139, 47, 201, 0.08) !important;
    color: var(--dm-purple) !important;
    border: 1px solid rgba(139, 47, 201, 0.12);
    box-shadow: none;
}

.dm-map-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(247, 242, 250, 0.92) 100%) !important;
    border-radius: 28px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(139, 47, 201, 0.08);
    box-shadow: 0 18px 38px rgba(21, 13, 31, 0.08);
}

.dm-region-picker {
    display: grid;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.dm-region-picker--compact {
    min-width: min(100%, 280px);
}

.dm-region-picker__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dm-purple);
}

.dm-region-select {
    width: 100%;
    max-width: 420px;
    appearance: none;
    border: 1px solid rgba(139, 47, 201, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,245,252,0.98) 100%);
    color: var(--dm-ink);
    padding: 14px 48px 14px 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(18, 10, 26, 0.06);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--dm-purple) 50%),
        linear-gradient(135deg, var(--dm-purple) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.dm-region-picker--compact .dm-region-picker__label {
    margin-bottom: 0;
}

.dm-region-picker--compact .dm-region-select {
    max-width: 280px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 14px;
}

.dm-region-select:focus {
    outline: none;
    border-color: rgba(139, 47, 201, 0.34);
    box-shadow: 0 0 0 4px rgba(139, 47, 201, 0.1);
}

.dm-map-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(139, 47, 201, 0.08) 0%, transparent 24%),
        radial-gradient(circle at bottom right, rgba(177, 104, 239, 0.06) 0%, transparent 26%);
    pointer-events: none;
}

.dm-map-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px 4px 2px;
    position: relative;
    z-index: 1;
}

.dm-wrap .dm-map-chip {
    background: rgba(139, 47, 201, 0.06) !important;
    color: #7b7190 !important;
    border: 1px solid rgba(139, 47, 201, 0.08);
}

.dm-wrap .dm-map-chip--active {
    background: rgba(139, 47, 201, 0.12) !important;
    color: var(--dm-purple) !important;
    border-color: rgba(139, 47, 201, 0.12);
    box-shadow: none;
}

.dm-map-container {
    position: relative;
    background:
        radial-gradient(circle at top center, rgba(139, 47, 201, 0.1) 0%, transparent 30%),
        linear-gradient(180deg, rgba(250, 246, 255, 0.96) 0%, rgba(244, 238, 248, 0.98) 100%);
    border-radius: 22px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    min-height: 340px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.dm-map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 47, 201, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 47, 201, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
    pointer-events: none;
}

.dm-map {
    position: relative;
    z-index: 1;
    min-height: 320px;
}

.dm-map-status {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--dm-mid);
    font-size: .98rem;
    position: relative;
    z-index: 1;
}

.dm-map-status--error {
    color: #b91c1c;
}

.dm-svg {
    width: 100%;
    height: auto;
    display: block;
}

.dm-svg .dm-region,
.dm-svg .dm-region path,
.dm-svg .dm-region polygon,
.dm-svg .dm-region rect {
    fill: #d8ddea !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
    stroke-width: 0.95;
    transition: fill .24s ease, filter .24s ease, transform .24s ease;
    cursor: default;
}

.dm-svg .dm-region.dm-active,
.dm-svg .dm-region.dm-active path,
.dm-svg .dm-region.dm-active polygon,
.dm-svg .dm-region.dm-active rect {
    fill: var(--dm-purple) !important;
    cursor: pointer;
}

.dm-svg .dm-region.dm-active:hover,
.dm-svg .dm-region.dm-hovered,
.dm-svg .dm-region.dm-active:hover path,
.dm-svg .dm-region.dm-hovered path,
.dm-svg .dm-region.dm-active:hover polygon,
.dm-svg .dm-region.dm-hovered polygon,
.dm-svg .dm-region.dm-active:hover rect,
.dm-svg .dm-region.dm-hovered rect {
    fill: var(--dm-purple-light) !important;
    stroke: rgba(255, 255, 255, 1) !important;
    stroke-width: 1.3;
    filter: drop-shadow(0 12px 20px rgba(139, 47, 201, 0.34)) brightness(1.03);
}

.dm-svg .dm-region.dm-selected,
.dm-svg .dm-region.dm-selected path,
.dm-svg .dm-region.dm-selected polygon,
.dm-svg .dm-region.dm-selected rect {
    fill: #f59e0b !important;
    stroke: rgba(255, 255, 255, 1) !important;
    stroke-width: 1.6;
    filter: drop-shadow(0 14px 24px rgba(245, 158, 11, 0.34));
}

.dm-svg .dm-region:focus,
.dm-svg .dm-region:focus-visible {
    outline: none;
}

.dm-label-layer {
    pointer-events: none;
}

.dm-province-label {
    pointer-events: none;
    user-select: none;
}

.dm-province-label text {
    fill: rgba(18, 18, 24, 0.92);
    stroke: rgba(255, 255, 255, 0.88);
    stroke-width: 2.2px;
    paint-order: stroke;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    letter-spacing: -0.015em;
    transition: fill .2s ease, stroke .2s ease, transform .2s ease, opacity .2s ease;
}

.dm-province-label text {
    transition: fill .2s ease, stroke .2s ease, transform .2s ease, opacity .2s ease;
}

.dm-province-label.dm-active text {
    fill: #fff;
    stroke: rgba(93, 35, 150, 0.34);
}

.dm-province-label.dm-hovered text {
    transform: scale(1.04);
}

.dm-province-label.dm-selected text {
    fill: #fff;
    stroke: rgba(122, 74, 7, 0.5);
    stroke-width: 2.2px;
}

.dm-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 11px 18px;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(139, 47, 201, 0.08);
    color: var(--dm-mid) !important;
    font-size: .9rem;
    font-style: normal;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

.dm-result {
    margin-top: 22px;
    animation: dmFadeIn .38s ease;
}

@keyframes dmFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dm-result__header {
    background: linear-gradient(135deg, #1a1032 0%, #2d1b4e 100%);
    color: #fff;
    padding: 22px 24px;
    border-radius: 24px 24px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 22px 44px rgba(26, 16, 50, 0.16);
}

.dm-result__intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dm-result__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.52);
}

.dm-result__title {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    color: #fff;
}

.dm-result__header .dm-close {
    margin-left: auto;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    color: #fff;
    border-radius: 999px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}

.dm-result__header .dm-close:hover {
    background: rgba(255,255,255,.16);
    transform: translateY(-1px);
}

.dm-result__body {
    border: 1px solid rgba(26, 16, 50, 0.08);
    border-top: none;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.dm-result__empty {
    padding: 28px 24px;
    text-align: center;
    color: var(--dm-mid);
    background: rgba(255, 255, 255, 0.68);
    font-size: .95rem;
}

.dm-dealer {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
    grid-template-areas:
        "name name"
        "contact phone"
        "address phone";
    gap: 10px 28px;
    padding: 24px 26px;
    border-bottom: 1px solid rgba(26, 16, 50, 0.06);
    background: rgba(255, 255, 255, 0.82);
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.dm-dealer:last-child {
    border-bottom: none;
}

.dm-dealer:hover {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: inset 0 0 0 1px rgba(139, 47, 201, 0.06);
}

.dm-dealer__name {
    grid-area: name;
    font-size: clamp(1.02rem, 2vw, 1.18rem);
    font-weight: 700;
    color: #1d1830;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dm-dealer__name::before {
    content: '';
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 999px;
    background: var(--dm-purple);
    box-shadow: 0 0 0 6px rgba(139, 47, 201, .14);
}

.dm-dealer__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .96rem;
    color: #4f4a61;
    line-height: 1.65;
    min-width: 0;
}

.dm-dealer__row--contact {
    grid-area: contact;
}

.dm-dealer__row--phone {
    grid-area: phone;
    justify-self: end;
    justify-content: flex-end;
    text-align: right;
    align-items: center;
    align-self: start;
    background: rgba(139, 47, 201, 0.05);
    border: 1px solid rgba(139, 47, 201, 0.08);
    border-radius: 16px;
    padding: 12px 16px;
}

.dm-dealer__row.full {
    grid-area: address;
    align-self: start;
}

.dm-dealer__label {
    font-weight: 700;
    color: #9e94af;
    white-space: nowrap;
    min-width: 68px;
}

.dm-dealer__val {
    min-width: 0;
}

.dm-dealer__val a {
    color: #4a6ff3;
    text-decoration: none;
    font-weight: 600;
}

.dm-dealer__val a:hover {
    text-decoration: underline;
}

.dm-loading {
    text-align: center;
    padding: 34px;
    color: var(--dm-mid);
    font-size: .96rem;
}

.dm-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(139, 47, 201, 0.14);
    border-top-color: var(--dm-purple);
    border-radius: 50%;
    animation: dmSpin .7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes dmSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .dm-section {
        padding: 0 16px;
    }

    .dm-section-shell {
        padding: 20px 22px 22px;
    }

    .dm-section-heading {
        flex-direction: column;
    }

    .dm-section-header .dm-eyebrow {
        justify-content: flex-start;
    }

    .dm-section-meta {
        justify-content: flex-start;
    }

    .dm-region-picker--compact {
        width: 100%;
        min-width: 0;
    }

    .dm-region-picker--compact .dm-region-select {
        max-width: none;
    }

    .dm-dealer {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "contact"
            "phone"
            "address";
    }

    .dm-dealer__row--phone {
        justify-self: start;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 700px) {
    .dm-wrap {
        padding-top: 18px;
        padding-bottom: 4px;
    }

    .dm-page-intro {
        margin-bottom: 14px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .dm-section {
        margin-bottom: 14px;
        padding-left: 0;
        padding-right: 0;
    }

    .dm-section-shell {
        padding: 14px 0 10px;
        border-radius: 18px;
    }

    .dm-page-title {
        font-size: clamp(30px, 8vw, 42px);
    }

    .dm-section-header,
    .dm-result {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dm-section-header {
        margin-bottom: 12px;
    }

    .dm-page-subtitle {
        margin: 0;
    }

    .dm-eyebrow {
        justify-content: center;
    }

    .dm-section__title {
        font-size: clamp(26px, 8vw, 34px);
    }

    .dm-section-heading {
        gap: 14px;
        padding-bottom: 12px;
    }

    .dm-map-stage {
        margin-left: 0;
        margin-right: 0;
        padding: 10px 0 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
        background: transparent !important;
    }

    .dm-region-select {
        max-width: none;
        font-size: 16px;
    }

    .dm-map-container {
        padding: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
        min-height: 240px;
    }

    .dm-map,
    .dm-map-status {
        min-height: 380px;
    }

    .dm-map-wrap-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .dm-map-wrap-mobile .dm-svg {
        min-width: 900px;
        display: block;
        margin: 0 auto;
    }

    .dm-mobile-scroll-hint {
        display: inline-flex !important;
        margin-left: 10px;
        animation: hintPulse 2s infinite;
    }

    @keyframes hintPulse {
        0% { transform: translateX(0); opacity: 0.8; }
        50% { transform: translateX(4px); opacity: 1; }
        100% { transform: translateX(0); opacity: 0.8; }
    }

    .dm-result__header {
        padding: 18px;
        border-radius: 20px 20px 0 0;
    }

    .dm-result__body {
        border-radius: 0 0 20px 20px;
    }

    .dm-result__title {
        font-size: 1.9rem;
    }

    .dm-dealer {
        padding: 18px;
        gap: 8px;
    }

    .dm-dealer__row {
        font-size: .88rem;
    }

    .dm-dealer__row--phone {
        width: 100%;
    }

    .dm-map-topbar {
        padding: 0 16px 12px;
    }

    .dm-hint {
        width: 100%;
        text-align: center;
        padding-left: 16px;
        padding-right: 16px;
    }
}
