/* 分店網絡 — 左圖右列表 */

.addr-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #fff 0%, var(--tcm-cream) 100%);
}

.sub-title {
    margin-top: 10px;
}

.addr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(526px, 38vw);
    min-height: calc(100vh - 80px);
    /* border-top: 1px solid var(--tcm-border); */
}

/* ── 左側地圖 ── */
.addr-layout-map {
    position: sticky;
    top: 80px;
    align-self: start;
    padding: 24px 24px 32px;
    background: #fff;
}

.addr-map-stage {
    position: relative;
    width: 100%;
    line-height: 0;
}

.addr-map-base {
    width: 100%;
    height: auto;
    display: block;
}

.addr-map-hotspots {
    position: absolute;
    inset: 0;
}

.addr-marker {
    position: absolute;
    border-radius: 16px;
    left: var(--x);
    top: var(--y);
    width: var(--w);
    transform: translate(-50%, -50%);
    z-index: 2;
    /* 無圖片、pin 無文字時仍保留可點擊高度 */
    aspect-ratio: 1 / 1;
    transition: all 0.25s ease;
    /* background-color: rgba(0, 0, 255, 0.411); */

    .addr-line {
        position: absolute;
        object-fit: cover;
        object-position: center;
        background-color: transparent;
        opacity: 1;
        z-index: 1;

        &.addr-line-1 {
            left: -46%;
            top: 43%;
            width: 104%;
            height: 140%;
            object-fit: contain;
            object-position: center;
            z-index: 1;
        }
    }

    &::hover {
        .addr-marker-img {
            transform: scale(1.05);
            filter: drop-shadow(0 4px 12px rgba(179, 32, 44, 0.35));
        }
    }
}

/* 有標記圖時由圖片撐高，不強制比例 */
.addr-marker:has(> .addr-marker-img) {
    aspect-ratio: auto;
}

.addr-marker-1 {
    margin-top: -1%;
    aspect-ratio: 1 / 1.2;

    .addr-marker-hits {
        height: 88%;
        top: 12%;
    }
}

.addr-marker-2 {
    .addr-marker-hits {
        height: 56%;
        top: 18%;
    }
}

.addr-marker-3 {
    .addr-marker-hits {
        height: 69%;
        top: 22%;
    }
}

.addr-marker-4 {
    .addr-marker-hits {
        height: 69%;
        top: 2%;
    }
}

.addr-marker-5 {
    .addr-marker-hits {
        height: 100%;
        top: 0;
    }
}

.addr-marker-6 {
    .addr-marker-hits {
        height: 59%;
        top: 20%;
    }
}

.addr-marker-7 {
    .addr-marker-hits {
        height: 50%;
        top: 20%;
    }
}

.addr-marker-8 {
    aspect-ratio: 1 / 1.2;

    .addr-marker-hits {
        height: 72%;
        top: 15%;
    }
}

.addr-marker-9 {
    .addr-marker-hits {
        height: 45%;
        top: 18%;
    }
}

.addr-marker-10 {
    .addr-marker-hits {
        height: 63%;
        top: 0;
    } 
}

.addr-marker-11{
    .addr-marker-hits {
        height: 78%;
        top: 0;
    } 
}

.addr-marker-12 {
    aspect-ratio: 1 / 0.7;
    .addr-marker-hits {
        height: 76%;
        top: 20%;
    }
}

.addr-marker-13 {
    .addr-marker-hits {
        height: 76%;
        top: 0;
    }
}

.addr-marker-img {
    width: 100%;
    height: auto;
    /* margin-left: 9%; */
    display: block;
    pointer-events: none;
    user-select: none;
    transition: transform 0.25s ease, filter 0.25s ease, opacity 0.3s ease;
    position: relative;
    z-index: 2;
    opacity: 0;
}

.addr-marker-img.is-loaded {
    opacity: 1;
}

