/* ============================
   经典电商红主题
   ============================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px; line-height: 1.6; color: #333;
    background: #f5f5f5; -webkit-font-smoothing: antialiased;
}
a { color: #333; text-decoration: none; transition: color .2s; }
a:hover { color: #e4393c; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input { outline: none; font-family: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

::selection { background: #e4393c; color: #fff; }

.wrapper { width: 1200px; margin: 0 auto; padding: 0 15px; }
.main { padding: 20px 0; min-height: 400px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Header ===== */
.site-header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.site-logo a {
    display: flex; align-items: center;
    font-size: 22px; font-weight: 800; color: #e4393c;
    letter-spacing: .5px;
}
.site-logo img { height: 40px; width: auto; margin-right: 8px; }

.header-search { flex: 1; max-width: 440px; margin: 0 24px; }
.header-search form { display: flex; }
.header-search input {
    flex: 1; height: 38px; padding: 0 12px;
    border: 2px solid #e4393c; border-right: none;
    border-radius: 4px 0 0 4px; font-size: 14px; background: #fff;
}
.header-search input:focus { border-color: #c62828; }
.header-search button {
    height: 38px; padding: 0 20px;
    background: #e4393c; color: #fff; font-size: 14px; font-weight: 600;
    border-radius: 0 4px 4px 0; transition: background .2s;
}
.header-search button:hover { background: #c62828; }

/* ===== Nav ===== */
.site-nav { background: #e4393c; }
.nav-inner { display: flex; align-items: center; height: 40px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-inner a {
    flex-shrink: 0; display: block; padding: 0 18px;
    line-height: 40px; color: rgba(255,255,255,.9); font-size: 14px;
    white-space: nowrap; transition: background .2s;
}
.nav-inner a:hover,
.nav-inner a.active { background: rgba(0,0,0,.12); color: #fff; }

/* ===== Breadcrumb ===== */
.breadcrumb { padding: 12px 0; font-size: 13px; color: #999; display: flex; flex-wrap: wrap; }
.breadcrumb a { color: #999; }
.breadcrumb a:hover { color: #e4393c; }
.breadcrumb .sep { margin: 0 8px; color: #ddd; }

/* ===== Product Grid ===== */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.goods-card {
    background: #fff; border-radius: 8px; overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
}
.goods-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.goods-card .card-img {
    position: relative; width: 100%; padding-top: 100%;
    background: #fafafa; overflow: hidden;
}
.goods-card .card-img img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
}
.goods-card .card-img .badge {
    position: absolute; top: 8px; left: 8px;
    background: #e4393c; color: #fff; font-size: 11px;
    padding: 2px 10px; border-radius: 10px; font-weight: 600;
    z-index: 1;
}
.goods-card .card-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.goods-card .card-title {
    font-size: 14px; font-weight: 500; line-height: 1.5; color: #222;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 42px;
}
.goods-card .card-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; padding-top: 10px;
}
.goods-card .card-price { color: #e4393c; font-size: 20px; font-weight: 700; }
.goods-card .card-price .unit { font-size: 14px; font-weight: 400; }
.goods-card .card-sales { font-size: 12px; color: #999; }
.goods-card .card-btn {
    margin-top: 10px; display: block; width: 100%;
    padding: 9px 0; text-align: center;
    background: #e4393c; color: #fff; font-size: 13px; font-weight: 600;
    border-radius: 4px; transition: background .2s;
}
.goods-card .card-btn:hover { background: #c62828; color: #fff; }

/* ===== Category Filter ===== */
.cate-filter { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.cate-filter a {
    display: inline-block; padding: 6px 16px; border-radius: 20px;
    font-size: 13px; background: #eee; color: #555; transition: all .2s;
}
.cate-filter a:hover { background: #fce4e4; color: #e4393c; }
.cate-filter a.active { background: #e4393c; color: #fff; }

/* ===== Detail ===== */
.detail-wrap { background: #fff; border-radius: 8px; padding: 24px; }
.detail-main { display: flex; gap: 36px; }
.detail-gallery { width: 420px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.detail-gallery img { width: 100%; border-radius: 8px; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 22px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; color: #222; }
.detail-info .tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #fef0f0; color: #e4393c; font-size: 12px;
    padding: 4px 12px; border-radius: 4px; margin-bottom: 16px; font-weight: 500;
}
.detail-info .price-box {
    display: flex; align-items: center; gap: 24px;
    background: #fafafa; padding: 16px 24px; border-radius: 8px; margin-bottom: 16px;
}
.detail-info .price-box .current-price { color: #e4393c; }
.detail-info .price-box .current-price .label { font-size: 13px; color: #666; font-weight: 400; }
.detail-info .price-box .current-price .amount { font-size: 36px; font-weight: 800; }
.detail-info .price-box .current-price .amount .symbol { font-size: 20px; }
.detail-info .price-box .buy-btn {
    display: inline-block; padding: 12px 40px;
    background: linear-gradient(135deg, #e4393c, #c62828);
    color: #fff; font-size: 16px; font-weight: 700;
    border-radius: 6px; transition: opacity .2s;
}
.detail-info .price-box .buy-btn:hover { opacity: .9; color: #fff; }
.detail-info .meta-list { font-size: 14px; color: #666; line-height: 2; margin-bottom: 16px; }
.detail-info .meta-list .label { color: #999; margin-right: 8px; }
.desc-section { border-top: 1px solid #eee; padding-top: 24px; margin-top: 24px; }
.desc-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #333; }
.desc-section .desc-body { line-height: 1.8; font-size: 14px; color: #555; }

/* ===== Related ===== */
.section-title {
    font-size: 18px; font-weight: 700; color: #222; margin-bottom: 16px;
    padding-left: 12px; border-left: 3px solid #e4393c;
}
.like-section { margin-top: 30px; }

/* ===== Pagination ===== */
.pagination { text-align: center; padding: 24px 0 30px; }
.pagination ul { display: inline-flex; align-items: center; gap: 4px; }
.pagination li { display: inline-block; }
.pagination li a, .pagination li span {
    display: inline-block; padding: 8px 16px; font-size: 13px;
    border: 1px solid #e0e0e0; border-radius: 4px;
    background: #fff; color: #555; transition: all .2s;
}
.pagination li a:hover { border-color: #e4393c; color: #e4393c; }
.pagination li.active span { background: #e4393c; color: #fff; border-color: #e4393c; }
.pagination li.disabled span { color: #ccc; background: #fafafa; border-color: #eee; }

/* ===== Footer ===== */
.site-footer { margin-top: 40px; background: #222; color: #aaa; font-size: 13px; }
.footer-inner { padding: 28px 0; text-align: center; line-height: 2; }
.footer-inner .brand { font-size: 16px; font-weight: 600; color: #ddd; }
.footer-inner a { color: #aaa; }
.footer-inner a:hover { color: #e4393c; }
.footer-bottom { border-top: 1px solid #333; padding: 14px 0; text-align: center; font-size: 12px; color: #777; }
.footer-bottom a { color: #777; }
.footer-bottom a:hover { color: #e4393c; }

/* ===== Empty ===== */
.empty-state { text-align: center; padding: 60px 0; color: #999; font-size: 15px; }

/* ===== Responsive ===== */
@media (max-width: 1240px) {
    .wrapper { width: 100%; }
}
@media (max-width: 768px) {
    .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .detail-main { flex-direction: column; }
    .detail-gallery { width: 100%; max-width: 360px; }
}
@media (max-width: 480px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .header-search { margin: 0; max-width: 100%; order: 3; }
    .nav-inner { overflow-x: auto; }
    .goods-grid { gap: 8px; }
}

/* ===== Filter Rows ===== */
.filter-row {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}
.filter-row:last-of-type {
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 16px;
}
.filter-label {
    flex-shrink: 0;
    font-size: 13px;
    color: #999;
    line-height: 30px;
    min-width: 5em;
    font-weight: 500;
}
.filter-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 2px;
    flex: 1;
}
.filter-item {
    display: inline-block;
    padding: 3px 12px;
    font-size: 13px;
    color: #555;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fff;
    transition: all .2s;
    line-height: 22px;
    white-space: nowrap;
}
.filter-item:hover {
    border-color: #e4393c;
    color: #e4393c;
}
.filter-item.active {
    border-color: #e4393c;
    background: #e4393c;
    color: #fff;
}

/* ===== Kefu Floating Sidebar ===== */
.kefu-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(0,0,0,.08);
    border-radius: 6px 0 0 6px;
    box-shadow: -2px 2px 8px rgba(0,0,0,.12);
}
.kefu-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    padding: 10px 0;
    background: #fff;
    color: #333;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}
.kefu-item:hover,
.kefu-item:hover .kefu-link {
    background: #e4393c;
    color: #fff;
}
.kefu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: inherit;
    text-decoration: none;
}
.kefu-link:hover {
    color: #fff;
}
.kefu-label {
    line-height: 1.2;
    text-align: center;
    font-size: 11px;
    margin-top: 3px;
}
.kefu-item svg {
    display: block;
}

/* QQ popup */
.kefu-qq-popup {
    display: none;
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    text-align: center;
    white-space: nowrap;
}
.kefu-qq-popup .kefu-qq-num {
    font-size: 18px;
    font-weight: 700;
    color: #e4393c;
    margin: 0;
}
.kefu-qq-popup .kefu-qq-hint {
    font-size: 12px;
    color: #999;
    margin: 4px 0 0;
}
.kefu-qq:hover .kefu-qq-popup {
    display: block;
}

/* WeChat popup */
.kefu-wechat-popup {
    display: none;
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    text-align: center;
    width: 160px;
}
.kefu-wechat-popup img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
    border-radius: 4px;
}
.kefu-wechat-popup p {
    font-size: 12px;
    color: #666;
    margin: 0;
}
.kefu-wechat:hover .kefu-wechat-popup {
    display: block;
}
    display: block;
}
.kefu-label {
    line-height: 1.2;
    text-align: center;
    font-size: 11px;
}
.kefu-num {
    display: block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    margin-top: 1px;
}

/* ===== Province/City Filter ===== */
.filter-province {
    position: relative;
    display: inline-block;
}
.filter-province > .filter-item {
    cursor: pointer;
}
.province-cities {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    min-width: 160px;
    max-width: 360px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 4px;
}
.filter-province:hover .province-cities {
    display: flex;
}
.city-item {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    color: #555;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fff;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.city-item:hover {
    border-color: #e4393c;
    color: #e4393c;
}
.city-item.active {
    border-color: #e4393c;
    background: #e4393c;
    color: #fff;
}
