/* =========================================================
   商家导航页 (merchant.css)
   ========================================================= */

.merchant-page {
    display: flex;
    height: calc(100vh - 56px - var(--nav-height));
    background: var(--bg-page);
    overflow: hidden;
}

/* --- 左侧分类侧边栏 --- */
.sidebar {
    width: 90px;
    background: #F5F5F5;
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-item {
    display: block;
    padding: 16px 10px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-item.active {
    background: var(--bg-card);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* --- 右侧商家列表区 --- */
.merchant-content {
    flex: 1;
    padding: 0 12px 12px; /* 顶部由 filter-sticky 控制间距 */
    overflow-y: auto;
    background: var(--bg-card);
}

/* --- 顶部搜索栏 (与分类列表页一致) --- */
.header-search-wrap {
    display: flex; align-items: center; width: 100%; padding: 0 10px; background: var(--bg-card);
}
.search-input-box {
    flex: 1; display: flex; align-items: center; background: var(--bg-page);
    border-radius: 18px; padding: 6px 12px; margin: 0 10px; position: relative;
}
.search-input-box i.fa-magnifying-glass { color: #999; font-size: 14px; }
.search-input-box input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; margin-left: 6px; color: var(--text-main);
}
.clear-input-btn {
    display: none; color: #ccc; font-size: 14px; padding: 4px; cursor: pointer; transition: color 0.2s;
}
.clear-input-btn:hover { color: #999; }
.search-btn {
    font-size: 14px; color: var(--primary); font-weight: 600; cursor: pointer;
    padding: 4px 8px; flex-shrink: 0; background: none; border: none;
}
.cancel-btn {
    font-size: 14px; color: var(--text-main); cursor: pointer; flex-shrink: 0; padding: 4px;
}

/* --- 吸顶地区筛选区 --- */
.filter-sticky {
    position: sticky; top: 0; /* 因为外层头部已经是 sticky，这里相对内容区滚动 */
    background: var(--bg-card); z-index: 90;
    padding: 12px 0; border-bottom: 1px solid var(--border-light);
    margin: 0 -12px; padding-left: 12px; padding-right: 12px;
}
.region-filter-bar {
    display: flex; align-items: center; font-size: 13px; color: var(--text-main);
    font-weight: 500; background: var(--bg-page); padding: 10px 14px;
    border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.02); cursor: pointer;
}
.region-filter-bar i.fa-location-dot { color: var(--primary); margin-right: 6px; }

/* --- 商家卡片列表 --- */
.merchant-card {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
}
.merchant-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.merchant-logo {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    overflow: hidden;
    flex-shrink: 0;
}
.merchant-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merchant-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.merchant-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merchant-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.merchant-tags .tag {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
}

.merchant-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 商家空状态 */
.empty-merchant {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-merchant i {
    font-size: 40px;
    color: var(--border-light);
    margin-bottom: 12px;
}

/* --- 地区选择弹窗 --- */
.region-modal-wrap { display: flex; height: 55vh; }
@media (min-width: 600px) { .region-modal-wrap { height: 450px; } }
.region-left-sidebar { width: 120px; background: #f5f5f5; overflow-y: auto; flex-shrink: 0; }
.region-right-content { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; }
.r-sidebar-item { padding: 14px 10px; font-size: 13px; text-align: center; color: #666; cursor: pointer; }
.r-sidebar-item.active { background: #fff; color: var(--primary); font-weight: 600; }
.r-city-item { background: #f5f5f5; padding: 6px 14px; border-radius: 16px; font-size: 13px; color: #333; cursor: pointer; }
.r-city-item.active { background: var(--primary); color: #fff; }
.region-empty-tip { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #999; }
.region-empty-tip i { font-size: 40px; color: var(--border-light); margin-bottom: 10px; }

/* 顶部导航带边框的小按钮（用于入驻等） - 迷你版 */
.header-btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;            /* 图标和文字的间距缩小 */
    height: 22px;        /* 高度从 28px 缩小到 24px */
    padding: 0 6px;      /* 左右内边距从 10px 缩小到 8px */
    border: 1px solid var(--primary);
    border-radius: 12px; /* 高度变小，圆角也要等比缩小，12px 刚好是半高 */
    color: var(--primary);
    font-size: 11px;     /* 文字稍微缩小一点，更精致 */
    font-weight: 600;
    background-color: transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-btn-outline:active {
    background-color: var(--primary-light);
    opacity: 0.9;
}

.header-btn-outline i {
    font-size: 12px;     /* 图标进一步变小 */
    transform: translateY(-0.5px);
}

/* --- 商家列表页专属 Banner --- */
.merchant-banner-swiper {
    width: 100%;
    aspect-ratio: 2 / 1; /* 比例 2:1，高度自适应 */
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-soft);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.merchant-banner-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}
.merchant-banner-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.6;
}
.merchant-banner-swiper .swiper-pagination-bullet-active {
    background: var(--primary);
    opacity: 1;
}