.addr-marker-hits {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.addr-pin {
    flex: 1;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    line-height: 1.2;

    /* &:nth-child(odd) {
        background-color: rgba(179, 32, 44, 0.35);
    }

    &:nth-child(even) {
        background-color: rgba(32, 113, 179, 0.349);
    } */
}

.addr-marker:has(.addr-pin.is-active) .addr-marker-img,
.addr-marker:has(.addr-pin:hover) .addr-marker-img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(179, 32, 44, 0.35));
}

.addr-map-tip {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(44, 36, 22, 0.5);
    font-family: var(--family-font-secondary);
}

/* ── 右側列表 ── */
.addr-list-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tcm-border);
    background: var(--tcm-cream);
    max-height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
    padding-bottom: 20px;
}

.addr-list-head {
    padding: 12px;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.addr-list-head span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.addr-list-head span svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.addr-list-title {
    font-size: 25px;
    font-weight: 500;
    color: var(--tcm-ink);
    font-family: var(--family-font);
}

.addr-list-search {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--tcm-border);
    background: #fff;
    font-size: 14px;
    font-family: var(--family-font-secondary);
    color: rgba(44, 36, 22, 0.9);
    outline: none;
    transition: border-color 0.25s ease;
}

.addr-list-search:focus {
    border-color: rgba(179, 32, 44, 0.45);
}

.addr-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 24px;

}

.addr-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.addr-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(179, 32, 44, 0.3);
    border-radius: 2px;
}

.addr-region.is-hidden {
    display: none;
}

.addr-region-title {
    margin: 8px 0 10px;
    padding-left: 4px;
    font-size: 15px;
    letter-spacing: 0.12em;
    color: rgba(44, 36, 22, 0.75);
    font-family: var(--family-font-secondary);
    font-weight: 500;
}

.addr-item {
    margin-bottom: 8px;
    border: 1px solid var(--tcm-border);
    background: #fff;
    box-shadow: var(--tcm-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.addr-item.is-hidden {
    display: none;
}

.addr-item.is-open {
    border-color: rgba(179, 32, 44, 0.35);
    /* box-shadow: 0 8px 24px rgba(179, 32, 44, 0.08); */

    .addr-item-name {
        color: var(--primary-color);
    }
}

.addr-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--family-font-secondary);
    transition: color 0.25s ease, background 0.25s ease;
}

.addr-item-head:hover {
    background: rgba(179, 32, 44, 0.03);
}

.addr-item.is-open .addr-item-head {
    color: var(--primary-color);
    border-bottom: 1px solid var(--tcm-border);
}

.addr-item-name {
    font-size: 17px;
    font-weight: 500;
    color: #000000;
}

.addr-item-toggle {
    width: 8px;
    height: 8px;
    border-right: 1px solid rgba(44, 36, 22, 0.45);
    border-bottom: 1px solid rgba(44, 36, 22, 0.45);
    transform: rotate(45deg);
    transition: transform 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
    margin-top: -4px;
}

.addr-item.is-open .addr-item-toggle {
    transform: rotate(-135deg);
    margin-top: 4px;
    border-color: var(--primary-color);
}

.addr-item-body {
    padding: 20px 18px 18px;
}

.addr-item-media {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    .addr-item-block {
        flex: 1;
    }
}

.addr-item-block {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #f5f5f5;
    border: 1px solid var(--tcm-border);
    /* overflow: hidden; */
}

.addr-item-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.addr-item-block .addr-item-img[hidden],
.addr-item-block .addr-item-video[hidden] {
    display: none !important;
}

.addr-media-label {
    position: absolute;
    top: -13px;
    left: 8px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--primary-color);
    clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
}

.addr-item-block iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.addr-item-body ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.addr-item-body ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.addr-meta-icon {
    width: 20px;
    height: 20px;
    /* border-radius: 50%; */
    /* background: var(--primary-color); */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 5px;
}

.addr-meta-icon svg {
    width: 20px;
    height: 20px;
}

.addr-meta-icon svg path {
    fill: var(--primary-color);
}

.addr-meta-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2px;
}

.addr-meta-label {
    font-size: 15px;
    color: rgba(44, 36, 22, 0.5);
    font-family: var(--family-font-secondary);
}

