/* ============================================
   product.css — 包印网商城 商品详情页
   布局：面包屑 → 两栏（左图库[竖排缩略图在主图左侧] + 右信息）→ 墨蓝 sticky 锚点条
        → 全宽详情白卡 → 商家信息 → 服务保障 → 相关推荐
        与上一版「底部横排缩略图 + 详情左内容右侧栏」明显不同
   配色：品牌墨蓝 #04539F + 亮蓝 #198DFB + 阳光橙 #F5871F + 暖纸白底 #F6F4F0
   类名前缀：by_p_ （商品卡片复用 app.css 的 .by_pcard）
   ============================================ */

.by_p_page { background: var(--by-paper); padding-bottom: 50px; }
.by_p_wrap { max-width: 1300px; margin: 0 auto; padding: 20px; }

/* ============================================
   ① 面包屑
   ============================================ */
.by_p_crumb_bar { background: #fff; border-bottom: 1px solid var(--by-line); }
.by_p_crumb { max-width: 1300px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; height: 46px; font-size: 13px; color: var(--by-ink-3); }
.by_p_crumb a { color: var(--by-ink-2); transition: color .18s; }
.by_p_crumb a:hover { color: var(--by-blue); }
.by_p_crumb .sep { color: var(--by-line); }
.by_p_crumb .cur { color: var(--by-blue-deep); font-weight: 600; }

/* ============================================
   ② 主信息区
   ============================================ */
.by_p_main { display: grid; grid-template-columns: 500px 1fr; gap: 30px; background: #fff; border: 1px solid var(--by-line); border-radius: var(--by-radius-lg); padding: 24px; }

/* ---------- 左：图库（竖排缩略图 + 主图） ---------- */
.by_p_gallery { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: start; }
.by_p_gallery_solo { grid-template-columns: 1fr; }

.by_p_thumbs { display: flex; flex-direction: column; gap: 9px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.by_p_thumbs::-webkit-scrollbar { width: 4px; }
.by_p_thumbs::-webkit-scrollbar-thumb { background: var(--by-line); border-radius: 2px; }
.by_p_thumb { width: 70px; height: 70px; flex-shrink: 0; border: 2px solid var(--by-line); border-radius: var(--by-radius); overflow: hidden; background: var(--by-paper); cursor: pointer; transition: all .18s; }
.by_p_thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.by_p_thumb:hover { border-color: var(--by-blue-soft); }
.by_p_thumb.active { border-color: var(--by-orange); box-shadow: 0 0 0 3px var(--by-orange-tint); }

.by_p_bigimg { position: relative; border: 1px solid var(--by-line); border-radius: var(--by-radius); overflow: hidden; background: var(--by-paper); aspect-ratio: 1 / 1; }
.by_p_bigimg img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.by_p_tags { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.by_p_tag { height: 23px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: var(--by-radius-sm); font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #fff; }
.by_p_tag_new { background: var(--by-blue); }
.by_p_tag_hot { background: var(--by-grad-orange); }
.by_p_tag_rec { background: var(--by-navy); }

/* ---------- 右：信息 ---------- */
.by_p_info { min-width: 0; display: flex; flex-direction: column; }
.by_p_name { font-size: 22px; font-weight: 700; color: var(--by-navy); line-height: 1.5; }
.by_p_subtitle { margin-top: 9px; font-size: 13px; line-height: 1.8; color: var(--by-ink-2); }

/* 价格卡：浅橙底 + 橙描边（不同于上一版深炭灰卡） */
.by_p_price_box { margin-top: 16px; background: var(--by-orange-tint); border: 1px solid var(--by-orange-soft); border-left: 4px solid var(--by-orange); border-radius: var(--by-radius); padding: 14px 18px; }
.by_p_price_label { font-size: 12px; color: var(--by-orange-deep); letter-spacing: .5px; }
.by_p_price_row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.by_p_price_cur { font-size: 34px; font-weight: 900; color: var(--by-orange-deep); line-height: 1.1; letter-spacing: -.5px; }
.by_p_price_cur::before { content: '¥'; font-size: 17px; font-weight: 700; margin-right: 2px; }
.by_p_price_old { font-size: 14px; color: var(--by-ink-3); text-decoration: line-through; }
.by_p_price_save { font-size: 12px; font-weight: 700; color: #fff; background: #E4572E; border-radius: var(--by-radius-sm); padding: 3px 9px; }

/* 服务承诺小条 */
.by_p_promise_strip { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.by_p_promise_strip span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--by-ink-2); }
.by_p_promise_strip i { color: var(--by-blue); font-size: 12px; }

/* 销量 / 浏览 */
.by_p_meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding: 12px 0; border-top: 1px dashed var(--by-line); border-bottom: 1px dashed var(--by-line); font-size: 12.5px; color: var(--by-ink-3); }
.by_p_meta strong { color: var(--by-orange-deep); font-weight: 800; font-size: 14px; margin: 0 2px; }
.by_p_meta > span > i { margin-right: 5px; }
.by_p_meta_tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 9px; border-radius: var(--by-radius-sm); font-size: 11px; font-weight: 700; color: #fff; }
.by_p_meta_tag_new { background: var(--by-blue); }
.by_p_meta_tag_hot { background: var(--by-orange); }

/* 规格选择 */
.by_p_specs { margin-top: 16px; }
.by_p_spec_group { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.by_p_spec_label { flex: 0 0 56px; font-size: 13px; color: var(--by-ink-3); line-height: 34px; }
.by_p_spec_values { display: flex; flex-wrap: wrap; gap: 8px; }
.by_p_spec_btn { min-width: 54px; height: 34px; padding: 0 14px; border: 1px solid var(--by-line); border-radius: var(--by-radius-sm); background: #fff; font-size: 13px; color: var(--by-ink); font-family: inherit; transition: all .16s; }
.by_p_spec_btn:hover { border-color: var(--by-blue); color: var(--by-blue); }
.by_p_spec_btn.active { border-color: var(--by-orange); background: var(--by-orange-tint); color: var(--by-orange-deep); font-weight: 700; }
.by_p_spec_btn.disabled { background: var(--by-paper); color: var(--by-ink-3); cursor: not-allowed; text-decoration: line-through; }
.by_p_spec_tip { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--by-ink-3); background: var(--by-paper); border-radius: var(--by-radius-sm); padding: 8px 12px; }
.by_p_spec_tip i { color: var(--by-blue); }

/* 属性表 */
.by_p_attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; margin-top: 16px; }
.by_p_attr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--by-line-soft); font-size: 13px; }
.by_p_attr_k { flex: 0 0 48px; color: var(--by-ink-3); }
.by_p_attr_v { color: var(--by-ink); min-width: 0; }
.by_p_attr_v a { color: var(--by-blue); }
.by_p_attr_v a:hover { color: var(--by-orange-deep); }
.by_p_stock_ok { display: inline-flex; align-items: center; gap: 5px; color: #1F9D55; }
.by_p_stock_out { display: inline-flex; align-items: center; gap: 5px; color: #E4572E; }

/* 数量 + 按钮 */
.by_p_form { margin-top: 18px; }
.by_p_qty_wrap { display: flex; align-items: center; gap: 14px; }
.by_p_qty_label { font-size: 13px; color: var(--by-ink-3); }
.by_qty { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--by-line); border-radius: var(--by-radius-sm); overflow: hidden; }
.by_qty button { width: 36px; border: none; background: var(--by-paper); color: var(--by-ink-2); font-size: 16px; transition: all .16s; }
.by_qty button:hover:not(:disabled) { background: var(--by-blue); color: #fff; }
.by_qty button:disabled { color: var(--by-ink-3); cursor: not-allowed; }
.by_qty input { width: 58px; border: none; border-left: 1px solid var(--by-line); border-right: 1px solid var(--by-line); text-align: center; font-size: 14px; font-weight: 700; color: var(--by-ink); font-family: inherit; -moz-appearance: textfield; }
.by_qty input::-webkit-outer-spin-button, .by_qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.by_p_actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.by_p_btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 50px; border: none; border-radius: var(--by-radius); font-size: 16px; font-weight: 700; letter-spacing: 1px; font-family: inherit; transition: all .18s; }
.by_p_btn_cart { border: 2px solid var(--by-blue); background: #fff; color: var(--by-blue-deep); }
.by_p_btn_cart:hover:not(:disabled) { background: var(--by-blue); color: #fff; }
.by_p_btn_buy { background: var(--by-grad-orange); color: #fff; box-shadow: var(--by-shadow-orange); }
.by_p_btn_buy:hover:not(:disabled) { filter: brightness(1.07); }
.by_p_btn:disabled, .by_p_btn_disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.by_p_btn_fav { flex: 0 0 auto; width: 50px; height: 50px; border: 1px solid var(--by-line); border-radius: var(--by-radius); background: #fff; color: var(--by-ink-3); font-size: 18px; transition: all .18s; }
.by_p_btn_fav:hover, .by_p_btn_fav.active { border-color: #E4572E; color: #E4572E; }

/* 所属商家小卡 */
.by_p_mch_inline { display: flex; align-items: center; gap: 13px; margin-top: 18px; padding: 14px 16px; background: var(--by-blue-tint); border: 1px solid var(--by-line-blue); border-radius: var(--by-radius); transition: all .18s; }
.by_p_mch_inline:hover { border-color: var(--by-blue); }
.by_p_mch_inline_logo { width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--by-radius-sm); overflow: hidden; background: #fff; color: var(--by-blue-deep); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }
.by_p_mch_inline_logo img { width: 100%; height: 100%; object-fit: cover; }
.by_p_mch_inline_text { min-width: 0; flex: 1; }
.by_p_mch_inline_name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--by-ink); }
.by_p_mch_tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #1F9D55; background: #fff; border-radius: var(--by-radius-sm); padding: 2px 8px; }
.by_p_mch_inline_count { margin-top: 5px; font-size: 12px; color: var(--by-ink-3); }
.by_p_mch_inline_count i { margin-right: 5px; }
.by_p_mch_inline_more { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--by-blue); }

/* ============================================
   ③ Sticky 锚点条 —— 墨蓝底 + 橙色胶囊
   ============================================ */
.by_p_anchor { position: sticky; top: 48px; z-index: 80; display: flex; align-items: center; gap: 4px; margin-top: 18px; padding: 8px 14px; background: var(--by-grad-navy-bar); border-radius: var(--by-radius); overflow-x: auto; }
.by_p_anchor a { display: inline-flex; align-items: center; height: 32px; padding: 0 18px; border-radius: var(--by-radius-lg); font-size: 14px; font-weight: 600; color: rgba(255,255,255,.78); white-space: nowrap; transition: all .18s; }
.by_p_anchor a:hover { color: #fff; background: rgba(255,255,255,.1); }
.by_p_anchor a.active { background: var(--by-orange); color: #fff; }

/* ============================================
   ④ 区块通用
   ============================================ */
.by_p_sec { background: #fff; border: 1px solid var(--by-line); border-radius: var(--by-radius-lg); padding: 24px 26px; margin-top: 16px; scroll-margin-top: 110px; }
.by_p_sec_title { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 800; color: var(--by-navy); padding-bottom: 14px; margin-bottom: 20px; border-bottom: 1px solid var(--by-line); letter-spacing: .5px; }
.by_p_sec_title::before { content: ''; width: 5px; height: 20px; border-radius: 3px; background: var(--by-grad-orange); }
.by_p_sec_title small { font-size: 11.5px; font-weight: 600; color: var(--by-ink-3); letter-spacing: 1.5px; }

/* 详情富文本 */
.by_p_content { font-size: 14.5px; line-height: 2; color: var(--by-ink); }
.by_p_content p { margin-bottom: 14px; }
.by_p_content img { max-width: 100%; height: auto; border-radius: var(--by-radius); margin: 8px auto; }
/* CKEditor 上传的图片常带内联 width:750px 的 figure，窄屏会撑破页面 */
.by_p_content figure { max-width: 100% !important; margin: 12px auto; }
.by_p_content figure.image, .by_p_content figure.image_resized { max-width: 100% !important; }
.by_p_content figure figcaption { font-size: 12.5px; color: var(--by-ink-3); text-align: center; padding-top: 8px; }
.by_p_content table { max-width: 100%; border-collapse: collapse; }
.by_p_content table td, .by_p_content table th { border: 1px solid var(--by-line); padding: 8px 12px; }
.by_p_content h1, .by_p_content h2, .by_p_content h3 { color: var(--by-navy); margin: 18px 0 10px; }
.by_p_content_empty { padding: 56px 20px; text-align: center; color: var(--by-ink-3); }
.by_p_content_empty i { font-size: 34px; color: var(--by-line); }
.by_p_content_empty p { margin-top: 12px; font-size: 13.5px; }

/* ============================================
   ⑤ 商家信息
   ============================================ */
.by_p_mch_grid { display: grid; grid-template-columns: 110px 1fr; gap: 24px; align-items: start; }
.by_p_mch_logo_big { width: 110px; height: 110px; border-radius: var(--by-radius); overflow: hidden; background: var(--by-blue-tint); color: var(--by-blue-deep); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; }
.by_p_mch_logo_big img { width: 100%; height: 100%; object-fit: cover; }
.by_p_mch_body { min-width: 0; }
.by_p_mch_name { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 19px; font-weight: 800; color: var(--by-navy); }
.by_p_mch_info_grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin-top: 16px; }
.by_p_mch_info_item { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.75; color: var(--by-ink-3); }
.by_p_mch_info_item i { width: 15px; text-align: center; color: var(--by-blue); margin-top: 4px; flex-shrink: 0; }
.by_p_mch_info_item strong { font-weight: 600; color: var(--by-ink); }
.by_p_mch_desc { margin-top: 16px; padding: 14px 16px; background: var(--by-paper); border-radius: var(--by-radius); font-size: 13px; line-height: 1.9; color: var(--by-ink-2); }
.by_p_mch_btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.by_p_mch_btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; border: 1px solid var(--by-line); border-radius: var(--by-radius); font-size: 13.5px; font-weight: 600; color: var(--by-ink-2); transition: all .18s; }
.by_p_mch_btn:hover { border-color: var(--by-blue); color: var(--by-blue); }
.by_p_mch_btn_main { background: var(--by-grad-blue); border-color: transparent; color: #fff; }
.by_p_mch_btn_main:hover { filter: brightness(1.08); color: #fff; }

/* ============================================
   ⑥ 服务保障
   ============================================ */
.by_p_promise_grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.by_p_promise_card { background: var(--by-paper); border: 1px solid var(--by-line); border-radius: var(--by-radius); padding: 20px 18px; transition: all .2s; }
.by_p_promise_card:hover { border-color: var(--by-orange); background: #fff; box-shadow: var(--by-shadow-sm); }
.by_p_promise_icon { width: 44px; height: 44px; border-radius: var(--by-radius); background: var(--by-grad-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; }
.by_p_promise_card:hover .by_p_promise_icon { background: var(--by-grad-orange); }
.by_p_promise_card h3 { font-size: 15px; font-weight: 700; color: var(--by-ink); margin-top: 14px; }
.by_p_promise_card p { font-size: 12.5px; line-height: 1.85; color: var(--by-ink-3); margin-top: 8px; }

/* ============================================
   ⑦ 相关推荐
   ============================================ */
.by_p_related_grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1100px) {
    .by_p_main { grid-template-columns: 420px 1fr; gap: 22px; }
    .by_p_related_grid { grid-template-columns: repeat(4, 1fr); }
    .by_p_related_grid > :nth-child(5) { display: none; }
}

@media (max-width: 900px) {
    .by_p_main { grid-template-columns: 1fr; padding: 18px; }
    .by_p_gallery { grid-template-columns: 1fr; }
    .by_p_thumbs { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; order: 2; padding-bottom: 4px; }
    .by_p_bigimg { order: 1; aspect-ratio: 4 / 3; }
    .by_p_name { font-size: 19px; }
    .by_p_price_cur { font-size: 28px; }
    .by_p_attrs { grid-template-columns: 1fr; }
    .by_p_mch_grid { grid-template-columns: 1fr; gap: 16px; }
    .by_p_mch_logo_big { width: 74px; height: 74px; font-size: 28px; }
    .by_p_mch_info_grid { grid-template-columns: 1fr; }
    .by_p_promise_grid { grid-template-columns: repeat(2, 1fr); }
    .by_p_related_grid { grid-template-columns: repeat(3, 1fr); }
    .by_p_related_grid > :nth-child(4) { display: none; }
    .by_p_anchor { top: 0; }
}

@media (max-width: 768px) {
    .by_p_wrap { padding: 14px; }
    .by_p_crumb { padding: 0 14px; }
    .by_p_sec { padding: 18px 16px; }
    .by_p_sec_title { font-size: 17px; }
    .by_p_sec_title small { display: none; }
    .by_p_actions { gap: 8px; }
    .by_p_btn { height: 46px; font-size: 14.5px; padding: 0 10px; }
    .by_p_btn_fav { width: 46px; height: 46px; }
    .by_p_promise_grid { gap: 10px; }
    .by_p_related_grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .by_p_related_grid > :nth-child(3) { display: none; }
    .by_p_content { font-size: 14px; }
}
