/**
 * Checkout - Estilos
 * 
 * @author Alexsandro Gomes Pereira <https://lifeweb.com.br>
 * @date 06/11/2025 19:45
 */

/* ========================================
   CONTAINER PRINCIPAL
======================================== */

.checkout-container {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 40px 0;
}

.breadcrumb-section {
    background: #fff;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb-section a {
    color: #8B6F47;
    text-decoration: none;
}

.breadcrumb-section a:hover {
    text-decoration: underline;
}

.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   FORMULÁRIO
======================================== */

.checkout-form-column {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form-column h1 {
    font-size: 32px;
    color: #2C2416;
    margin-bottom: 30px;
    font-family: 'Playfair Display', serif;
}

.checkout-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.checkout-section:last-child {
    border-bottom: none;
}

.checkout-section h2 {
    font-size: 20px;
    color: #2C2416;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #8B6F47;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

/* ========================================
   CAMPOS DO FORMULÁRIO
======================================== */

.form-row {
    margin-bottom: 20px;
}

.form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.three-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B6F47;
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
}

.form-group input.error {
    border-color: #e74c3c;
}

.form-group small {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.form-group small a {
    color: #8B6F47;
}

/* CEP */
.cep-input-wrapper {
    display: flex;
    gap: 10px;
}

.cep-input-wrapper input {
    flex: 1;
}

.btn-secondary {
    padding: 12px 20px;
    background: #8B6F47;
    border: 1px solid #8B6F47;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-secondary:hover:not(:disabled) {
    background: #6d5638;
    border-color: #6d5638;
}

.btn-secondary:disabled,
.btn-secondary.disabled {
    background: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   FRETE
======================================== */

.loading-state {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8B6F47;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.frete-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.frete-option {
    position: relative;
}

.frete-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.frete-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.frete-option input[type="radio"]:checked + label {
    border-color: #8B6F47;
    background: #f9f7f4;
}

.frete-option label:hover {
    border-color: #8B6F47;
}

.frete-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.frete-info strong {
    font-size: 16px;
    color: #2C2416;
}

.frete-prazo {
    font-size: 13px;
    color: #666;
}

.frete-price {
    font-size: 18px;
    font-weight: bold;
    color: #8B6F47;
}

/* ========================================
   FORMAS DE PAGAMENTO
======================================== */

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-option {
    position: relative;
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.payment-option label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option input[type="radio"]:checked + label {
    border-color: #8B6F47;
    background: #f9f7f4;
}

.payment-option label:hover {
    border-color: #8B6F47;
}

.payment-icon {
    font-size: 32px;
}

.payment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.payment-info strong {
    font-size: 16px;
    color: #2C2416;
}

.payment-info span {
    font-size: 13px;
    color: #666;
}

.discount-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 5px;
}

.payment-fields {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ========================================
   CUPOM
======================================== */

.coupon-wrapper {
    display: flex;
    gap: 10px;
}

.coupon-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.coupon-message {
    margin-top: 15px;
}

.success-message {
    padding: 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    color: #155724;
}

.error-message {
    padding: 12px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

.info-message {
    padding: 12px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    color: #0c5460;
}

/* ========================================
   BOTÕES
======================================== */

.checkout-actions {
    text-align: center;
    margin-top: 40px;
}

.btn-primary {
    width: 100%;
    padding: 18px 40px;
    background: #8B6F47;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #6d5638;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 111, 71, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.security-info {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

/* ========================================
   RESUMO DO PEDIDO
======================================== */

.checkout-summary-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.order-summary {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order-summary h3 {
    font-size: 22px;
    color: #2C2416;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.summary-product {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.summary-product img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-info h4 {
    font-size: 16px;
    color: #2C2416;
    margin-bottom: 5px;
}

.product-info p {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.quantity {
    font-size: 12px;
    color: #999;
}

.summary-values {
    margin-bottom: 25px;
}

.value-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.value-row.total-row {
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 20px;
    font-weight: bold;
    color: #8B6F47;
}

.discount-text {
    color: #27ae60;
}

.summary-guarantees {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f7f4;
    border-radius: 8px;
}

.guarantee-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.guarantee-item:last-child {
    margin-bottom: 0;
}

.guarantee-item .icon {
    color: #27ae60;
    font-weight: bold;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.security-badges img {
    height: 40px;
    opacity: 0.7;
}

/* ========================================
   RESPONSIVO
======================================== */

@media (max-width: 992px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .checkout-summary-column {
        position: static;
        order: -1;
    }
    
    .form-row.two-columns,
    .form-row.three-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .checkout-form-column {
        padding: 20px;
    }
    
    .order-summary {
        padding: 20px;
    }
    
    .checkout-form-column h1 {
        font-size: 24px;
    }
}
