/* Enhanced Checkout Styles */

/* Checkout Steps */
.checkout-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 1rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #667eea;
    color: white;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step.completed .step-number::before {
    content: '✓';
}

.step-title {
    font-weight: 500;
    white-space: nowrap;
}

/* Checkout Content */
.checkout-step-content {
    min-height: 400px;
}

.checkout-step-content h4 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

.checkout-step-content h5 {
    margin: 1.5rem 0 1rem 0;
    color: #555;
    font-size: 1.1rem;
}

/* Order Summary */
.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-item-image {
    width: 50px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 3px;
}

.order-item-details {
    flex: 1;
}

.order-item-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.order-item-details span.order-item-details {
    font-size: 0.9rem;
    color: #666;
}

.order-item-total {
    font-weight: 600;
    color: #667eea;
}

.order-total {
    text-align: right;
    font-size: 1.2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #667eea;
}

/* Forms */
.checkout-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-row .form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input::placeholder {
    color: #adb5bd;
}

/* Payment Methods */
.payment-methods {
    margin-bottom: 2rem;
}

.payment-method {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.payment-method.active {
    border-color: #667eea;
}

.payment-method-header {
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.payment-method-header input[type="radio"] {
    margin-right: 0.75rem;
}

.payment-method-header label {
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.payment-method-content {
    padding: 1rem;
    display: none;
}

.payment-method.active .payment-method-content {
    display: block;
}

/* Order Summary Final */
.order-summary-final {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.order-summary-final h5 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}



.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-line:last-child {
    border-bottom: none;
}

.summary-line.total {
    border-top: 2px solid #333;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.1rem;
}

/* Order Success Modal */
.order-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.order-success-modal {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: successSlideIn 0.5s ease;
}

@keyframes successSlideIn {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.order-success-modal h3 {
    color: #28a745;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.order-success-modal p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.6;
}

.order-number {
    background: #f8f9fa;
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
    margin: 1rem 0;
}

/* Enhanced Modal for Checkout */
#checkoutModal .modal-content {
    max-width: 700px;
    width: 95%;
}

#checkoutModal .modal-body {
    max-height: 600px;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    box-shadow: none !important;
}

/* Responsive Design for Checkout */
@media (max-width: 768px) {
    .checkout-steps {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .step {
        margin: 0;
    }
    
    .step-title {
        white-space: normal;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    #checkoutModal .modal-content {
        margin: 2% auto;
        width: 98%;
    }
    
    .order-success-modal {
        padding: 2rem 1rem;
    }
    
    .order-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .order-item-total {
        align-self: flex-end;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .checkout-steps {
        padding: 0.5rem 0;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .step-title {
        font-size: 0.9rem;
    }
    
    .order-success-modal {
        padding: 1.5rem 1rem;
    }
    
    .success-icon {
        font-size: 3rem;
    }
}