/* ============================================================
   EduMaster - 商品详情页样式（single-shop_product.php）
   作用域限定 .sp-* / .product-*，全局加载不影响其它页面。
   ============================================================ */

/* ---------- 顶部面包屑导航 ---------- */
.sp-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    position: sticky;
    top: 0;
    z-index: 50;
}
.sp-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sp-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}
.sp-header-nav a { color: #6b7280; text-decoration: none; }
.sp-header-nav a:hover { color: #2563eb; }
.sp-header-nav span { color: #d1d5db; }
.sp-crumb-current { color: #111827; font-weight: 600; }
.sp-header-actions { flex-shrink: 0; }
.sp-header-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
}
.sp-header-btn:hover { background: #e5e7eb; }

/* ---------- 店铺摘要 ---------- */
.sp-summary-wrap {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 16px;
}
.sp-summary {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.sp-summary-avatar {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: #eff6ff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.sp-summary-logo { width: 100%; height: 100%; object-fit: cover; }
.sp-icon-lg { font-size: 28px; }
.sp-summary-info { flex: 1; min-width: 0; }
.sp-summary-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-summary-name { font-size: 16px; font-weight: 700; color: #111827; }
.sp-summary-badge {
    font-size: 11px; color: #16a34a; background: #dcfce7;
    padding: 2px 8px; border-radius: 999px;
}
.sp-summary-rating { font-size: 12px; color: #f59e0b; font-weight: 600; }
.sp-summary-meta {
    margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap;
    font-size: 12px; color: #6b7280;
}
.sp-desc-text { color: #9ca3af; }
.sp-summary-stats { display: flex; gap: 8px; flex-shrink: 0; }
.sp-summary-stat, .sp-summary-stat-outline {
    display: inline-flex; align-items: center;
    padding: 8px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.sp-summary-stat { background: #2563eb; color: #fff; }
.sp-summary-stat:hover { background: #1d4ed8; }
.sp-summary-stat-outline { background: #fff; color: #ef4444; border: 1px solid #fecaca; }
.sp-summary-stat-outline:hover { background: #fef2f2; }

/* ---------- 主布局：主内容 + 侧边栏 ---------- */
.sp-main-layout {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 16px 40px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.product-main-content { min-width: 0; }
.product-sidebar { min-width: 0; }

/* ---------- 通用卡片 ---------- */
.sp-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.sp-card-title-lg {
    display: flex; align-items: center; gap: 8px;
    font-size: 17px; font-weight: 700; color: #111827;
    margin: 0 0 16px;
}
.sp-accent-bar { width: 4px; height: 18px; background: #2563eb; border-radius: 2px; display: inline-block; }
.sp-accent-bar-sm { width: 4px; height: 16px; background: #2563eb; border-radius: 2px; display: inline-block; }
.sp-accent-bar-orange { width: 4px; height: 16px; background: #f97316; border-radius: 2px; display: inline-block; }
.sp-accent-bar-green { width: 4px; height: 16px; background: #16a34a; border-radius: 2px; display: inline-block; }

/* ---------- 产品图文网格 ---------- */
.sp-product-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
}
.product-image-wrap { min-width: 0; }
.sp-gallery {
    border-radius: 12px; overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
}
.sp-main-image { width: 100%; height: 100%; object-fit: cover; }
.sp-icon-big { font-size: 64px; }
.product-info-wrap { min-width: 0; }

.sp-product-title {
    font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 8px;
    line-height: 1.3;
}
.sp-product-desc { color: #6b7280; font-size: 14px; margin: 0 0 16px; line-height: 1.6; }

.sp-price-box {
    background: linear-gradient(135deg,#fff7ed,#fffbeb);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.sp-price-row { display: flex; align-items: baseline; gap: 10px; }
.sp-price-current { font-size: 28px; font-weight: 800; color: #ea580c; }
.sp-price-original { font-size: 15px; color: #9ca3af; }
.sp-price-meta {
    margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: #92400e;
}
.sp-price-tag {
    background: #ea580c; color: #fff; padding: 2px 8px; border-radius: 6px; font-weight: 600;
}

/* ---------- 参数 ---------- */
.sp-params {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px;
    padding: 12px 0; border-top: 1px dashed #e5e7eb; margin-bottom: 16px;
}
.sp-param-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sp-param-label { color: #9ca3af; min-width: 42px; }
.sp-param-value { color: #374151; font-weight: 600; }
.sp-stock-instock { color: #16a34a; font-weight: 600; font-size: 13px; }
.sp-stock-out { color: #ef4444; font-weight: 600; font-size: 13px; }
.sp-author-name { color: #2563eb; font-weight: 600; }

/* ---------- 操作按钮 ---------- */
.sp-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sp-btn-primary, .sp-btn-buy, .sp-btn-fav {
    flex: 1; min-width: 120px; text-align: center;
    padding: 13px 16px; border-radius: 10px; font-size: 15px; font-weight: 700;
    text-decoration: none; transition: opacity .15s;
}
.sp-btn-primary { background: #2563eb; color: #fff; }
.sp-btn-primary:hover { background: #1d4ed8; }
.sp-btn-buy { background: linear-gradient(135deg,#f97316,#ea580c); color: #fff; }
.sp-btn-buy:hover { opacity: .92; }
.sp-btn-fav {
    flex: 0 0 auto; min-width: 96px;
    background: #fff; color: #ef4444; border: 1px solid #fecaca;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------- 产品详情 / 标签 ---------- */
.sp-content { font-size: 14px; color: #374151; line-height: 1.8; }
.sp-content img { max-width: 100%; height: auto; border-radius: 8px; }
.sp-desc-color { color: #4b5563; }
.sp-content-empty { color: #9ca3af; padding: 12px 0; }
.sp-footer { margin-top: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sp-footer-label { color: #9ca3af; }
.sp-tag {
    background: #eff6ff; color: #2563eb; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; text-decoration: none;
}
.sp-tag:hover { background: #dbeafe; }

/* ---------- 侧边栏卡片 ---------- */
.sp-sidebar-card {
    background: #fff; border: 1px solid #eef0f3; border-radius: 14px;
    padding: 18px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.sp-sidebar-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: #111827; margin: 0 0 14px;
}
.sp-seller-card { display: flex; align-items: center; gap: 12px; }
.sp-seller-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.sp-seller-name { font-size: 15px; font-weight: 700; color: #111827; }
.sp-seller-meta { font-size: 12px; color: #16a34a; margin-top: 2px; }
.sp-seller-stats { display: flex; gap: 8px; margin: 14px 0; }
.sp-seller-stat {
    flex: 1; text-align: center; background: #f9fafb; border-radius: 10px; padding: 10px 4px;
}
.sp-seller-stat-val { font-size: 16px; font-weight: 800; color: #111827; }
.sp-seller-stat-val.green { color: #16a34a; }
.sp-seller-stat-val.yellow { color: #f59e0b; }
.sp-seller-stat-label { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.sp-view-all {
    display: block; text-align: center; padding: 10px;
    border: 1px solid #e5e7eb; border-radius: 10px; color: #2563eb;
    font-size: 13px; font-weight: 600; text-decoration: none;
}
.sp-view-all:hover { background: #eff6ff; }

/* ---------- 相关推荐 / 热销排行 ---------- */
.sp-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-related-item { text-decoration: none; color: inherit; }
.sp-r-card {
    border: 1px solid #f1f3f5; border-radius: 10px; overflow: hidden; background: #fff;
    transition: box-shadow .15s;
}
.sp-related-item:hover .sp-r-card { box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.sp-related-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #f3f4f6; display: block; }
.sp-related-name { font-size: 13px; color: #374151; padding: 8px 10px 2px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-related-price { font-size: 14px; font-weight: 700; color: #ea580c; padding: 0 10px 10px; }

.sp-rank-list { display: flex; flex-direction: column; gap: 10px; }
.sp-rank-item { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 8px; border-radius: 10px; }
.sp-rank-item:hover { background: #f9fafb; }
.sp-rank-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.sp-rank-title { font-size: 13px; color: #374151; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-rank-price { font-size: 13px; font-weight: 700; color: #ea580c; }
.sp-rank-empty, .sp-rank-empty { color: #9ca3af; font-size: 13px; padding: 8px 0; }

/* ---------- 评价 ---------- */
.sp-review-summary {
    display: flex; align-items: center; gap: 16px;
    background: #f9fafb; border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.sp-review-score-num { font-size: 32px; font-weight: 800; color: #111827; line-height: 1; }
.sp-review-score-label { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.sp-review-flex { flex: 1; }
.sp-review-subtitle { font-size: 14px; font-weight: 600; color: #374151; }
.sp-review-stars { color: #f59e0b; font-size: 16px; margin-top: 4px; letter-spacing: 2px; }
.sp-review-list { display: flex; flex-direction: column; gap: 12px; }
.sp-review-item { border-bottom: 1px solid #f1f3f5; padding-bottom: 12px; }
.sp-review-header { display: flex; align-items: center; gap: 10px; }
.sp-review-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.sp-review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-review-author { font-size: 14px; font-weight: 600; color: #111827; }
.sp-review-date { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.sp-review-rating { margin-left: auto; color: #f59e0b; font-size: 14px; letter-spacing: 1px; }
.sp-review-text { font-size: 14px; color: #4b5563; line-height: 1.7; margin-top: 8px; }
.sp-review-empty { text-align: center; color: #9ca3af; padding: 20px 0; }
.sp-review-empty-icon { font-size: 28px; margin-bottom: 6px; }

.sp-review-form { margin-top: 18px; border-top: 1px dashed #e5e7eb; padding-top: 16px; }
.sp-review-form-title { font-size: 15px; font-weight: 700; color: #111827; margin: 0 0 12px; }
.sp-form-row { margin-bottom: 12px; }
.sp-review-label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.sp-star-rating { display: flex; gap: 4px; }
.sp-star-rating span {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #d1d5db; cursor: pointer; border-radius: 6px;
}
.sp-star-rating span:hover, .sp-star-rating span.active { color: #f59e0b; background: #fffbeb; }
.sp-form-textarea {
    width: 100%; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px;
    font-size: 14px; resize: vertical; box-sizing: border-box;
}
.sp-form-textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.sp-submit-btn {
    background: #2563eb; color: #fff; border: none; border-radius: 10px;
    padding: 11px 28px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.sp-submit-btn:hover { background: #1d4ed8; }

/* ---------- 底部操作条（未登录时的登录提示；移动端固定吸底） ---------- */
.sp-footer-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 12px 16px; margin-top: 18px;
}
.sp-footer-bar-text { font-size: 13px; color: #6b7280; }
.sp-footer-bar-btn {
    background: #2563eb; color: #fff; text-decoration: none;
    padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 700;
}
.sp-footer-bar-btn:hover { background: #1d4ed8; }

/* ============================================================
   响应式：平板 / 手机
   ============================================================ */
@media (max-width: 992px) {
    .sp-main-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .sp-summary { flex-wrap: wrap; }
    .sp-summary-stats { width: 100%; }
    .sp-summary-stat, .sp-summary-stat-outline { flex: 1; justify-content: center; }

    .sp-product-grid { grid-template-columns: 1fr; }
    .sp-gallery { aspect-ratio: 4 / 3; max-height: 320px; }

    .sp-params { grid-template-columns: 1fr 1fr; }

    .sp-card { padding: 16px; }
    .sp-product-title { font-size: 19px; }
    .sp-price-current { font-size: 24px; }

    .sp-actions { position: sticky; bottom: 0; }
    .sp-btn-primary, .sp-btn-buy { flex: 1; }

    /* 移动端底部固定吸底操作条 */
    .sp-footer-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: #fff; border: 1px solid #e5e7eb; border-radius: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(16,24,40,.06);
    }
    /* 给底部固定条留出空间 */
    .product-main { padding-bottom: 80px; }
}
