/* ============ 模板商城专用样式（继承主站蓝色系，橙色 CTA 突出购买） ============ */
:root {
    --shop-cta: #f97316;          /* 橙色购买按钮，与蓝色主站协调 */
    --shop-cta-hover: #ea580c;
    --shop-price: #e11d48;        /* 醒目价格红 */
    --shop-green: #16a34a;
}

/* ---- Hero ---- */
.shop-hero {
    background: linear-gradient(135deg, #1a56db 0%, #0ea5e9 100%);
    color: #fff;
    padding: 110px 0 40px;
    margin-top: 64px;             /* 抵掉固定导航栏 */
    text-align: center;
}
.shop-hero h1 { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.shop-hero p { opacity: .9; margin-bottom: 20px; }
.shop-search {
    display: flex; max-width: 560px; margin: 0 auto; background: #fff;
    border-radius: 24px; padding: 6px 6px 6px 18px; align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.shop-search input {
    flex: 1; border: none; outline: none; font-size: 15px; padding: 8px 0;
}
.shop-search button {
    background: var(--shop-cta); color: #fff; border: none; border-radius: 20px;
    padding: 10px 26px; font-size: 15px; cursor: pointer; transition: var(--transition);
}
.shop-search button:hover { background: var(--shop-cta-hover); }

/* ---- 分类横向导航 ---- */
.shop-cat-bar {
    background: #fff; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 64px; z-index: 90;
}
.shop-cat-scroll {
    max-width: 1200px; margin: 0 auto; padding: 10px 20px;
    display: flex; gap: 10px; overflow-x: auto; white-space: nowrap;
}
.shop-cat-chip {
    padding: 7px 16px; border-radius: 18px; font-size: 14px; color: var(--text-color);
    background: var(--bg-color); transition: var(--transition); flex-shrink: 0;
}
.shop-cat-chip:hover { background: #e0e7ff; color: var(--primary-color); }
.shop-cat-chip.active { background: var(--primary-color); color: #fff; }

/* ---- 工具条（排序+结果数） ---- */
.shop-toolbar {
    max-width: 1200px; margin: 20px auto 0; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.shop-toolbar select {
    padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius);
    background: #fff; font-size: 14px; outline: none; cursor: pointer;
}

/* ---- 商品卡片网格 ---- */
.shop-grid {
    max-width: 1200px; margin: 20px auto 40px; padding: 0 20px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px;
}
.product-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: var(--transition);
    display: flex; flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.product-cover {
    width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e2e8f0;
}
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.product-title {
    font-size: 15px; font-weight: 600; color: var(--text-color);
    line-height: 1.4; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card:hover .product-title { color: var(--primary-color); }
.product-tags { margin-bottom: 10px; }
.product-tags .tag {
    display: inline-block; font-size: 12px; color: var(--secondary-color);
    background: #eff6ff; border-radius: 4px; padding: 2px 8px; margin-right: 6px;
}
.product-price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.product-price { font-size: 20px; font-weight: 700; color: var(--shop-price); }
.product-price::before { content: "¥"; font-size: 13px; margin-right: 1px; }
.product-original { font-size: 13px; color: var(--text-light); text-decoration: line-through; }
.product-sales { margin-left: auto; font-size: 12px; color: var(--text-light); }

/* ---- 空状态 ---- */
.shop-empty {
    max-width: 1200px; margin: 60px auto; padding: 0 20px; text-align: center; color: var(--text-light);
}
.shop-empty i { font-size: 48px; margin-bottom: 12px; display: block; }

/* ---- 分页 ---- */
.shop-pagination {
    max-width: 1200px; margin: 0 auto 50px; padding: 0 20px;
    display: flex; justify-content: center; gap: 8px;
}
.shop-pagination a, .shop-pagination span.cur {
    padding: 7px 14px; border-radius: 6px; font-size: 14px;
    border: 1px solid var(--border-color); background: #fff; color: var(--text-color);
}
.shop-pagination span.cur { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* ============ 商品详情页 ============ */
.breadcrumb {
    max-width: 1200px; margin: 90px auto 0; padding: 0 20px; font-size: 13px; color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary-color); }

.product-wrap {
    max-width: 1200px; margin: 16px auto 40px; padding: 0 20px;
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px;
}
.product-gallery .main-img {
    width: 100%; border-radius: var(--radius); border: 1px solid var(--border-color);
    aspect-ratio: 4/3; object-fit: cover; background: #e2e8f0;
}
.thumb-row {
    display: flex; gap: 8px; margin-top: 10px; overflow-x: auto;
}
.thumb {
    width: 72px; height: 54px; object-fit: cover; border-radius: 6px;
    border: 2px solid var(--border-color); cursor: pointer; flex-shrink: 0;
    transition: var(--transition); background: #e2e8f0;
}
.thumb:hover { border-color: var(--primary-color); }
.thumb.active { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(30,90,220,.2); }
.product-info h1 { font-size: 24px; margin: 6px 0 12px; line-height: 1.35; }
.product-info .meta-tags { margin-bottom: 16px; }
.price-box { display: flex; align-items: baseline; gap: 12px; margin: 16px 0;
    background: #fff7ed; padding: 16px; border-radius: var(--radius); }
.price-box .now { font-size: 32px; font-weight: 700; color: var(--shop-price); }
.price-box .now::before { content: "¥"; font-size: 18px; }
.price-box .was { font-size: 15px; color: var(--text-light); text-decoration: line-through; }
.price-box .sales { margin-left: auto; font-size: 13px; color: var(--text-light); }
.buy-btn {
    display: block; width: 100%; text-align: center; background: var(--shop-cta); color: #fff;
    font-size: 17px; font-weight: 600; padding: 15px; border-radius: var(--radius);
    transition: var(--transition); margin-top: 10px;
}
.buy-btn:hover { background: var(--shop-cta-hover); color: #fff; transform: translateY(-2px); }
.buy-note { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 8px; }

/* 详情正文 Markdown */
.product-detail-body {
    max-width: 1200px; margin: 0 auto 40px; padding: 0 20px;
}
.detail-card {
    background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm);
}
.detail-card h2 { font-size: 20px; margin: 18px 0 10px; }
.detail-card ul { padding-left: 22px; margin: 8px 0; }
.detail-card p { margin: 8px 0; color: var(--text-color); }

/* 相关推荐 */
.related-section { max-width: 1200px; margin: 0 auto 40px; padding: 0 20px; }
.related-section h3 { font-size: 18px; margin-bottom: 16px; }

/* 免责声明 */
.disclaimer {
    max-width: 1200px; margin: 0 auto 40px; padding: 16px 20px; font-size: 12px;
    color: var(--text-light); background: #f1f5f9; border-radius: var(--radius);
}

/* 回到顶部 */
.back-top {
    position: fixed; right: 24px; bottom: 24px; width: 44px; height: 44px;
    background: var(--primary-color); color: #fff; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
    box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: var(--transition);
    z-index: 999;
}
.back-top.show { opacity: 1; pointer-events: auto; }

/* DB 离线提示条 */
.shop-db-warn {
    background: #fef3c7; color: #92400e; text-align: center; padding: 8px; font-size: 13px;
    margin-top: 64px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .product-wrap { grid-template-columns: 1fr; gap: 20px; }
    .shop-hero h1 { font-size: 22px; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-price { font-size: 17px; }
}
@media (max-width: 480px) {
    .shop-grid { grid-template-columns: 1fr; }
}

/* 极窄屏（≤360px）：防止 grid 项 min-content 撑破容器，消除 body 级横向滚动条 */
.product-gallery, .product-info { min-width: 0; }
.product-info { overflow-wrap: break-word; word-break: break-word; }
.product-info h1 { word-break: break-word; }
.price-box { flex-wrap: wrap; }
.product-info img, .main-img { max-width: 100%; }
