/* ===========================================
   Checkout Delivery - Design Moderno
   Baseado nas cores do catálogo (#667eea, #764ba2)
   =========================================== */

/* Modal Checkout */
#checkoutModal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#checkoutModal .modal-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

#checkoutModal .modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    display: flex;
    align-items: center;
}

#checkoutModal .modal-header .modal-title i {
    color: #fff;
    font-size: 1.3rem;
}

#checkoutModal .modal-body {
    padding: 1.5rem;
    background: #fafbfc;
}

#checkoutModal .modal-footer {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

/* Formulário de Entrega */
.delivery-form {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.delivery-section {
    margin-bottom: 1.5rem;
}

.delivery-section:last-child {
    margin-bottom: 0;
}

.delivery-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ff-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-section-title i {
    font-size: 1rem;
}

/* Form Groups */
.delivery-form-group {
    margin-bottom: 1rem;
}

.delivery-form-group:last-child {
    margin-bottom: 0;
}

.delivery-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.delivery-form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.delivery-form-input,
.delivery-form-select,
.delivery-form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
    color: #2d3748;
}

.delivery-form-input:focus,
.delivery-form-select:focus,
.delivery-form-textarea:focus {
    outline: none;
    border-color: var(--ff-primary);
    box-shadow: 0 0 0 3px rgba(var(--ff-primary-rgb), 0.1);
}

.delivery-form-input::placeholder {
    color: #a0aec0;
}

.delivery-form-hint {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.35rem;
}

/* CEP Input Group */
.cep-input-group {
    display: flex;
    gap: 0.5rem;
}

.cep-input-group .delivery-form-input {
    flex: 1;
}

.cep-calculate-btn {
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--ff-primary);
    border-radius: 12px;
    background: #fff;
    color: var(--ff-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cep-calculate-btn:hover {
    background: var(--ff-gradient);
    color: white;
    border-color: transparent;
}

.cep-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Grid Layout */
.delivery-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.delivery-row:last-child {
    margin-bottom: 0;
}

.delivery-col {
    flex: 1;
}

.delivery-col-2 {
    flex: 2;
}

.delivery-col-auto {
    flex: 0 0 auto;
}

/* Opções de Frete */
.shipping-options {
    margin-top: 1rem;
}

.shipping-options-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.shipping-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.shipping-option:last-child {
    margin-bottom: 0;
}

.shipping-option:hover {
    border-color: var(--ff-primary);
    background: #f8f7ff;
}

.shipping-option.selected {
    border-color: var(--ff-primary);
    background: var(--ff-gradient-light);
}

.shipping-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.shipping-option.selected .shipping-option-radio {
    border-color: var(--ff-primary);
}

.shipping-option.selected .shipping-option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--ff-gradient);
    border-radius: 50%;
}

.shipping-option-info {
    flex: 1;
}

.shipping-option-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 0.15rem;
}

.shipping-option-time {
    font-size: 0.8rem;
    color: #f59e0b;
}

.shipping-option-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ff-primary);
}

/* Observações */
.delivery-form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Botões do Footer */
.checkout-footer-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.checkout-btn-cancel {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn-cancel:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.checkout-btn-confirm {
    flex: 2;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: var(--ff-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-btn-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--ff-primary-rgb), 0.4);
}

.checkout-btn-confirm:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.checkout-footer-hint {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.checkout-footer-hint i {
    color: #f59e0b;
}

/* ========== RESPONSIVE - Tablet ========== */
@media (max-width: 992px) {
    #checkoutModal .modal-dialog {
        max-width: 600px;
        margin: 1rem auto;
    }
    
    .delivery-form {
        padding: 1.25rem;
    }
    
    .delivery-row {
        flex-wrap: wrap;
    }
    
    .delivery-col {
        min-width: calc(50% - 0.5rem);
    }
}

/* ========== RESPONSIVE - Mobile ========== */
@media (max-width: 576px) {
    #checkoutModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #checkoutModal .modal-content {
        border-radius: 16px;
    }
    
    #checkoutModal .modal-header {
        padding: 1rem;
    }
    
    #checkoutModal .modal-body {
        padding: 1rem;
    }
    
    #checkoutModal .modal-footer {
        padding: 1rem;
    }
    
    .delivery-form {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .delivery-section-title {
        font-size: 0.8rem;
    }
    
    .delivery-row {
        flex-direction: column;
        gap: 0;
    }
    
    .delivery-col,
    .delivery-col-2 {
        width: 100%;
        min-width: 100%;
    }
    
    .delivery-form-group {
        margin-bottom: 0.875rem;
    }
    
    .delivery-form-input,
    .delivery-form-select,
    .delivery-form-textarea {
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .cep-input-group {
        flex-direction: column;
    }
    
    .cep-calculate-btn {
        width: 100%;
        padding: 0.75rem;
    }
    
    .shipping-option {
        padding: 0.875rem 1rem;
        border-radius: 10px;
    }
    
    .shipping-option-name {
        font-size: 0.9rem;
    }
    
    .shipping-option-price {
        font-size: 1rem;
    }
    
    .checkout-footer-buttons {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .checkout-btn-cancel,
    .checkout-btn-confirm {
        width: 100%;
        padding: 0.875rem;
        border-radius: 10px;
    }
}

/* Scrollbar do Modal */
#checkoutModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#checkoutModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#checkoutModal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#checkoutModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Resumo do Pedido */
.checkout-order-summary {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 2px solid #e8ecff;
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.checkout-summary-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkout-summary-title i {
    color: #667eea;
    font-size: 1.1rem;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #4a5568;
}

.checkout-summary-row.checkout-summary-total {
    border-top: 2px solid #e2e8f0;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.checkout-summary-row.checkout-summary-total span:first-child {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
}

.checkout-summary-row.checkout-summary-total span:last-child {
    font-weight: 800;
    font-size: 1.35rem;
    background: var(--ff-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Checkbox "Sem número" */
.delivery-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4a5568;
    margin-top: -0.5rem;
}

.delivery-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ff-primary);
    cursor: pointer;
}

.delivery-checkbox-label span {
    user-select: none;
}
