/* ─────────────────────────────────────────────────────────
   正派优选 — Bootstrap 5.3.8 主题覆盖
   品牌色：红色 #e4393c
   设计风格：扁平、高级感、无阴影
───────────────────────────────────────────────────────── */

/* ── 品牌色 token ── */
:root {
    --brand:        #e4393c;
    --brand-dark:   #c02024;
    --brand-light:  #fff1f1;
    --brand-alpha:  rgba(228,57,60,.08);

    /* Bootstrap 变量覆盖 */
    --bs-danger:              #e4393c;
    --bs-danger-rgb:          228,57,60;
    --bs-link-color:          #333;
    --bs-link-hover-color:    #e4393c;
    --bs-link-color-rgb:      51,51,51;

    /* 布局尺寸 */
    --sidebar-width:    210px;
    --userpanel-width:  240px;
    --header-height:    auto;
    --nav-height:       44px;
}

/* ── 基础 reset ── */
a { text-decoration: none; color: inherit; }
a:hover { color: var(--brand); }
body { font-size: 14px; background: #f4f4f4; }

/* ── Bootstrap 颜色覆盖 ── */
.btn-danger {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: #a01820;
}
.btn-outline-danger {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: #a01820;
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
}
.text-primary{
    color: var(--brand) !important;
}
.bg-primary{
    background-color: var(--brand) !important;
}
.form-check-input:checked, .list-group-item.active, .active>.page-link, .page-link.active{
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

.nav-pills .nav-link.active, .nav-pills .show>.nav-link{
    background-color: var(--brand) !important;
}
.text-danger  { color: var(--brand) !important; }
.bg-danger    { background-color: var(--brand) !important; }
.border-danger{ border-color: var(--brand) !important; }
.bg-danger-subtle { background-color: var(--brand-light) !important; }

/* ═══════════════════════════════════════════════
   ① 顶部通知栏
═══════════════════════════════════════════════ */
#topBar {
    background: #f5f5f5;
    font-size: 12px;
    border-bottom: 1px solid #e8e8e8;
}
#topBar a { color: #666; }
#topBar a:hover { color: var(--brand); }
#topBar .sep { color: #ddd; margin: 0 6px; }

/* ═══════════════════════════════════════════════
   ② 主头部
═══════════════════════════════════════════════ */
#mainHeader {
    background: #fff;
    border-bottom: 1px solid #eee;
}

/* Logo */
.logo-text {
    color: var(--brand);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}
.logo-sub {
    font-size: 11px;
    color: #aaa;
    letter-spacing: 1px;
    line-height: 1;
}

/* 搜索框 */
.search-wrap {
    border: 2px solid var(--brand);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    height: 42px;
}
.search-wrap input {
    flex: 1;
    border: 0;
    outline: none;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
    min-width: 0;
}
.search-wrap input::placeholder { color: #bbb; }
.search-wrap .go-btn {
    width: 88px;
    background: var(--brand);
    border: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background .15s;
}
.search-wrap .go-btn:hover { background: var(--brand-dark); }

/* 购物车 / 收藏夹 按钮组 - 统一样式，高度与搜索框对齐 */
.hdr-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 42px;
    border: 2px solid var(--brand);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    color: #333;
    text-decoration: none;
}
.hdr-btn:hover {
    background: var(--brand);
    color: #fff;
}
.hdr-btn .icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.hdr-btn .icon-wrap i {
    font-size: 20px;
    color: var(--brand);
    transition: color .15s;
}
.hdr-btn:hover .icon-wrap i { color: #fff; }
.hdr-btn .badge-dot {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    min-width: 16px;
    text-align: center;
}
.hdr-btn:hover .badge-dot { background: #fff; color: var(--brand); }
.hdr-btn .btn-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: color .15s;
}
.hdr-btn:hover .btn-label { color: #fff; }

/* 移动端小按钮 */
.hdr-btn-sm {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
}

/* ═══════════════════════════════════════════════
   ③ 导航栏
═══════════════════════════════════════════════ */
#mainNav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    top: 0;
    z-index: 900;
}

/* 全部分类按钮 */
#catToggleBtn {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--brand);
    border: 0;
    color: #fff;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 0;
    transition: background .15s;
}
#catToggleBtn:hover { background: var(--brand-dark); }
#catToggleBtn .sep-line {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,.35);
    margin: 0 4px;
}

