/* 規格選擇彈窗（商品卡片 / 列表立即購物） */
.variant-picker-popup {
    padding: 0.75rem 0.75rem 0.5rem !important;
}

.variant-picker-html {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.variant-modal {
    text-align: left;
}

.variant-modal-product {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-primary, #222);
}

.variant-modal-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(42vh, 280px);
    overflow-y: auto;
    padding-right: 2px;
}

.variant-modal-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    width: 100%;
    border: 2px solid var(--border-light, #e5e5e5);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    text-align: left;
}

.variant-modal-option:hover:not(.is-disabled):not(:disabled) {
    border-color: var(--primary-color);
    background: #fafafa;
}

.variant-modal-option.is-selected {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 8%, #fff);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.variant-modal-option.is-disabled,
.variant-modal-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.variant-modal-option-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.variant-modal-option-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.variant-modal-option-stock {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
}

.variant-modal-option-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.variant-modal-option-hint {
    width: 100%;
    font-size: 0.75rem;
    color: #999;
}

.variant-modal-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light, #eee);
}

.variant-modal-qty-label {
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.variant-modal-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-light, #ddd);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.variant-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-primary, #333);
}

.variant-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.variant-qty-input {
    width: 48px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--border-light, #ddd);
    border-right: 1px solid var(--border-light, #ddd);
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.variant-qty-input::-webkit-outer-spin-button,
.variant-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.variant-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.variant-modal-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.variant-modal-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.variant-modal-btn-cart {
    background: var(--primary-color);
    color: #fff;
}

.variant-modal-btn-cart:hover:not(:disabled) {
    background: var(--primary-hover, var(--primary-color));
}

.variant-modal-btn-buy {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.variant-modal-btn-buy:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
}

@media (max-width: 480px) {
    .variant-picker-popup {
        padding: 0.5rem 0.5rem 0.25rem !important;
    }

    .variant-modal-actions {
        grid-template-columns: 1fr;
    }

    .variant-modal-btn {
        padding: 14px 12px;
        font-size: 1rem;
    }

    .variant-modal-options {
        max-height: 38vh;
    }
}
