/**
 * Checkout Customizado - Estilos ISOLADOS
 * Estilos próprios que não dependem do tema
 */

/* Reset COMPLETO e isolamento do tema */
body.checkout-custom-page .checkout-custom-wrapper,
body.checkout-custom-page .checkout-custom-wrapper * {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Variáveis de Cores */
body.checkout-custom-page .checkout-custom-wrapper {
    --primary-color: #3366cc;
    --primary-gradient: linear-gradient(135deg, #3366cc 0%, #4a7cff 100%);
    --secondary-color: #4a7cff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f7f8f9;
    --bg-white: #ffffff;
    --success-color: #28a745;
    --error-color: #ff4444;
    --warning-color: #ffc107;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Reset e Base - ISOLADO do tema */
body.checkout-custom-page .checkout-custom-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg-light) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: var(--text-color) !important;
    line-height: 1.6 !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Estilos normais - formulário dentro da seção do site */
body.checkout-custom-page .checkout-custom-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* GARANTIR QUE TUDO DO CHECKOUT SEJA SEMPRE VISÍVEL */
body.checkout-custom-page .checkout-custom-full-wrapper,
body.checkout-custom-page .checkout-custom-main-wrapper,
body.checkout-custom-page .checkout-custom-wrapper,
body.checkout-custom-page .checkout-container-wrapper,
body.checkout-custom-page .checkout-container,
body.checkout-custom-page form.checkout,
body.checkout-custom-page form.woocommerce-checkout,
body.checkout-custom-page .checkout-steps-progress,
body.checkout-custom-page .checkout-steps-content,
body.checkout-custom-page .checkout-step-panel,
body.checkout-custom-page .checkout-step-panel.active,
body.checkout-custom-page .step-panel-body,
body.checkout-custom-page .step-panel-header,
body.checkout-custom-page .step-panel-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
}

/* Garantir que o formulário dentro do #et-main-area seja visível */
body.checkout-custom-page #et-main-area .checkout-custom-full-wrapper,
body.checkout-custom-page #et-main-area form.checkout,
body.checkout-custom-page #et-main-area form.woocommerce-checkout,
body.checkout-custom-page .main-content .checkout-custom-full-wrapper,
body.checkout-custom-page .main-content form.checkout,
body.checkout-custom-page .main-content form.woocommerce-checkout {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Garantir que campos do formulário sejam visíveis */
body.checkout-custom-page form.checkout input,
body.checkout-custom-page form.checkout select,
body.checkout-custom-page form.checkout textarea,
body.checkout-custom-page form.checkout label,
body.checkout-custom-page form.checkout .form-row,
body.checkout-custom-page form.woocommerce-checkout input,
body.checkout-custom-page form.woocommerce-checkout select,
body.checkout-custom-page form.woocommerce-checkout textarea,
body.checkout-custom-page form.woocommerce-checkout label,
body.checkout-custom-page form.woocommerce-checkout .form-row {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Wrapper do checkout - dentro da seção normal */
.checkout-custom-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.checkout-custom-page * {
    box-sizing: border-box;
}

/* Header do Checkout */
.checkout-header {
    background: var(--bg-white) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
    box-shadow: var(--shadow-sm);
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    margin: 0 !important;
}

.checkout-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.checkout-logo img {
    max-height: 50px;
    width: auto;
}

.checkout-logo h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 600;
}

.checkout-header-info {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.checkout-security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success-color);
    font-size: 14px;
    font-weight: 500;
}

.checkout-security-badge i {
    font-size: 18px;
}

.checkout-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.checkout-user-info i {
    font-size: 20px;
    color: var(--primary-color);
}

/* Container Principal */
.checkout-custom-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Garantir que o conteúdo principal ocupe o espaço */
.checkout-custom-main-wrapper .woocommerce {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Container wrapper */
.checkout-container-wrapper {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box;
}

/* Layout do checkout - lado a lado */
.checkout-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
    width: 100% !important;
    align-items: start;
    box-sizing: border-box;
}

/* Coluna esquerda - Formulário */
.checkout-container > form {
    grid-column: 1;
    width: 100%;
}

/* Coluna direita - Resumo do pedido (se existir) */
.checkout-container .woocommerce-checkout-review-order,
.checkout-container #order_review {
    grid-column: 2;
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Responsive - Mobile */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .checkout-container .woocommerce-checkout-review-order,
    .checkout-container #order_review {
        grid-column: 1 !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
    }
    
    .checkout-container-wrapper {
        padding: 0 15px;
    }
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Progress Steps - ISOLADOS */
body.checkout-custom-page .checkout-custom-wrapper .checkout-steps-progress {
    display: flex !important;
    justify-content: space-between !important;
    padding: 30px 40px !important;
    background: var(--bg-light) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: relative !important;
    width: 100% !important;
    margin-bottom: 30px !important;
    clear: both !important;
    float: none !important;
}

