/* Maps block – design: 全国の支社一覧 style (accordion + map) */
:root {
    --maps-pink: #E8397C;
    --maps-pink-soft: rgba(232, 57, 124, 0.12);
    --maps-gray-bg: #f5f5f5;
    --maps-gray-border: #e8e8e8;
    --maps-pin-blue: #2563eb;
}

/* ----- Section heading ----- */
.maps-block-heading {
    text-align: center;
    margin: 0 0 28px;
    padding: 0 20px;
}
.maps-block-heading-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}
.maps-block-heading-line {
    display: block;
    width: 56px;
    height: 8px;
    margin: 0 auto;
    background: #FDDB02;
    border-radius: 2px;
}

.maps-block-section {
    padding: 32px 0 56px;
}

.maps-block-container {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 560px;
    align-items: stretch;
}

.maps-block-panel--left {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.maps-block-panel--right {
    position: relative;
    border: 1px solid var(--maps-gray-border);
    border-left: none;
    border-radius: 0 12px 12px 0;
    overflow: hidden;
    background: #eee;
    max-height: 670px;
}

.maps-block-list {
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
    padding: 0px 20px 0px 0px;
    max-height: 670px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.maps-block-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Accordion card */
.maps-block-accordion {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, background 0.2s;
}

.maps-block-accordion:not(.is-open) .maps-block-accordion-header {
    background: var(--maps-gray-bg);
    border-radius: 8px;
    border: 1px solid transparent;
}

.maps-block-accordion.is-open {
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border-left: 3px solid var(--maps-pink);
    border-radius: 8px;
}

.maps-block-accordion.is-open .maps-block-accordion-header {
    background: #fff;
    border-bottom: 1px solid var(--maps-gray-border);
    border-radius: 0;
}

.maps-block-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    text-align: left;
    transition: background 0.15s;
}

.maps-block-accordion-header:hover {
    filter: brightness(0.98);
}

.maps-block-accordion-title {
    flex: 1;
}

.maps-block-accordion-icon {
    font-size: 23px;
    color: #6b7280;
    transition: transform 0.25s ease;
    line-height: 1;
}

.maps-block-accordion.is-open .maps-block-accordion-icon {
    transform: rotate(180deg);
}

.maps-block-accordion-body {
    display: none;
    padding: 0;
    background: #fff;
}

.maps-block-accordion.is-open .maps-block-accordion-body {
    display: block;
}

/* List item row (pin + text + access) */
.maps-block-item {
    padding: 0;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--maps-gray-border);
}

.maps-block-item:last-child {
    border-bottom: none;
}

.maps-block-item:hover {
    background: #fafafa;
}

.maps-block-item.is-active {
    background: var(--maps-pink-soft);
}

.maps-block-item-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 12px;
}

.maps-block-item-pin {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--maps-pin-blue);
}

.maps-block-item-pin svg {
    display: block;
    width: 100%;
    height: 100%;
}

.maps-block-item-main {
    flex: 1;
    min-width: 0;
}

.maps-block-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin: 0 0 6px;
    line-height: 1.35;
}

.maps-block-item-address {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
    margin: 0;
    max-height: 72px;
    overflow-y: auto;
    padding-right: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.maps-block-item-address-line {
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.maps-block-item-address::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.maps-block-item-access {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 2px;
}

/* Nút chỉ đường: bọc SVG ($show_map_svg trong plugin) */
.maps-block-item-directions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    transition: opacity 0.2s, transform 0.15s;
}

.maps-block-item-directions:hover {
    opacity: 0.92;
    transform: scale(1.04);
}

/* Icon chỉ đường: inline SVG ($show_map_svg) */
.maps-block-directions-svg {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.maps-block-directions-svg-graphic {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 32px;
    max-height: 32px;
}

.maps-block-list .maps-block-item-directions .maps-block-directions-svg,
.maps-block-map-wrap .maps-block-item-directions .maps-block-directions-svg,
.maps-block-embed-panel .maps-block-item-directions .maps-block-directions-svg {
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-user-select: none;
    user-select: none;
}

.maps-block-item-access-label {
    font-size: 10px;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

/* Google Maps iframe (thay Leaflet) */
.maps-block-embed-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #eee;
}

.maps-block-embed-detail {
    flex-shrink: 0;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--maps-gray-border);
}

.maps-block-embed-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(52px, max-content);
    align-items: flex-start;
    column-gap: 14px;
}

.maps-block-embed-title {
    margin: 0 0 8px;
    font-size: 15px;
}

.maps-block-embed-meta {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
    margin: 0;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.maps-block-embed-meta::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.maps-block-map-wrap.maps-block-embed-wrap {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 520px;
    max-height: 670px;
    height: min(100%, 670px);
    background: #e5e7eb;
    border-radius: 0 0 12px 0;
    overflow: hidden;
}

.maps-block-embed-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    background: #e5e7eb;
    z-index: 1;
}

.maps-block-embed-placeholder[hidden] {
    display: none;
}

.maps-block-gmap-embed {
    position: relative;
    z-index: 2;
    display: none;
    width: 100%;
    height: 100%;
    min-height: 520px;
    max-height: 670px;
    border: 0;
    border-radius: 0 0 12px 0;
}

.maps-block-gmap-embed.is-loaded {
    display: block;
}

@media (max-width: 992px) {
    .maps-block-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(360px, 50vh);
    }

    .maps-block-panel--left {
        border-radius: 12px 12px 0 0;
        max-height: 420px;
    }

    .maps-block-panel--right {
        border-left: 1px solid var(--maps-gray-border);
        border-radius: 0 0 12px 12px;
    }

    .maps-block-map-wrap.maps-block-embed-wrap {
        border-radius: 0 0 12px 12px;
        min-height: 360px;
        max-height: min(50vh, 670px);
    }

    .maps-block-gmap-embed {
        min-height: 360px;
        max-height: min(50vh, 670px);
        border-radius: 0 0 12px 12px;
    }

    .maps-block-list {
        padding: 0;
    }
}