.addr-meta-value {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(44, 36, 22, 0.9);
    font-family: var(--family-font-secondary);
}

.addr-meta-value--link {
    font-size: 17px;
    font-weight: 500;
    color: var(--primary-color);
}

.addr-meta-note {
    font-size: 12px;
    line-height: 12px;
    color: rgba(44, 36, 22, 0.45);
}

.addr-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.addr-item-actions .primary-btn,
.addr-item-actions .secondary-btn {
    width: auto;
    min-width: 150px;
    padding: 8px 0;
}

.addr-list-empty {
    padding: 40px 10px;
    text-align: center;
    font-size: 14px;
    color: rgba(44, 36, 22, 0.5);
}

.map-txt {
    width: 100%;
    text-align: center;
    color: #000000;
    font-weight: 800;
    text-shadow: -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff,
        2px 2px 0 #fff, 0 -2px 0 #fff,
        0 2px 0 #fff,
        -2px 0 0 #fff,
        2px 0 0 #fff,
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;

    /* background-color: rgba(255, 0, 0, 0.5);
    border: 1px solid blue; */

    &.addr-map-title {
        width: 120%;
        color: #7c7d7b;
        font-size: 18px;
        position: absolute;
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;
        margin-left: 10%;
    }

    /* &:hover {
        background: linear-gradient(to bottom, rgba(179, 32, 44, 0.1), rgba(179, 32, 44, 0.3));
    } */
}

.addr-marker-1 {
    .map-txt {
        &.addr-map-title {
            top: -16px;
        }
    }
}

/* ── 響應式 ── */
@media (max-width: 1688px) {
    .addr-marker-1 {
        .map-txt {
            &.addr-map-title {
                top: -14px;
            }
        }
    }
}

@media (max-width: 1618px) {
    .addr-marker-1 {
        .map-txt {
            &.addr-map-title {
                top: -12px;
            }
        }
    }
}

@media (max-width: 1588px) {
    .addr-marker-1 {
        .map-txt {
            &.addr-map-title {
                top: -10px;
            }
        }
    }
}

@media (max-width: 1108px) {
    .map-txt {
        font-weight: 600;
        text-shadow: -1px -1px 0 #fff,
            1px -1px 0 #fff,
            -1px 1px 0 #fff,
            1px 1px 0 #fff,
            0 -1px 0 #fff,
            0 1px 0 #fff,
            -1px 0 0 #fff,
            1px 0 0 #fff,
            4px 4px 8px rgba(0, 0, 0, 0.5);
        letter-spacing: 2px;
    }
}

@media (max-width: 992px) {
    .addr-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .addr-layout-map,
    .addr-list-panel {
        position: static;
        max-height: none;
    }

    .addr-layout-map {
        padding: 20px 16px;
    }

    /* .addr-list-scroll {
        max-height: 70vh;
    } */

    .addr-section {
        padding: 30px 0 30px 0;
    }

    .sub-title p {
        padding: 0 15px;
    }

    .addr-layout-map {
        padding: 0;
    }

    .addr-map-tip {
        display: none;
    }

    .addr-list-panel {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .map-txt {
        font-size: 14px;
        line-height: 14px;
        height: 14px;

        &.addr-map-title {
            font-size: 11px;
            line-height: 11px;
            height: 11px;
        }
        
    }

    .addr-list-head {
        padding: 16px;
    }

    .addr-list-scroll {
        padding: 10px 12px 20px;
    }

    .addr-item-head {
        padding: 14px 16px;
    }

    .addr-item-body {
        padding: 14px 16px 18px;
    }

}

@media (max-width: 414px) {
    .addr-marker-2,
    .addr-marker-3 {
        .map-txt.addr-map-title {
            top: -6px;
        }
    }

    .addr-marker-8 {
        .map-txt.addr-map-title {
            top: -6px;
        }
    }

    .addr-marker-12 {
        .map-txt.addr-map-title {
            top: 2px;
        }
    }

    .addr-marker-13 {
        .map-txt.addr-map-title {
            width: 136%;
            margin-left: 18%;
            top: 0;
        }

    }
}