/* =============================================
   PREMIUM CHECKOUT & PAYMENT GATEWAY - ENHANCED
   ============================================= */
.checkout-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.checkout-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    margin: 2% auto;
    width: 95%;
    max-width: 600px; /* Reduced from 650px for better fit */
    border-radius: 25px;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    animation: modalZoomIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.checkout-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #d4af37, #b8941f, #f4c542, #b8941f);
    background-size: 200% 100%;
    animation: shimmer 3s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.checkout-steps {
    padding: 1.5rem 2rem; /* Adjusted padding for better spacing */
}

.checkout-step {
    display: none;
    animation: fadeSlideIn 0.6s ease;
}

.checkout-step.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-step h2 {
    font-family: 'Cinzel', serif;
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem; /* Slightly reduced */
    font-weight: 700;
    position: relative;
    padding-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.checkout-step h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px; /* Reduced from 100px */
    height: 4px;
    background: linear-gradient(90deg, #d4af37, #b8941f);
    border-radius: 2px;
}

/* Close Button */
.close-checkout {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(44, 62, 80, 0.1);
    border: none;
    color: #2c3e50;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.close-checkout:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    transform: rotate(90deg) scale(1.1);
}

/* =============================================
   DELIVERY ADDRESS STEP - ENHANCED
   ============================================= */
#checkout-step-address {
    text-align: center;
}

.checkout-logo {
    max-width: 50px;
    margin-right: 12px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.address-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem; /* Reduced from 1.5rem */
    margin-top: 1.5rem; /* Reduced from 2rem */
    padding: 0 0.5rem; /* Added side padding */
}

.form-group {
    margin-bottom: 0;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: #d4af37;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px; /* Reduced padding */
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem; /* Slightly reduced */
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #d4af37;
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem; /* Reduced from 1.5rem */
}

/* Address Step Buttons */
.address-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding: 0 0.5rem; /* Added side padding */
}

.address-actions button {
    flex: 1;
    padding: 12px 20px; /* Reduced padding */
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#save-address {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c3e50;
    border: none;
}

#save-address:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .address-form {
        gap: 1rem;
        padding: 0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
    }
    
    .address-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* =============================================
   PAYMENT STEP - PROFESSIONAL REDESIGN
   ============================================= */
#checkout-step-payment {
    text-align: center;
}

.payment-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.payment-logo {
    max-width: 50px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Payment Amount Box - Moved to top */
.payment-amount-box {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1.5rem; /* Reduced from 1.8rem */
    border-radius: 15px;
    margin: 0 0 1.5rem 0; /* Adjusted margins */
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.4);
    border: 2px solid rgba(212, 175, 55, 0.4);
    text-align: center;
}

.payment-amount-box .label {
    font-size: 0.95rem; /* Slightly reduced */
    opacity: 0.9;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.payment-amount-box .amount {
    font-size: 2.2rem; /* Reduced from 2.5rem */
    font-weight: 900;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Payment Options Container */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Reduced from 2rem */
    margin-bottom: 2rem;
    padding: 0 0.5rem; /* Added side padding */
}

/* UPI Payment Box */
.upi-payment-box {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 15px;
    padding: 1.5rem; /* Reduced from 1.8rem */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    display: flex;
    gap: 1.5rem; /* Reduced from 1.8rem */
    align-items: center;
    transition: all 0.3s ease;
}

.upi-payment-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #d4af37;
}

@media (max-width: 768px) {
    .upi-payment-box {
        flex-direction: column;
        text-align: center;
        gap: 1.2rem;
    }
}

/* QR Code Container */
.upi-qr-container {
    background: white;
    padding: 12px; /* Reduced from 15px */
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 3px solid #d4af37;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.upi-qr-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.upi-qr {
    max-width: 160px; /* Reduced from 180px */
    display: block;
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.scan-text {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 8px; /* Reduced from 10px */
    font-size: 0.85rem; /* Slightly reduced */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* UPI ID Section */
.upi-id-section {
    background: linear-gradient(135deg, #fff9e6, #fffaf0);
    padding: 1.2rem; /* Reduced from 1.5rem */
    border-radius: 12px;
    border: 2px solid #d4af37;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.upi-id-section h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem; /* Reduced from 1rem */
    font-family: 'Cinzel', serif;
    font-size: 1.1rem; /* Slightly reduced */
    display: flex;
    align-items: center;
    gap: 8px;
}

.upi-id-box {
    background: white;
    padding: 0.8rem; /* Reduced from 1rem */
    border-radius: 10px;
    border: 2px dashed #d4af37;
    margin-bottom: 0.8rem; /* Reduced from 1rem */
    position: relative;
}

.upi-id {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem; /* Reduced from 1.2rem */
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.8rem; /* Reduced from 1rem */
    padding: 8px; /* Reduced from 10px */
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.copy-upi-btn {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c3e50;
    border: none;
    padding: 10px 20px; /* Reduced from 12px 24px */
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
    width: 100%;
}

.copy-upi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.4);
}

.copy-upi-btn.copied {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Instructions */
.payment-instructions {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 12px;
    padding: 1.5rem; /* Reduced from 1.8rem */
    margin: 1.2rem 0; /* Reduced from 1.5rem */
    text-align: left;
    border-left: 5px solid #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
}

.payment-instructions h4 {
    color: #1565c0;
    margin-bottom: 0.8rem; /* Reduced from 1rem */
    font-family: 'Cinzel', serif;
    font-size: 1rem; /* Slightly reduced */
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-instructions ol {
    padding-left: 1.2rem; /* Reduced from 1.5rem */
    color: #0d47a1;
    margin: 0;
}

.payment-instructions li {
    margin-bottom: 0.6rem; /* Reduced from 0.8rem */
    line-height: 1.4;
    font-size: 0.9rem;
    padding-left: 5px;
}

.payment-instructions li strong {
    color: #d4af37;
}

.payment-instructions li::marker {
    font-weight: 700;
    color: #2196f3;
}

/* Payment Action Button */
#payment-done {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 14px 28px; /* Reduced from 16px 32px */
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 280px; /* Reduced from 300px */
    justify-content: center;
}

#payment-done:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.4);
}

/* Payment Step Actions */
.payment-actions {
    padding: 0 0.5rem; /* Added side padding */
}

/* =============================================
   PROOF UPLOAD STEP - ENHANCED
   ============================================= */
#checkout-step-proof {
    text-align: center;
}

#payment-proof-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem; /* Reduced from 1.5rem */
    margin-top: 1.5rem; /* Reduced from 2rem */
    padding: 0 1rem; /* Added side padding for more space */
}

