/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f0f2f5;
    min-height: 100vh;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    background-color: #ffe530;
    padding: 15px 0;
    width: 100%;
    margin: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-img {
    height: 34px;
}

.breadcrumb {
    font-size: 14px;
    color: #666;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px 0;
    background-color: #f0f2f5;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb .current {
    color: #3483fa;
    font-weight: 500;
}

/* Layout principal de duas colunas */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.checkout-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background-color: white;
    margin-top: 1rem;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.form-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
}

.section-number {
    background-color: #3483fa;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(52, 131, 250, 0.3);
    transition: all 0.2s ease;
}

.section-number:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 131, 250, 0.4);
}

.form-section.completed .section-number {
    background-color: #00a650;
    box-shadow: 0 2px 8px rgba(0, 166, 80, 0.3);
}

.form-section.completed .section-number:hover {
    box-shadow: 0 4px 12px rgba(0, 166, 80, 0.4);
}

/* Grupos de formulário */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 400;
    color: #666;
    font-size: 14px;
    transition: color 0.2s ease;
}

.form-group:focus-within label {
    color: #3483fa;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-group input:hover {
    border-color: #b0b0b0;
}

.form-group input:focus {
    outline: none;
    border-color: #3483fa;
    box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.1);
    background-color: #fafbff;
}

.form-group input::placeholder {
    color: #999;
    font-size: 14px;
    transition: color 0.2s ease;
}

.form-group input:focus::placeholder {
    color: #ccc;
}

/* Linhas de formulário */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

/* Informações de envio */
.shipping-info {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.shipping-icon {
    width: 24px;
    height: 24px;
    fill: #00a650;
}

.shipping-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shipping-text {
    font-weight: 500;
    color: #333;
    font-size: 15px;
    margin: 0;
}

.shipping-type {
    color: #666;
    font-size: 13px;
    font-weight: 400;
    margin: 0;
}

/* Payment Method */
.payment-method {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.payment-selector {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #3483fa;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f0f8ff;
}

.payment-selector input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: #3483fa;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid #3483fa;
    border-radius: 50%;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
}

.payment-selector input[type="radio"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #3483fa;
}

.payment-selector input[type="radio"]:checked::before {
    transform: scale(1);
}

.payment-selector .card-icon {
    margin: 0 10px;
}

.payment-selector span {
    font-weight: 500;
}

/* Resumo do pedido */
.order-summary {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
    min-width: 280px;
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.order-summary:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

.total-section {
    text-align: left;
}

.total-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.total-label {
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

.total-price {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.checkout-btn {
    width: 100%;
    background-color: #3483fa;
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkout-btn:disabled {
    background-color: #8fb2e6;
    color: white;
    cursor: not-allowed;
}

.protected-purchase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #00a650;
    font-size: 14px;
    font-weight: 500;
}

.shield-icon {
    font-size: 16px;
}

/* Responsividade */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 16px;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .breadcrumb {
        padding: 8px 16px 0;
    }
    
    .checkout-form {
        padding: 0;
        margin-bottom: 16px;
        order: 1;
    }
    
    .order-summary {
        min-width: 380px;
        order: 2;
        position: static;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 16px;
    }
    
    .total-amount {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .checkout-form {
        padding: 0;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .order-summary {
        padding: 16px;
        margin-top: 20px;
    }
}

/* Estados de validação */
.form-group.error input {
    border: 1px solid #e74c3c;
    background-color: #fdf2f2;
    animation: shake 0.3s ease-in-out;
}

.form-group.error input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Animações */
.form-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.checkout-btn.loading {
    background-color: #ccc;
    cursor: not-allowed;
    position: relative;
}

.checkout-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 1px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