/* 分类下拉菜单 */
.cat-dropdown-menu {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 8px 0;
    margin-top: 0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.cat-dropdown-menu .dropdown-item {
    font-size: 13px;
    color: #333;
    padding: 10px 16px;
    transition: all .12s;
}
.cat-dropdown-menu .dropdown-item:hover {
    background: var(--brand-light);
    color: var(--brand);
}
.cat-dropdown-menu .dropdown-item i {
    font-size: 14px;
}

/* 导航链接 */
.nav-links {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    overflow-x: auto;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    gap: 4px;
    transition: color .15s, border-color .15s;
}
.nav-links a:hover  { color: var(--brand); }
.nav-links a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   ④ 英雄区三列布局
═══════════════════════════════════════════════ */
#heroSection {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

/* 左侧分类栏 */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
#sidebar ul { list-style: none; margin: 0; padding: 0; }
.cat-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 9px 14px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background .12s;
}
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: var(--brand-light); }
.cat-row:hover .cat-name { color: var(--brand); }
.cat-row .cat-icon {
    color: var(--brand);
    width: 18px;
    flex-shrink: 0;
    margin-right: 6px;
    margin-top: 2px;
}
.cat-row .cat-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}
.cat-row .cat-sub  { font-size: 11px; color: #999; line-height: 1.4; }
.cat-row .cat-arrow{ margin-left: auto; color: #ccc; font-size: 11px; margin-top: 3px; }
.cat-row:hover .cat-arrow { color: var(--brand); }

/* 大菜单 fly-out */
#megaMenu {
    display: none;
    position: absolute;
    left: var(--sidebar-width);
    top: 0;
    width: 540px;
    min-height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-left: 3px solid var(--brand);
    box-shadow: 4px 0 20px rgba(0,0,0,.08);
    z-index: 800;
    padding: 20px;
    border-radius: 0 4px 4px 0;
}
.mega-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}
.mega-tag {
    display: inline-block;
    font-size: 12px;
    color: #555;
    padding: 3px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    margin: 0 4px 6px 0;
    background: #fafafa;
}
.mega-tag:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-light);
}

/* 轮播区 */
#bannerWrap {
    flex: 1;
    min-width: 0;
    border-radius: 4px;
    overflow: hidden;
}
#heroBanner .carousel-inner { border-radius: 4px; }

/* 右侧用户面板 */
#userPanel {
    width: var(--userpanel-width);
    min-width: var(--userpanel-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.panel-card {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* 快捷功能格 */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.quick-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .12s;
}
.quick-cell:nth-child(4n) { border-right: 0; }
.quick-cell:nth-last-child(-n+4) { border-bottom: 0; }
.quick-cell:hover { background: var(--brand-light); }
.quick-cell i { font-size: 20px; color: var(--brand); margin-bottom: 4px; }
.quick-cell span { font-size: 11px; color: #555; }

/* ═══════════════════════════════════════════════
   ⑤ 信任保障带
═══════════════════════════════════════════════ */
.trust-bar {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item i { font-size: 28px; color: var(--brand); }
.trust-item .t-title { font-size: 14px; font-weight: 600; color: #222; }
.trust-item .t-sub   { font-size: 12px; color: #999; }

/* ═══════════════════════════════════════════════
   ⑥ 板块标题通用
═══════════════════════════════════════════════ */
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .bar {
    width: 4px;
    height: 18px;
    background: var(--brand);
    border-radius: 2px;
    flex-shrink: 0;
}
.section-title h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #222;
}

/* ═══════════════════════════════════════════════
   商品卡片 hover
═══════════════════════════════════════════════ */
.prod-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    border: 1px solid #eee;
}
.prod-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-3px);
}

/* 闪购横向滚动 */
.flash-scroll { overflow-x: auto; flex: 1; }
.flash-scroll::-webkit-scrollbar { height: 3px; }
.flash-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.flash-item {
    min-width: 128px;
    border-left: 1px solid #f0f0f0;
    text-align: center;
    padding: 10px 8px;
    flex-shrink: 0;
    transition: background .15s;
}
.flash-item:hover { background: #fff8f8; }

/* 返回顶部 */
#backTop {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: none;
}
#backTop.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════
   移动端响应式
═══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    #sidebar, #userPanel { display: none !important; }
    #heroSection { padding: 0; }
    #catToggleBtn { width: auto; min-width: auto; }
}

/* 图片通用 */

.carousel-item img {max-height: 340px;}