/* File Upload Area */
.file-upload-area {
    border: 3px dashed #d4af37;
    border-radius: 15px;
    padding: 2.5rem 1.5rem; /* Reduced padding */
    text-align: center;
    background: linear-gradient(135deg, #fff9e6, #fffaf0);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    background: linear-gradient(135deg, #fff5d6, #fff0cc);
    border-color: #b8941f;
    transform: translateY(-2px);
}

.file-upload-area.drag-over {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-color: #28a745;
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: #d4af37; }
    50% { border-color: #28a745; }
}

.file-upload-area i {
    font-size: 2.5rem; /* Reduced from 3rem */
    color: #d4af37;
    margin-bottom: 0.8rem;
    display: block;
}

.file-upload-area p {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.file-upload-area small {
    color: #6c757d;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Screenshot Preview */
.screenshot-preview-container {
    display: none;
    margin-top: 1.2rem;
    text-align: center;
}

.screenshot-preview {
    max-width: 100%;
    max-height: 250px; /* Reduced from 300px */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid #d4af37;
    margin-top: 0.8rem;
}

/* Transaction ID Input */
.transaction-input {
    position: relative;
}

.transaction-input input {
    padding: 12px 14px; /* Reduced padding */
    padding-right: 50px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.transaction-input .input-hint {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.8rem;
}

/* Submit Button - Professional Size */
.proof-submit-btn {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c3e50;
    border: none;
    padding: 12px 24px; /* Reduced from 16px 32px */
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem; /* Reduced from 1.1rem */
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    width: 100%;
    max-width: 220px; /* Added max-width for professional size */
    height: 48px; /* Fixed height for consistency */
}

.proof-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

.proof-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =============================================
   SUCCESS STEP - ENHANCED
   ============================================= */
#checkout-step-success {
    text-align: center;
    padding: 2.5rem 1.5rem; /* Reduced padding */
}

.success-icon {
    font-size: 4rem; /* Reduced from 5rem */
    color: #28a745;
    margin-bottom: 1.5rem;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);} /* Reduced from -30px */
    60% {transform: translateY(-10px);} /* Reduced from -15px */
}

.success-details {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 15px;
    padding: 1.5rem; /* Reduced from 2rem */
    margin: 1.5rem 0; /* Reduced from 2rem */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.success-details p {
    margin: 0.8rem 0; /* Reduced from 1rem */
    font-size: 1rem; /* Reduced from 1.1rem */
    color: #2c3e50;
}

.success-details strong {
    color: #d4af37;
    font-weight: 700;
}

.success-actions {
    display: flex;
    gap: 0.8rem; /* Reduced from 1rem */
    justify-content: center;
    margin-top: 1.5rem; /* Reduced from 2rem */
    flex-wrap: wrap;
    padding: 0 0.5rem; /* Added side padding */
}

.success-actions .btn {
    padding: 10px 20px; /* Reduced from 12px 24px */
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 160px; /* Reduced from 180px */
    justify-content: center;
    font-size: 0.95rem;
}

.success-actions .btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c3e50;
}

.success-actions .btn-secondary {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.success-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 768px) {
    .checkout-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
        border-radius: 20px;
        max-width: 500px; /* Reduced for mobile */
    }
    
    .checkout-steps {
        padding: 1.5rem 1.2rem; /* Adjusted for mobile */
    }
    
    .checkout-step h2 {
        font-size: 1.5rem; /* Reduced from 1.7rem */
    }
    
    .upi-qr {
        max-width: 140px; /* Reduced from 150px */
    }
    
    .payment-amount-box .amount {
        font-size: 1.8rem; /* Reduced from 2rem */
    }
    
    .upi-payment-box {
        padding: 1.2rem; /* Reduced from 1.5rem */
    }
    
    .payment-instructions {
        padding: 1.2rem; /* Reduced from 1.5rem */
    }
    
    #payment-proof-form {
        padding: 0 0.5rem; /* Reduced side padding for mobile */
    }
    
    .proof-submit-btn {
        max-width: 200px; /* Adjusted for mobile */
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .checkout-modal-content {
        width: 96%;
        margin: 1% auto;
        max-width: 420px; /* Further reduced for small phones */
    }
    
    .checkout-steps {
        padding: 1.2rem 1rem;
    }
    
    .checkout-step h2 {
        font-size: 1.3rem;
    }
    
    .upi-qr {
        max-width: 120px;
    }
    
    .payment-amount-box {
        padding: 1.2rem;
    }
    
    .file-upload-area {
        padding: 2rem 1rem;
    }
    
    .success-actions .btn {
        min-width: 140px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .proof-submit-btn {
        max-width: 180px;
        height: 44px;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 18px; /* Slightly reduced */
    height: 18px; /* Slightly reduced */
    border: 2px solid rgba(255, 255, 255, 0.3); /* Reduced from 3px */
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}