/* 
 * Pricing Visual Update CSS
 * Atualização visual para elementos de precificação
 * Baseado na imagem de referência fornecida
 */

/* Container principal do formulário de configuração */
.wapf-wrapper,
.wapf-form-container,
.product-configuration-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin: 20px 0;
    border: 1px solid #e8e8e8;
}

/* Título principal do formulário */
.wapf-form-title,
.configuration-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wapf-form-title::before,
.configuration-title::before {
    content: "⚙️";
    font-size: 18px;
}

/* Campos de seleção (dropdowns) */
.wapf-field-container select,
.wapf-field select,
.product-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background: #ffffff;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.wapf-field-container select:focus,
.wapf-field select:focus,
.product-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Labels dos campos */
.wapf-field-label,
.field-label {
    font-size: 14px;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
    display: block;
}

/* Checkboxes e opções adicionais */
.wapf-field-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #3498db;
}

.wapf-field-container label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wapf-field-container label:hover {
    color: #3498db;
}

/* Seção de resumo de preços */
.pricing-summary,
.price-breakdown {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-top: 24px;
}

.wapf-product-totals {
    padding: 20px;
    margin-top: 24px;
}

/* Linhas de preço individuais */
.wapf-product-totals .price-line,
.pricing-summary .price-row,
.price-breakdown .price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.wapf-product-totals .price-line:last-child,
.pricing-summary .price-row:last-child,
.price-breakdown .price-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    background: rgba(52, 152, 219, 0.05);
    margin: 12px -20px -20px -20px;
    padding: 16px 20px;
    border-radius: 0 0 12px 12px;
}

/* Preço Base */
.price-base,
.base-price {
    color: #34495e;
    font-weight: 500;
}

.price-base .amount,
.base-price .amount {
    color: #2c3e50;
    font-weight: 600;
}

/* Acréscimos */
.price-additions,
.additions-price {
    color: #27ae60;
    font-weight: 500;
}

.price-additions .amount,
.additions-price .amount {
    color: #27ae60;
    font-weight: 600;
}

/* Total */
.price-total,
.total-price {
    color: #2c3e50 !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}

.price-total .amount,
.total-price .amount {
    color: #e74c3c;
    font-weight: 700;
    font-size: 20px;
}

/* Botão de adicionar ao carrinho */
.single_add_to_cart_button,
.add-to-cart-button {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 32px;
    height: 57px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.single_add_to_cart_button:hover,
.add-to-cart-button:hover {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* Animações e transições */
.wapf-field-container,
.pricing-summary,
.price-breakdown {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .wapf-wrapper,
    .wapf-form-container,
    .product-configuration-form {
        padding: 16px;
        margin: 16px 0;
    }
    
    .wapf-product-totals,
    .pricing-summary,
    .price-breakdown {
        padding: 16px;
    }
    
    .price-total .amount,
    .total-price .amount {
        font-size: 18px;
    }
}

/* Melhorias específicas para WAPF */
.wapf-field-container .wapf-field-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.wapf-field-container .wapf-field-description {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
    font-style: italic;
}

/* Override explícito para .wapf-product-totals conforme solicitado */
.wapf-product-totals {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 20px !important;
    margin-top: 24px !important;
}

/* Indicadores visuais para campos obrigatórios */
.wapf-field-required .wapf-field-label::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

/* Estados de loading */
.wapf-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wapf-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Melhorias para acessibilidade */
.wapf-field-container:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Estilos para mensagens de erro */
.wapf-field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.wapf-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
/* Override: remover espaçamento extra do preço em single product */
.ms-single-product .ms-single-product__content .price { margin-bottom: 0 !important; }

