/**
 * 产品附加选项样式
 * Product Additional Options Styles
 * Version: 1.0.0
 */

/* ==================== 容器 ==================== */
.product-additional-options {
    margin: 30px 0;
    padding: 0;
}

/* ==================== 选项组 ==================== */
.product-addon-group {
    margin-bottom: 20px;
}

.addon-title {
    font-size: 14px;
    font-weight: normal;
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.5;
    font-family: inherit;
}

.product-addon-label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--theme-font-size, 14px);
    font-weight: var(--theme-label-font-weight, 600);
    font-family: var(--theme-font-family, inherit);
    color: var(--theme-heading-color, #000);
    text-transform: var(--theme-label-text-transform, none);
}

.product-addon-label .required {
    color: #e2401c;
    margin-left: 2px;
}

.product-addon-subtitle {
    margin: 5px 0 10px 0;
    font-size: 12px;
    font-family: var(--theme-font-family, inherit);
    color: var(--theme-text-light-color, #666);
    line-height: 1.5;
}

.addon-subtitle {
    margin: 5px 0 10px 0;
    font-size: 12px;
    font-family: inherit;
    color: #666;
    line-height: 1.5;
}

.required-mark {
    color: #e2401c;
    margin-left: 3px;
    font-weight: normal;
}

/* ==================== 下拉选择框 ==================== */
.product-addon-select {
    width: 100%;
    padding: 12px 15px;
    font-size: var(--theme-font-size, 14px);
    font-family: var(--theme-font-family, inherit);
    color: var(--theme-text-color, #333);
    background: var(--theme-form-field-background, #fff);
    border: 1px solid var(--theme-border-color, #ddd);
    border-radius: var(--theme-form-field-border-radius, 3px);
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='2' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.product-addon-select:hover {
    border-color: var(--theme-link-hover-color, #000);
}

.product-addon-select:focus {
    outline: none;
    border-color: var(--theme-link-color, #2271b1);
    box-shadow: 0 0 0 1px var(--theme-link-color, #2271b1);
}

.product-addon-select.error {
    border-color: #e2401c;
}

.product-addon-select.error:focus {
    box-shadow: 0 0 0 1px #e2401c;
}

/* ==================== 错误提示 ==================== */
.addon-error-message {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #e2401c;
    font-family: var(--theme-font-family, inherit);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .product-additional-options {
        margin: 20px 0;
    }
    
    .product-addon-group {
        margin-bottom: 15px;
    }
    
    .product-addon-select {
        padding: 10px 12px;
        font-size: var(--theme-font-size-sm, 13px);
    }
}

/* ==================== WooCommerce 兼容 ==================== */
.woocommerce div.product form.cart .product-additional-options {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* ==================== 动画效果 ==================== */
.product-addon-group {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 加载状态 ==================== */
.product-addon-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* ==================== 价格标注样式 ==================== */
.product-addon-select option {
    padding: 10px;
}

/* ==================== 焦点可访问性 ==================== */
.product-addon-select:focus-visible {
    outline: 2px solid var(--theme-link-color, #2271b1);
    outline-offset: 2px;
}

/* ==================== 深色模式支持 (可选) ==================== */
@media (prefers-color-scheme: dark) {
    .product-addon-select {
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='2' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}

/* ==================== 价格总计样式 ==================== */
.addon-price-summary {
    margin: 25px 0 20px 0;
}

.customizations-total {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.customizations-total .label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.customizations-total .amount {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    padding-left: 20px;
}

.product-total-price {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 0;
}

.product-total-price .price-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-total-price .current-price {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
}

.product-total-price .original-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
}

@media (max-width: 768px) {
    .addon-price-summary {
        padding: 15px;
    }
    
    .customizations-total .label {
        font-size: 13px;
    }
    
    .customizations-total .amount {
        font-size: 14px;
    }
    
    .product-total-price .current-price {
        font-size: 26px;
    }
    
    .product-total-price .original-price {
        font-size: 18px;
    }
}