.checkout-steps-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
    transform: translateY(-50%);
}

body.checkout-custom-page .checkout-custom-wrapper .checkout-step-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    position: relative !important;
    z-index: 1 !important;
    flex: 1 !important;
    max-width: 200px !important;
    width: auto !important;
    float: none !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-number {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: var(--bg-white) !important;
    border: 3px solid var(--border-color) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    transition: var(--transition) !important;
    flex-shrink: 0 !important;
}

.step-number i {
    font-size: 24px;
    color: var(--text-light);
    transition: var(--transition);
}

.step-indicator {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    bottom: 4px;
    right: 4px;
    background: var(--bg-light);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-step-item.active .step-number {
    border-color: var(--primary-color);
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(51, 102, 204, 0.3);
}

.checkout-step-item.active .step-number i,
.checkout-step-item.completed .step-number i {
    color: var(--bg-white);
}

.checkout-step-item.completed .step-number {
    border-color: var(--success-color);
    background: var(--success-color);
}

.checkout-step-item.completed .step-number::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    color: var(--bg-white);
    font-size: 20px;
}

body.checkout-custom-page .checkout-custom-wrapper .step-info {
    text-align: center !important;
    width: 100% !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-title {
    margin: 0 0 5px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-color) !important;
    display: block !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-description {
    margin: 0 !important;
    font-size: 12px !important;
    color: var(--text-light) !important;
    display: block !important;
}

.checkout-step-item.active .step-title {
    color: var(--primary-color);
}

/* Step Panels - ISOLADOS */
body.checkout-custom-page .checkout-custom-wrapper .checkout-steps-content {
    position: relative !important;
    min-height: 400px !important;
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    clear: both !important;
}

body.checkout-custom-page .checkout-custom-wrapper .checkout-step-panel {
    display: none !important;
    padding: 40px !important;
    animation: fadeIn 0.3s ease !important;
    visibility: visible !important;
    width: 100% !important;
    background: var(--bg-white) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 20px !important;
    clear: both !important;
    float: none !important;
}

body.checkout-custom-page .checkout-custom-wrapper .checkout-step-panel.active {
    display: block !important;
    visibility: visible !important;
}

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

body.checkout-custom-page .checkout-custom-wrapper .step-panel-header {
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid var(--bg-light) !important;
    width: 100% !important;
    clear: both !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-panel-header h2 {
    margin: 0 0 8px 0 !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    color: var(--text-color) !important;
    display: block !important;
    width: 100% !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-panel-header p {
    margin: 0 !important;
    font-size: 16px !important;
    color: var(--text-light) !important;
    display: block !important;
    width: 100% !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-panel-body {
    margin-bottom: 30px !important;
    width: 100% !important;
    clear: both !important;
    display: block !important;
}

body.checkout-custom-page .checkout-custom-wrapper .billing-fields-wrapper,
body.checkout-custom-page .checkout-custom-wrapper .shipping-fields-wrapper {
    width: 100% !important;
    display: block !important;
    clear: both !important;
}

body.checkout-custom-page .checkout-custom-wrapper .step-panel-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 30px !important;
    border-top: 1px solid var(--border-color) !important;
    gap: 15px !important;
    width: 100% !important;
    clear: both !important;
    flex-wrap: wrap !important;
}

/* Botões */
.btn-next-step,
.btn-prev-step,
.button.alt {
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-next-step,
.button.alt {
    background: var(--primary-gradient);
    color: var(--bg-white);
    box-shadow: 0 4px 15px rgba(51, 102, 204, 0.3);
}

.btn-next-step:hover,
.button.alt:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 102, 204, 0.4);
}

.btn-prev-step {
    background: var(--bg-white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-prev-step:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Campos do Formulário - ISOLADOS */
body.checkout-custom-page .checkout-custom-wrapper .form-row,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row {
    margin-bottom: 20px !important;
    width: 100% !important;
    display: block !important;
    clear: both !important;
    float: none !important;
}

body.checkout-custom-page .checkout-custom-wrapper .form-row label,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 500 !important;
    color: var(--text-color) !important;
    font-size: 14px !important;
    width: 100% !important;
    float: none !important;
}

body.checkout-custom-page .checkout-custom-wrapper .form-row input[type="text"],
body.checkout-custom-page .checkout-custom-wrapper .form-row input[type="email"],
body.checkout-custom-page .checkout-custom-wrapper .form-row input[type="tel"],
body.checkout-custom-page .checkout-custom-wrapper .form-row input[type="password"],
body.checkout-custom-page .checkout-custom-wrapper .form-row input[type="number"],
body.checkout-custom-page .checkout-custom-wrapper .form-row select,
body.checkout-custom-page .checkout-custom-wrapper .form-row textarea,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input[type="text"],
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input[type="email"],
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input[type="tel"],
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input[type="password"],
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input[type="number"],
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row select,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row textarea {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    font-size: 15px !important;
    transition: var(--transition) !important;
    background: var(--bg-white) !important;
    color: var(--text-color) !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    display: block !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body.checkout-custom-page .checkout-custom-wrapper .form-row input:focus,
body.checkout-custom-page .checkout-custom-wrapper .form-row select:focus,
body.checkout-custom-page .checkout-custom-wrapper .form-row textarea:focus,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row input:focus,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row select:focus,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row textarea:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(51, 102, 204, 0.1) !important;
}

body.checkout-custom-page .checkout-custom-wrapper .form-row.woocommerce-invalid input,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row.woocommerce-invalid input {
    border-color: var(--error-color) !important;
}

body.checkout-custom-page .checkout-custom-wrapper .form-row.woocommerce-invalid label,
body.checkout-custom-page .checkout-custom-wrapper .woocommerce-checkout .form-row.woocommerce-invalid label {
    color: var(--error-color) !important;
}

/* Order Review - REMOVIDO (usar checkout-isolated.css) */

/* Payment Methods */
.woocommerce-checkout-payment {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wc_payment_method {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.wc_payment_method:hover {
    border-color: var(--primary-color);
}

.wc_payment_method input[type="radio"] {
    margin-right: 10px;
}

.payment_box {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

/* Footer do Checkout */
.checkout-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.checkout-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.checkout-footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.checkout-footer-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.security-icons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.security-item i {
    color: var(--success-color);
    font-size: 18px;
}

.support-info p {
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.support-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.support-info a:hover {
    text-decoration: underline;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.checkout-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.back-to-site a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.back-to-site a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .checkout-steps-progress {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .checkout-steps-progress::before {
        display: none;
    }

    .checkout-step-item {
        flex-direction: row;
        max-width: 100%;
        text-align: left;
    }

    .step-info {
        text-align: left;
    }

    .checkout-step-panel {
        padding: 20px;
    }

    .step-panel-header h2 {
        font-size: 22px;
    }

    .step-panel-footer {
        flex-direction: column;
    }

    .btn-next-step,
    .btn-prev-step {
        width: 100%;
        justify-content: center;
    }

    .checkout-footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .checkout-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Loading State */
.checkout-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.checkout-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mensagens de Erro */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.woocommerce-error {
    background: #fff5f5;
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.woocommerce-info {
    background: #f0f9ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.woocommerce-message {
    background: #f0fdf4;
    border-left-color: var(--success-color);
    color: var(--success-color);
}

