/* ============================================================
   印运达 · 商品详情页样式
   依赖 layouts/app.blade.php 中的 --yd-* 变量
   ============================================================ */

.yd_pd_wrap { padding: 6px 0 16px; }

.yd_pd_card { background: #fff; border-radius: var(--yd-radius-lg); padding: 32px; margin-bottom: 24px; box-shadow: var(--yd-shadow-sm); border: 1px solid var(--yd-border); }

/* 主体两栏 */
.yd_pd_main { display: grid; grid-template-columns: 460px 1fr; gap: 40px; }

/* 左侧图片 */
.yd_pd_gallery { position: sticky; top: 90px; }
.yd_pd_img_box { width: 100%; aspect-ratio: 1; background: var(--yd-bg-soft); border-radius: var(--yd-radius-lg); overflow: hidden; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.yd_pd_img_box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.yd_pd_img_box:hover img { transform: scale(1.06); }
.yd_pd_thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.yd_pd_thumb { width: 72px; height: 72px; background: var(--yd-bg-soft); border-radius: var(--yd-radius-sm); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; flex-shrink: 0; }
.yd_pd_thumb img { width: 100%; height: 100%; object-fit: cover; }
.yd_pd_thumb:hover, .yd_pd_thumb.active { border-color: var(--yd-primary); }

/* 右侧信息 */
.yd_pd_info { display: flex; flex-direction: column; }
.yd_pd_name { font-size: 25px; font-weight: 800; color: var(--yd-text-primary); line-height: 1.4; margin-bottom: 10px; }
.yd_pd_desc { font-size: 14px; color: var(--yd-text-tertiary); line-height: 1.7; margin-bottom: 20px; }

.yd_pd_price_bar { background: var(--yd-grad-soft); border-radius: var(--yd-radius-md); padding: 20px 24px; margin-bottom: 24px; border: 1px solid var(--yd-border); }
.yd_pd_price_label { font-size: 12.5px; color: var(--yd-text-tertiary); margin-bottom: 8px; }
.yd_pd_price_row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.yd_pd_price_now { font-size: 36px; font-weight: 800; color: var(--yd-price); line-height: 1; }
.yd_pd_price_now small { font-size: 19px; }
.yd_pd_price_old { font-size: 15px; color: var(--yd-text-disabled); text-decoration: line-through; }
.yd_pd_price_save { font-size: 12px; background: var(--yd-price); color: #fff; padding: 3px 11px; border-radius: var(--yd-radius-pill); font-weight: 700; }

.yd_pd_tags { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.yd_pd_tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--yd-primary-light); color: var(--yd-primary); border-radius: var(--yd-radius-pill); font-size: 12.5px; font-weight: 600; }
.yd_pd_tag i { font-size: 11px; }

.yd_pd_attrs { margin-bottom: 24px; }
.yd_pd_attr { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--yd-border); font-size: 14px; }
.yd_pd_attr:last-child { border-bottom: none; }
.yd_pd_attr_label { color: var(--yd-text-tertiary); width: 72px; flex-shrink: 0; }
.yd_pd_attr_value { color: var(--yd-text-secondary); flex: 1; }
.yd_pd_attr_value a { color: var(--yd-primary); font-weight: 600; }
.yd_pd_attr_value a:hover { text-decoration: underline; }
.yd_pd_stock_in { display: inline-block; padding: 3px 12px; background: var(--yd-primary-light); color: var(--yd-primary-dark); border-radius: var(--yd-radius-pill); font-size: 12px; font-weight: 700; }
.yd_pd_stock_out { display: inline-block; padding: 3px 12px; background: #FEF2F2; color: #DC2626; border-radius: var(--yd-radius-pill); font-size: 12px; font-weight: 700; }

.yd_pd_qty { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.yd_pd_qty_label { font-size: 14px; color: var(--yd-text-tertiary); }
.yd_pd_qty_box { display: inline-flex; align-items: center; border: 1px solid var(--yd-border); border-radius: var(--yd-radius-sm); overflow: hidden; }
.yd_pd_qty_btn { width: 40px; height: 40px; border: none; background: var(--yd-bg-soft); color: var(--yd-text-secondary); font-size: 14px; cursor: pointer; transition: all 0.2s; }
.yd_pd_qty_btn:hover { background: var(--yd-primary); color: #fff; }
.yd_pd_qty_input { width: 58px; height: 40px; border: none; border-left: 1px solid var(--yd-border); border-right: 1px solid var(--yd-border); text-align: center; font-size: 15px; font-weight: 700; color: var(--yd-text-primary); outline: none; }

.yd_pd_btns { display: flex; gap: 14px; margin-top: auto; }
.yd_pd_btn_cart { flex: 1; padding: 14px 0; background: #fff; border: 2px solid var(--yd-primary); color: var(--yd-primary); border-radius: var(--yd-radius-pill); font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.yd_pd_btn_cart:hover { background: var(--yd-primary-light); transform: translateY(-2px); box-shadow: var(--yd-shadow-md); }
.yd_pd_btn_buy { flex: 1; padding: 14px 0; background: var(--yd-grad); border: none; color: #fff; border-radius: var(--yd-radius-pill); font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px var(--yd-primary-glow); }
.yd_pd_btn_buy:hover { transform: translateY(-2px); box-shadow: var(--yd-shadow-hover); }
.yd_pd_btn_off { flex: 1; padding: 14px 0; background: #E5E7EB; border: none; color: #9CA3AF; border-radius: var(--yd-radius-pill); font-size: 15px; font-weight: 700; cursor: not-allowed; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* 详情 + 侧边栏 */
.yd_pd_content_wrap { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: flex-start; }
.yd_pd_tabs_head { display: flex; border-bottom: 2px solid var(--yd-border); margin-bottom: 24px; }
.yd_pd_tab_btn { padding: 12px 28px; background: none; border: none; font-size: 15px; font-weight: 700; color: var(--yd-text-tertiary); cursor: pointer; position: relative; transition: color 0.2s; }
.yd_pd_tab_btn:hover { color: var(--yd-text-secondary); }
.yd_pd_tab_btn.active { color: var(--yd-primary); }
.yd_pd_tab_btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 3px; background: var(--yd-grad); border-radius: 2px; }
.yd_pd_tab_pane { display: none; }
.yd_pd_tab_pane.active { display: block; }
.yd_pd_detail_content { font-size: 14px; line-height: 1.85; color: var(--yd-text-secondary); }
.yd_pd_detail_content img { max-width: 100%; height: auto; border-radius: var(--yd-radius-sm); margin: 12px 0; }

.yd_pd_specs { width: 100%; border-collapse: collapse; }
.yd_pd_specs td { padding: 12px 16px; border: 1px solid var(--yd-border); font-size: 14px; color: var(--yd-text-secondary); }
.yd_pd_specs td:first-child { width: 140px; background: var(--yd-bg-soft); color: var(--yd-text-tertiary); font-weight: 600; }

/* 侧边栏 */
.yd_pd_sidebar { position: sticky; top: 90px; }
.yd_pd_sidebar_card { background: #fff; border-radius: var(--yd-radius-lg); padding: 22px; box-shadow: var(--yd-shadow-sm); margin-bottom: 20px; border: 1px solid var(--yd-border); }
.yd_pd_sidebar_title { font-size: 16px; font-weight: 800; color: var(--yd-text-primary); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.yd_pd_sidebar_title i { color: var(--yd-primary); font-size: 14px; }
.yd_pd_side_item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--yd-border); transition: all 0.2s; }
.yd_pd_side_item:last-child { border-bottom: none; }
.yd_pd_side_item:hover { padding-left: 4px; }
.yd_pd_side_img { width: 72px; height: 72px; background: var(--yd-bg-soft); border-radius: var(--yd-radius-sm); flex-shrink: 0; overflow: hidden; }
.yd_pd_side_img img { width: 100%; height: 100%; object-fit: cover; }
.yd_pd_side_info { flex: 1; min-width: 0; }
.yd_pd_side_name { font-size: 13px; color: var(--yd-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; margin-bottom: 6px; }
.yd_pd_side_price { font-size: 15px; font-weight: 800; color: var(--yd-price); }
.yd_pd_side_price small { font-size: 11px; }

.yd_pd_merchant_card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--yd-grad-soft); border-radius: var(--yd-radius-md); transition: all 0.2s; }
.yd_pd_merchant_card:hover { box-shadow: var(--yd-shadow-md); transform: translateY(-2px); }
.yd_pd_merchant_icon { width: 48px; height: 48px; background: var(--yd-grad); border-radius: var(--yd-radius-md); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; flex-shrink: 0; }
.yd_pd_merchant_name { font-size: 14.5px; font-weight: 700; color: var(--yd-text-primary); }
.yd_pd_merchant_label { font-size: 12px; color: var(--yd-primary); margin-top: 2px; font-weight: 600; }

/* 底部推荐 */
.yd_pd_rec_section { margin-top: 8px; }
.yd_pd_rec_header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.yd_pd_rec_title { font-size: 21px; font-weight: 800; color: var(--yd-text-primary); display: flex; align-items: center; gap: 10px; }
.yd_pd_rec_title .bar { width: 6px; height: 22px; border-radius: 3px; background: var(--yd-grad); }
.yd_pd_rec_grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

.yd_empty_box { text-align: center; padding: 48px 20px; color: var(--yd-text-disabled); }
.yd_empty_box i { font-size: 40px; margin-bottom: 12px; display: block; }

@media (max-width: 1200px) {
    .yd_pd_main { grid-template-columns: 400px 1fr; gap: 32px; }
    .yd_pd_rec_grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 991px) {
    .yd_pd_main { grid-template-columns: 1fr; gap: 24px; }
    .yd_pd_gallery, .yd_pd_sidebar { position: static; }
    .yd_pd_content_wrap { grid-template-columns: 1fr; }
    .yd_pd_rec_grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .yd_pd_card { padding: 20px; }
    .yd_pd_name { font-size: 20px; }
    .yd_pd_price_now { font-size: 29px; }
    .yd_pd_btns { flex-direction: column; }
    .yd_pd_rec_grid { grid-template-columns: repeat(2, 1fr); }
}
