/*!
 * 易优CMS 增强多规格购买组件 shopbuy.css
 * 自包含样式（前缀 sb-），不依赖主题皮肤，可直接套用。
 */
[data-role="eyou_shopbuy-box"] {
    display: block;
}
.sb-box {
    font-family: inherit;
    color: #333;
    line-height: 1.5;
}
.sb-loading,
.sb-error {
    padding: 12px 0;
    color: #999;
    font-size: 14px;
}

/* ---- 价格区（合计） ---- */
.sb-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.sb-price-label {
    color: #666;
    font-size: 14px;
}
.sb-price-now {
    color: #f00;
    font-weight: 700;
    font-size: 24px;
}
.sb-price-now em {
    font-style: normal;
}

/* ---- 顶部颜色色卡区 ---- */
.sb-swatches {
    margin: 8px 0 14px;
}
.sb-swatch-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}
.sb-spec-name {
    flex: 0 0 auto;
    min-width: 58px;
    padding-top: 8px;
    color: #666;
    font-size: 14px;
}
.sb-swatch-values {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.sb-swatch {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all .15s;
    text-decoration: none;
    width: 72px;
}
.sb-swatch:hover {
    border-color: #f00;
    text-decoration: none;
}
.sb-swatch.sb-active {
    border-color: #f00;
    box-shadow: 0 0 0 1px #f00;
    color: #f00;
}
.sb-swatch.sb-disabled {
    border-color: #eee;
    opacity: .45;
    cursor: not-allowed;
}
.sb-swatch-img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
    background: #f7f7f7;
}
.sb-swatch-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sb-swatch-name {
    font-size: 12px;
    line-height: 1.2;
}

/* ---- 颜色并排图片卡片（左侧竖排"颜色"标签） ---- */
.sb-spec-tabs-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.sb-spec-tabs-label {
    color: #666;
    font-weight: 600;
    letter-spacing: 3px;
    height: 146px;
    padding: 50px 10px;
    background: #F5F5F5;
    font-weight: bold;
    font-size: 16px;
    line-height: 25px;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.sb-spec-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.sb-spec-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 116px;
	height:146px;
    border: 2px solid #e5e9f0;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    background: #fff;
    transition: all .15s;
    user-select: none;
    position: relative;
}
.sb-spec-tab:hover { border-color: #e5484d; color: #e5484d; }
.sb-spec-tab.active {
    border-color: #e5484d;
    color: #e5484d;
    background: #fff5f5;
    font-weight: 600;
}
.sb-spec-tab.active::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 11px;
    color: #fff;
    background: #e5484d;
    border-radius: 50%;
}
.sb-spec-tab-img {
    width: 112px;
    height: 112px;
    display: block;
    overflow: hidden;
    background: #f7f7f7;
}
.sb-spec-tab-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 0;
}
.sb-spec-tab-name { font-size: 12px; line-height: 1.2; text-align: center; }
.sb-spec-pane { display: none; }
.sb-spec-pane.active { display: block; }

/* ---- 每个颜色的规格×数量区块 ---- */
.sb-spec-blocks {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 8px 0;
}
.sb-spec-block {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.sb-spec-block-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}
.sb-block-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
    border: 1px solid #e5e5e5;
    background: #f7f7f7;
}
.sb-block-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sb-block-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ---- 规格×数量表格 ---- */
.sb-grid {
    border: 1px solid #eee;
    border-radius: 6px;
    margin: 8px 0 6px;
    overflow: hidden;
}
.sb-grid-head,
.sb-grid-row {
    display: grid;
    grid-template-columns: 88px 1fr 1.4fr;
    align-items: center;
    padding: 10px 14px;
}
.sb-grid-head {
    background: #fafafa;
    color: #999;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.sb-grid-row {
    border-bottom: 1px solid #f2f2f2;
    font-size: 14px;
}
.sb-grid-row:last-child {
    border-bottom: 0;
}
.sb-cell-spec {
    color: #333;
    font-weight: 500;
}
.sb-cell-price {
    color: #f00;
    font-weight: 600;
}
.sb-cell-price.sb-invalid {
    color: #bbb;
    font-weight: normal;
}
.sb-cell-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sb-row-stock {
    color: #999;
    font-size: 12px;
}
.sb-row-stock.sb-out {
    color: #f00;
}
.sb-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.sb-qty-btn {
    width: 30px;
    height: 30px;
    border: 0;
    background: #f7f7f7;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: background .15s;
}
.sb-qty-btn:hover {
    background: #eee;
}
.sb-qty-btn:disabled,
.sb-qty-btn.sb-disabled {
    color: #ccc;
    background: #f6f6f6;
    cursor: not-allowed;
    opacity: .6;
}
/* 售罄/无此规格行：整行置灰，不允许增加数量 */
.sb-row-out {
    opacity: .55;
}
.sb-row-out .sb-cell-spec,
.sb-row-out .sb-cell-price {
    color: #999;
}
.sb-qty-input {
    width: 46px;
    height: 30px;
    border: 0;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    color: #333;
    outline: none;
}

/* ---- 单数量（退化模式） ---- */
.sb-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}
.sb-qty-label {
    color: #666;
    font-size: 14px;
}
.sb-stock {
    color: #999;
    font-size: 13px;
}
.sb-stock.sb-out {
    color: #f00;
}

/* ---- 操作区 ---- */
.sb-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}
.sb-btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    text-decoration: none;
}
.sb-btn-cart {
    color: #fff;
    background: #f00;
    border-color: #f00;
}
.sb-btn-cart:hover {
    background: #e00000;
    color: #fff;
    text-decoration: none;
}
.sb-btn-fav {
    color: #fff;
    background: #ff7f00;
    border-color: #ff7f00;
}
.sb-btn-fav:hover {
    background: #f07700;
    color: #fff;
    text-decoration: none;
}
.sb-btn.sb-disabled {
    background: #f0f0f0;
    border-color: #e5e5e5;
    color: #bbb;
    cursor: not-allowed;
}
.sb-btn.sb-disabled:hover {
    background: #f0f0f0;
    color: #bbb;
}

/* 手机端回退为原样：颜色 tab 胶囊 + 尺码表含库存列，无竖排"颜色"标签 */
@media (max-width: 767px){
    .sb-spec-tabs-wrap{ display:block; margin:8px 0 14px; padding-bottom:10px; border-bottom:1px solid #eee; }
    .sb-spec-tabs-label{ display:none; }
    .sb-spec-tabs{ display:flex; flex-wrap:wrap; gap:8px; }
    .sb-spec-tab{ display:inline-flex; flex-direction:row; align-items:center; gap:6px; width:auto; min-height:30px; box-sizing:border-box; padding: 6px; height: 35px;}
    .sb-spec-tab.active::after{ content:none; }
    .sb-spec-tab-img{ width:24px; height:24px; border-radius:4px; }
    .sb-spec-tab-img img{ width:24px; height:24px; border-radius:4px; border:1px solid #eee; }
    .sb-spec-tab-name{ font-size:13px; }
}