/**
 * 门店查询页面样式
 */

/* 页面头部 */
.branch-page-header {
    position: relative;
    height: 300px;
    text-align: center;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 70px;
    overflow: hidden;
}

.branch-page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #555;
}

.branch-page-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.branch-page-header .container {
    position: relative;
    z-index: 2;
}

.branch-page-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

/* 门店地图布局 */
.branch-map-section {
    background: #f5f5f5;
    padding: 20px 0;
}

.branch-map-layout {
    position: relative;
    display: flex;
    height: calc(100vh - 310px);
    min-height: 450px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* 地图容器 */
.branch-map-wrapper {
    position: relative;
    width: 65%;
    flex-shrink: 0;
    z-index: 1;
}

.branch-map {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
    z-index: 1;
}

/* 门店列表容器 */
.branch-list-wrapper {
    position: relative;
    width: 35%;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e8e8e8;
}

.branch-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.branch-list-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.branch-count {
    font-size: 13px;
    color: #999;
}

.branch-count span {
    color: #1890ff;
    font-weight: 600;
}

/* 门店筛选栏 */
.branch-filter-bar {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.filter-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s;
}

.filter-select:focus {
    outline: none;
    border-color: #1890ff;
}

.branch-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.branch-list-scroll::-webkit-scrollbar {
    display: none;
}

/* 滚动按钮 */
.scroll-btn {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 50%;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.scroll-btn::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid currentColor;
}

.scroll-btn-up::after {
    border-top: none;
    border-bottom: 8px solid currentColor;
}

.scroll-btn.show {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn:hover {
    background: rgba(24, 144, 255, .15);
    color: #1890ff;
    border-color: rgba(24, 144, 255, .3);
}

.scroll-btn-up {
    bottom: 50px;
}

.scroll-btn-down {
    bottom: 15px;
}

/* 门店卡片 */
.branch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all .2s;
    cursor: pointer;
}

.branch-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.branch-card.active {
    border-color: rgba(24, 144, 255, .5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.branch-card.active .branch-card-image {
    border: 2px solid #1890ff;
}

/* 卡片上部：图片+信息 */
.branch-card-top {
    display: flex;
    padding: 12px;
    gap: 12px;
}

.branch-card-image {
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid transparent;
    transition: border-color .2s;
}

.branch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.branch-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.branch-card-info {
    flex: 1;
    min-width: 0;
}

.branch-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-card-address,
.branch-card-phone {
    font-size: 13px;
    color: #666;
    margin: 0 0 4px;
    line-height: 1.5;
}

.branch-card-address .label,
.branch-card-phone .label {
    color: #999;
}

/* 卡片下部：操作按钮 */
.branch-card-bottom {
    display: flex;
    gap: 20px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.branch-action-link {
    font-size: 13px;
    color: #1890ff;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.branch-action-link:hover {
    color: #40a9ff;
}

.expand-icon {
    font-size: 14px;
    transition: transform .3s ease;
}

/* 展开区域 */
.branch-card-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease, opacity .3s ease;
    opacity: 0;
    padding: 0 12px;
}

.branch-card-expand.show {
    max-height: 500px;
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    opacity: 1;
}

.expand-content {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.expand-image {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
}

.expand-image img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.expand-content p {
    margin: 0 0 8px;
}

.expand-content .label {
    color: #999;
}

/* 空状态 */
.branch-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.branch-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* 地图信息窗口样式 */
.map-info-window {
    padding: 10px;
    min-width: 200px;
}

.map-info-window .title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.map-info-window .address {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.map-info-window .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.map-info-window .actions a,
.map-info-window .actions button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
}

/* 响应式 */
@media (max-width: 1024px) {
    .branch-map-layout {
        flex-direction: column;
        height: auto;
    }

    .branch-map-wrapper {
        width: 100%;
        height: 350px;
    }

    .branch-list-wrapper {
        width: 100%;
        height: auto;
        min-height: 400px;
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }

    .branch-list-scroll {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .branch-page-header {
        height: 200px;
        padding-top: 60px;
    }

    .branch-page-title {
        font-size: 24px;
    }

    .branch-map-section {
        padding: 15px 0;
    }

    .branch-map-layout {
        border-radius: 0;
    }

    .branch-map-wrapper {
        height: 280px;
    }

    .branch-list-header {
        padding: 12px 15px;
    }

    .branch-filter-bar {
        padding: 10px 15px;
    }

    .branch-list-scroll {
        padding: 10px 15px;
        max-height: 350px;
    }

    .branch-card-top {
        padding: 10px;
    }

    .branch-card-image {
        width: 80px;
        height: 65px;
    }

    .branch-card-bottom {
        gap: 15px;
        padding: 8px 10px;
    }

    .branch-action-link {
        font-size: 12px;
    }
}
