/*!
 * shopxo 主题 —— 商品详情页
 * JS 钩子类名保持不变：.product-gallery / .gallery-top / .gallery-thumbs
 *                      .goods-spec / .quantity / .quantity-text / .btn-cart / .btn-buynow
 *                      .btn-collect / .btn-share / .btn-coupon
 */

/* ===================== 主体 ===================== */
.sx-goods-main {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.sx-goods-top {
    display: flex;
    align-items: flex-start;
}

.sx-gallery {
    flex: 0 0 420px;
    width: 420px;
    margin-right: 30px;
}

.sx-gallery .swiper-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.sx-gallery .swiper-slide {
    background-size: cover;
    background-position: center;
}

.sx-gallery .gallery-top {
    height: 420px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.sx-gallery .gallery-thumbs {
    height: 72px;
    margin-top: 10px;
}

.sx-gallery .gallery-thumbs .swiper-slide {
    width: 72px;
    height: 72px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    opacity: .75;
    cursor: pointer;
}

.sx-gallery .gallery-thumbs .swiper-slide:hover {
    opacity: 1;
}

.sx-gallery .gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--color-main);
}

.sx-gallery .swiper-button-prev,
.sx-gallery .swiper-button-next {
    opacity: 0;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    background: rgba(0, 0, 0, .3);
    border-radius: 50%;
    color: #fff;
    line-height: 36px;
    text-align: center;
}

.sx-gallery:hover .swiper-button-prev,
.sx-gallery:hover .swiper-button-next {
    opacity: .8;
}

.sx-gallery .sx-gallery-bar {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-weak);
}

.sx-gallery .sx-gallery-bar a {
    margin-right: 16px;
    color: var(--color-weak);
    text-decoration: none;
}

.sx-gallery .sx-gallery-bar a:hover {
    color: var(--color-main);
}

/* ===================== 购买区 ===================== */
.sx-buy {
    flex: 1;
    min-width: 0;
}

.sx-buy-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-title);
    margin-bottom: 6px;
}

.sx-buy-subtitle {
    font-size: 13px;
    color: var(--color-weak);
    margin-bottom: 12px;
}

.sx-price-box {
    display: flex;
    align-items: baseline;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(90deg, #fff5f4 0%, #ffffff 100%);
}

.sx-price-box .sx-price {
    color: var(--color-price);
    font-size: 26px;
    font-weight: 700;
}

.sx-price-box .sx-price .sx-cur {
    font-size: 16px;
    font-weight: normal;
}

.sx-price-box .sx-market {
    margin-left: 12px;
    color: var(--color-weak);
    font-size: 13px;
}

/* 参数行 */
.sx-var-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
}

.sx-var-label {
    flex: 0 0 76px;
    color: var(--color-weak);
    font-size: 13px;
    line-height: 30px;
}

.sx-var-value {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--color-title);
    line-height: 30px;
}

/* 规格选择 */
.goods-spec-text {
    margin: 0;
    padding: 0;
    list-style: none;
}

.goods-spec-text li {
    position: relative;
    display: inline-block;
    margin: 0 8px 8px 0;
    list-style: none;
}

.goods-spec-text li a {
    display: block;
    min-width: 44px;
    padding: 5px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--border-radius-sm);
    background: #fff;
    color: var(--color-sub);
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.goods-spec-text li a:hover {
    border-color: var(--color-main);
    color: var(--color-main);
}

.goods-spec-text li.selected a {
    border-color: var(--color-main);
    background: var(--color-main-light);
    color: var(--color-main);
}

.goods-spec-text li.disabled a {
    border-color: var(--color-border);
    background: var(--color-bg-gray);
    color: #ccc;
    cursor: not-allowed;
}

/* 优惠券 */
.sx-coupons {
    display: flex;
    flex-wrap: wrap;
}

.sx-coupons .item {
    margin: 0 8px 8px 0;
    list-style: none;
}

.sx-coupons .coupon-text {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--color-main);
    border-radius: var(--border-radius-sm);
    color: var(--color-main);
    font-size: 12px;
    text-decoration: none;
}

/* 数量 */
.quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    height: 30px;
}

.quantity > div {
    width: 30px;
    height: 100%;
    line-height: 30px;
    text-align: center;
    background: var(--color-bg-soft);
    color: var(--color-sub);
    cursor: pointer;
    user-select: none;
}

