/* Product detail page */
.shop-h5.shop-page-product {
    background: var(--shop-bg);
    padding-bottom: 0;
}

.shop-h5.shop-page-product .shop-h5-body {
    padding-bottom: calc(var(--shop-tabbar-h) + 76px + var(--shop-safe-bottom));
}

.shop-pd-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.shop-pd-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--shop-border);
}

.shop-pd-back,
.shop-pd-cart-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text);
    text-decoration: none;
    border-radius: 999px;
    font-size: 20px;
}

.shop-pd-back:active,
.shop-pd-cart-link:active {
    background: rgba(15, 23, 42, 0.06);
}

.shop-pd-topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--shop-text);
}

.shop-pd-cover {
    background: var(--shop-bg-elevated);
    padding: 20px 16px;
    text-align: center;
}

.shop-pd-main-img {
    width: 100%;
    max-width: 340px;
    max-height: min(340px, 42vh);
    aspect-ratio: 1;
    object-fit: contain;
    height: auto;
    border-radius: var(--shop-radius-sm);
    background: linear-gradient(135deg, #fafbfc, #f3f4f6);
    box-shadow: var(--shop-shadow-sm);
}

.shop-pd-price-card {
    margin: 12px 12px 0;
    padding: 16px 18px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 60%);
    border-radius: var(--shop-radius);
    box-shadow: var(--shop-shadow-sm);
    border: 1px solid rgba(239, 68, 68, 0.08);
}

.shop-pd-price-row {
    display: flex;
    align-items: baseline;
    color: var(--shop-danger);
    margin-bottom: 10px;
}

.shop-pd-price-symbol {
    font-size: 18px;
    font-weight: 700;
    margin-right: 2px;
}

.shop-pd-price-num {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.shop-pd-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--shop-text);
    margin: 0 0 6px;
    line-height: 1.45;
}

.shop-pd-subtitle {
    font-size: 13px;
    color: var(--shop-text-secondary);
    margin: 0 0 12px;
    line-height: 1.5;
}

.shop-pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-pd-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--shop-danger);
    background: var(--shop-danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    padding: 3px 10px;
}

.shop-pd-panel {
    margin: 12px 12px 0;
    padding: 16px 18px;
    background: var(--shop-bg-elevated);
    border-radius: var(--shop-radius);
    box-shadow: var(--shop-shadow-sm);
}

.shop-pd-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shop-pd-panel-head {
    font-size: 15px;
    font-weight: 700;
    color: var(--shop-text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--shop-border-light);
}

.shop-pd-panel-row .shop-pd-panel-head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.shop-pd-panel-detail {
    margin-bottom: 16px;
}

.shop-sku-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-sku-chip {
    border: 1.5px solid var(--shop-border);
    background: #fafbfc;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--shop-text-secondary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.shop-sku-chip.is-active {
    border-color: var(--shop-brand);
    color: var(--shop-brand);
    background: var(--shop-brand-soft);
    box-shadow: 0 0 0 1px var(--shop-brand) inset;
}

.shop-sku-chip.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shop-spec-picker {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shop-spec-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
}

.shop-spec-group + .shop-spec-group {
    border-top: 1px dashed var(--shop-border-light);
}

.shop-spec-group:first-child {
    padding-top: 4px;
}

.shop-spec-group:last-child {
    padding-bottom: 4px;
}

.shop-spec-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--shop-text);
    line-height: 1.3;
}

.shop-spec-label::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--shop-brand);
    flex-shrink: 0;
}

.shop-spec-selected-val {
    margin-left: 4px;
    font-weight: 700;
    color: var(--shop-brand);
}

.shop-spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-spec-chip {
    min-width: 52px;
    min-height: 40px;
    padding: 8px 18px;
    border: 1.5px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    cursor: pointer;
    touch-action: manipulation;
}

.shop-spec-chip:active:not(:disabled) {
    transform: scale(0.97);
}

.shop-spec-chip.is-active {
    border-color: var(--shop-brand);
    color: var(--shop-brand);
    background: var(--shop-brand-soft);
    box-shadow: 0 0 0 1px var(--shop-brand) inset;
}

/* 等待上一维度：清晰可见但不可点 */
.shop-spec-chip.is-pending,
.shop-spec-group.is-locked .shop-spec-chip {
    border-style: dashed;
    border-color: #94a3b8;
    background: #f8fafc;
    color: #475569;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
}

/* 无货组合 */
.shop-spec-chip.is-disabled:not(.is-pending) {
    border-color: #e5e7eb;
    background: #f3f4f6;
    color: #9ca3af;
    opacity: 1;
    cursor: not-allowed;
    text-decoration: line-through;
}

.shop-spec-group.is-locked .shop-spec-options {
    pointer-events: none;
}

.shop-spec-hint {
    display: none;
    margin: -4px 0 0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    line-height: 1.4;
}

.shop-spec-hint.is-visible {
    display: block;
}

.shop-spec-group:not(.is-locked) .shop-spec-hint {
    display: none !important;
}

.shop-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--shop-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--shop-bg-elevated);
}

.shop-qty-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: #f9fafb;
    font-size: 18px;
    line-height: 1;
    color: var(--shop-text);
    cursor: pointer;
    touch-action: manipulation;
}

.shop-qty-stepper input {
    width: 46px;
    height: 38px;
    border: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.shop-qty-stepper input::-webkit-outer-spin-button,
.shop-qty-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.shop-pd-bar {
    position: fixed;
    bottom: calc(var(--shop-tabbar-h) + var(--shop-safe-bottom));
    z-index: 120;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--shop-border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    padding: 10px var(--shop-page-pad-x);
    box-sizing: border-box;
}

.shop-pd-bar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-pd-bar-price {
    flex: 0 0 auto;
    min-width: 72px;
}

.shop-pd-bar-label {
    display: block;
    font-size: 11px;
    color: var(--shop-text-muted);
    line-height: 1.2;
}

.shop-pd-bar-price .text-danger {
    font-size: 20px;
    font-weight: 800;
}

.shop-pd-bar-actions {
    flex: 1 1 auto;
    display: flex;
    gap: 8px;
    min-width: 0;
    justify-content: flex-end;
}

.shop-pd-btn-cart,
.shop-pd-btn-buy {
    flex: 0 0 auto;
    width: auto;
    min-width: 104px;
    max-width: 136px;
    min-height: 46px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 23px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-pd-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1.5px solid var(--shop-brand);
    color: var(--shop-brand);
    background: #fff;
}

.shop-pd-btn-buy {
    background: linear-gradient(135deg, var(--shop-brand), var(--shop-brand-dark));
    border: none;
    box-shadow: 0 4px 14px rgba(var(--shop-brand-rgb), 0.35);
}

@media (max-width: 380px) {
    .shop-pd-btn-cart,
    .shop-pd-btn-buy {
        flex: 1 1 0;
        min-width: 0;
        max-width: 48%;
        padding: 0 10px;
        font-size: 13px;
    }
}

.product-desc {
    font-size: 14px;
    color: var(--shop-text-secondary);
    line-height: 1.75;
}

.product-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--shop-radius-sm);
    margin: 8px 0;
}
