/**
 * DW Woo Thankyou Toolkit - Estilos CSS
 * Version: 2.0.0
 */

/* ==========================================================================
   Container Principal
   ========================================================================== */

.dw-wcty {
    max-width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   Header e Mensagem de Confirmação
   ========================================================================== */

.dw-wcty__header {
    padding: 20px;
    border: 2px solid #e8f5e8;
    background: linear-gradient(135deg, #f8fff8 0%, #f0f8f0 100%);
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dw-wcty__message {
    font-weight: 700;
    margin: 0 0 16px;
    color: #1a4d1a;
    font-size: 1.2em;
    text-align: center;
}

.dw-wcty__title {
    margin: 12px 0 6px;
    font-size: 1.3em;
    color: #333;
}

/* ==========================================================================
   Resumo do Pedido
   ========================================================================== */

.dw-wcty-summary {
    border: 1px solid #d4edda;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.dw-wcty-summary__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
}

.dw-wcty-summary__col {
    padding: 20px 24px;
    border-right: 1px solid #e8f5e8;
    border-bottom: 1px solid #e8f5e8;
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.dw-wcty-summary__col:hover {
    background: #f8fff8;
}

.dw-wcty-summary__col:last-child {
    border-right: none;
}

.dw-wcty-summary__label {
    display: block;
    color: #343a40;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dw-wcty-summary__value {
    display: block;
    font-weight: 700;
    color: #000000;
    font-size: 1.05em;
}

/* ==========================================================================
   Tabela de Itens
   ========================================================================== */

.dw-wcty-items {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8f5e8;
}

.dw-wcty-items th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #212529;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dw-wcty-items td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: top;
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.dw-wcty-items tr:hover td {
    background: #f8fff8;
}

.dw-wcty-items__total {
    text-align: right;
    font-weight: 700;
    color: #1a4d1a;
    font-size: 1.05em;
}

.dw-wcty-items__product {
    color: #000000;
    font-weight: 500;
}

.dw-wcty-items__meta {
    font-size: 0.9em;
    color: #495057;
    margin-top: 6px;
    font-style: italic;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ==========================================================================
   Tabela de Totais
   ========================================================================== */

.dw-wcty-totals {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8f5e8;
}

.dw-wcty-totals th {
    padding: 16px 20px;
    text-align: left;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.95em;
}

.dw-wcty-totals td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    text-align: right;
    color: #000000;
    font-weight: 500;
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.dw-wcty-totals tr:hover td {
    background: #f8fff8;
}

.dw-wcty-totals__value {
    font-weight: 700;
    color: #1a4d1a;
    font-size: 1.05em;
}

.dw-wcty-totals tr:last-child th,
.dw-wcty-totals tr:last-child td {
    border-bottom: 0;
    font-weight: 800;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #0f5132;
    font-size: 1.1em;
    border-top: 2px solid #a3d9a4;
}

/* ==========================================================================
   Endereços
   ========================================================================== */

.dw-wcty-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.dw-wcty-addresses__billing,
.dw-wcty-addresses__shipping {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e8f5e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dw-wcty-addresses__billing:hover,
.dw-wcty-addresses__shipping:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.dw-wcty-addresses h4 {
    margin: 0 0 16px;
    color: #1a4d1a;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #d4edda;
    padding-bottom: 8px;
}

.dw-wcty-address {
    font-style: normal;
    color: #000000;
    line-height: 1.6;
    font-size: 0.95em;
}

/* ==========================================================================
   Ações
   ========================================================================== */

.dw-wcty-actions {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px;
    background: linear-gradient(135deg, #f8fff8 0%, #f0f8f0 100%);
    border-radius: 12px;
    border: 1px solid #e8f5e8;
}

.dw-wcty-actions__label {
    font-weight: 700;
    color: #1a4d1a;
    margin: 0;
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dw-wcty-actions__button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.dw-wcty-actions__button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
}

.dw-wcty-actions__button:focus {
    outline: 3px solid rgba(40, 167, 69, 0.5);
    outline-offset: 2px;
}

.dw-wcty-actions__button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* ==========================================================================
   Mensagens de Erro
   ========================================================================== */

.dw-wcty-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #58151c;
    padding: 16px 20px;
    border: 2px solid #f1aeb5;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
    position: relative;
}

.dw-wcty-error::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 1.1em;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 768px) {
    .dw-wcty__header {
        padding: 16px;
    }
    
    .dw-wcty__message {
        font-size: 1.1em;
    }
    
    .dw-wcty-summary__row {
        grid-template-columns: 1fr;
    }
    
    .dw-wcty-summary__col {
        border-right: none;
        border-bottom: 1px solid #e8f5e8;
        padding: 16px 20px;
    }
    
    .dw-wcty-summary__col:last-child {
        border-bottom: none;
    }
    
    .dw-wcty-addresses {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dw-wcty-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .dw-wcty-actions__button {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
    
    .dw-wcty-items th,
    .dw-wcty-items td {
        padding: 12px 16px;
    }
    
    .dw-wcty-totals th,
    .dw-wcty-totals td {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .dw-wcty__header {
        padding: 12px;
    }
    
    .dw-wcty-summary__col {
        padding: 12px 14px;
    }
    
    .dw-wcty-items th,
    .dw-wcty-items td {
        padding: 8px 12px;
    }
    
    .dw-wcty-totals th,
    .dw-wcty-totals td {
        padding: 8px 12px;
    }
    
    .dw-wcty-addresses__billing,
    .dw-wcty-addresses__shipping {
        padding: 12px;
    }
}

/* ==========================================================================
   Compatibilidade com Temas
   ========================================================================== */

/* Reset de estilos que podem conflitar com temas */
.dw-wcty * {
    box-sizing: border-box;
}

.dw-wcty table {
    border-spacing: 0;
    border-collapse: collapse;
}

.dw-wcty a {
    text-decoration: none;
}

.dw-wcty a:hover {
    text-decoration: none;
}

/* ==========================================================================
   Status do Pagamento
   ========================================================================== */

.dw-payment-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dw-payment-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dw-payment-status__icon {
    font-size: 1.1em;
}

.dw-payment-status__text {
    font-weight: 600;
}

/* Status aprovado */
.dw-payment-approved {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #0f5132;
    border: 2px solid #a3d9a4;
    box-shadow: 0 2px 4px rgba(21, 87, 36, 0.1);
}

/* Status processando */
.dw-payment-processing {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #664d03;
    border: 2px solid #ffda6a;
    box-shadow: 0 2px 4px rgba(133, 100, 4, 0.1);
}

/* Status pendente */
.dw-payment-pending {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #495057;
    border: 2px solid #adb5bd;
    box-shadow: 0 2px 4px rgba(73, 80, 87, 0.1);
}

/* Status cancelado */
.dw-payment-cancelled {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #58151c;
    border: 2px solid #f1aeb5;
    box-shadow: 0 2px 4px rgba(114, 28, 36, 0.1);
}

/* Status reembolsado */
.dw-payment-refunded {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #055160;
    border: 2px solid #9dd5e0;
    box-shadow: 0 2px 4px rgba(12, 84, 96, 0.1);
}

/* Status falhou */
.dw-payment-failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #58151c;
    border: 2px solid #f1aeb5;
    box-shadow: 0 2px 4px rgba(114, 28, 36, 0.1);
}

/* Status desconhecido */
.dw-payment-unknown {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #6c757d;
    border: 2px solid #adb5bd;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.1);
}

/* Container do status */
.dw-payment-status-container {
    margin: 8px 0;
}

.dw-payment-status--badge .dw-payment-status {
    border-radius: 20px;
    padding: 8px 16px;
}

.dw-payment-status--text .dw-payment-status {
    background: transparent;
    border: none;
    padding: 4px 0;
    border-radius: 0;
    text-transform: none;
    letter-spacing: normal;
}

.dw-payment-status--detailed {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.dw-payment-status--detailed .dw-payment-status {
    margin-bottom: 8px;
}

.dw-payment-status__description {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Status inline (para wc_order_field) */
.dw-payment-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Integração com resumo */
.dw-wcty-summary .dw-payment-status {
    font-size: 0.85em;
    padding: 4px 8px;
}

/* ==========================================================================
   Acessibilidade
   ========================================================================== */

.dw-wcty-actions__button:focus,
.dw-wcty-actions__button:focus-visible {
    outline: 2px solid #7fbf63;
    outline-offset: 2px;
}

/* Melhora contraste para leitores de tela */
.dw-wcty-summary__label,
.dw-wcty-items th,
.dw-wcty-totals th {
    color: #212529;
}