.quantity > div:hover {
    background: var(--color-main-light);
    color: var(--color-main);
}

.quantity .quantity-text {
    width: 56px;
    height: 100%;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    text-align: center;
    font-size: 13px;
    color: var(--color-title);
}

.quantity .quantity-text:focus {
    outline: none;
    box-shadow: none;
}

/* 购买按钮 */
.sx-actions {
    display: flex;
    align-items: center;
    margin-top: 22px;
}

.sx-actions .sx-btn {
    min-width: 150px;
    height: 44px;
    padding: 0 30px;
    font-size: 14px;
    line-height: 42px;
}

.sx-actions .sx-btn + .sx-btn {
    margin-left: 12px;
}

.sx-actions .btn-cart i {
    margin-right: 6px;
}

/* ===================== 下方两栏 ===================== */
.sx-goods-lower {
    display: flex;
    align-items: flex-start;
}

.sx-goods-lower .sx-side {
    flex: 0 0 240px;
    width: 240px;
    margin-right: 16px;
}

.sx-goods-lower .sx-content {
    flex: 1;
    min-width: 0;
}

.sx-mini-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 12px;
}

/* 侧栏区块标题（推荐商品 / 热销商品）：沿用全站区块头规范
   （原型 .p-sec-head：2px 主橙底边 + 16px/700 标题） */
.sx-mini-card h3 {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-main);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-title);
}

.sx-mini-goods {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-border);
}

.sx-mini-goods:last-child {
    border-bottom: 0;
}

.sx-mini-goods img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin-right: 10px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    background: var(--color-bg-soft);
}

.sx-mini-goods .sx-mini-body {
    flex: 1;
    min-width: 0;
}

.sx-mini-goods .sx-mini-title {
    height: 34px;
    overflow: hidden;
    font-size: 12px;
    line-height: 17px;
    color: var(--color-text);
}

.sx-mini-goods .sx-mini-title a {
    color: inherit;
    text-decoration: none;
}

.sx-mini-goods .sx-mini-title a:hover {
    color: var(--color-main);
}

.sx-mini-goods .sx-mini-price {
    margin-top: 4px;
    color: var(--color-price);
    font-size: 13px;
    font-weight: 600;
}

/* ===================== 详情 tab ===================== */
.sx-tabs {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

.sx-tabs .sx-tabs-head {
    display: flex;
    border-bottom: 1px solid var(--color-border);
}

.sx-tabs .sx-tabs-head li {
    list-style: none;
}

.sx-tabs .sx-tabs-head li a {
    display: block;
    padding: 14px 26px;
    color: var(--color-sub);
    font-size: 15px;
    text-decoration: none;
}

.sx-tabs .sx-tabs-head li.active a {
    color: var(--color-main);
    font-weight: 600;
    border-bottom: 2px solid var(--color-main);
}

.sx-tabs .sx-tabs-body {
    padding: 22px;
}

.sx-tabs .sx-tab-pane {
    display: none;
}

.sx-tabs .sx-tab-pane.active {
    display: block;
}

.sx-attrs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--color-border);
}

.sx-attrs > div {
    width: 33.3333%;
    padding: 3px 0;
    font-size: 13px;
    color: var(--color-sub);
}

.sx-attrs b {
    color: var(--color-title);
    font-weight: 400;
}

.sx-detail-content {
    line-height: 1.9;
    color: var(--color-text);
}

.sx-detail-content img {
    max-width: 100%;
}

.sx-guarantee {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px dashed var(--color-border);
}

.sx-guarantee img {
    width: 46px;
    height: 46px;
    margin-right: 14px;
    border-radius: 50%;
    object-fit: cover;
}

.sx-guarantee .sx-guarantee-name {
    font-weight: 600;
    color: var(--color-title);
}

.sx-guarantee .sx-guarantee-intro {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-weak);
}

/* ===================== 响应式 ===================== */
@media only screen and (max-width: 1024px) {
    .sx-goods-top {
        display: block;
    }

    .sx-gallery {
        width: 100%;
        margin: 0 0 20px;
    }

    .sx-gallery .gallery-top {
        height: 380px;
    }

    .sx-goods-lower .sx-side {
        display: none;
    }
}
