/* Checkout Page - Secure & Professional Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="10" y="10" width="80" height="80" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/><rect x="30" y="30" width="40" height="40" fill="none" stroke="%23ffffff" stroke-width="0.3" opacity="0.08"/></svg>') repeat;
    background-size: 120px 120px;
    z-index: -1;
    animation: secure-grid 20s linear infinite;
}

@keyframes secure-grid {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(120px) translateY(120px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.nav-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Checkout Header */
.checkout-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.checkout-header h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 4rem;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 100%;
    width: 4rem;
    height: 2px;
    background: #dee2e6;
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step.active::after {
    background: #667eea;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.step-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

/* Main Content */
.checkout-main {
    padding: 3rem 0;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Form Sections */
.form-section {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-section.active {
    display: block;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2 i {
    color: #667eea;
}

/* Form Styles */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

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

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.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: #ef4444;
}

/* Shipping Options */
.shipping-options {
    margin-top: 1rem;
}

.shipping-options h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-size: 1.1rem;
}

.shipping-option {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.shipping-option:hover {
    border-color: #667eea;
}

.shipping-option input[type="radio"] {
    display: none;
}

.shipping-option input[type="radio"]:checked + label {
    background: #f0f3ff;
    border-color: #667eea;
}

.shipping-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    width: 100%;
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-name {
    font-weight: 600;
    color: #374151;
}

.option-time {
    font-size: 0.9rem;
    color: #6b7280;
}

.option-price {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

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

.payment-method {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

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

.payment-method i {
    font-size: 1.5rem;
    color: #667eea;
}

.payment-method span {
    font-weight: 500;
    color: #374151;
}

/* Card Form */
.card-form .form-group {
    position: relative;
}

.card-icons {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.card-icons i {
    font-size: 1.5rem;
    color: #6b7280;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Payment Form Alternatives */
.paypal-info,
.apple-pay-info {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.paypal-info i,
.apple-pay-info i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.apple-pay-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.apple-pay-btn:hover {
    background: #333;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-back,
.btn-next,
.btn-place-order {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-back {
    background: #f8f9fa;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-back:hover {
    background: #e9ecef;
}

.btn-next,
.btn-place-order {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-next:hover,
.btn-place-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-place-order {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
}

/* Review Section */
.review-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.review-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.review-section h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.review-info {
    color: #6b7280;
    line-height: 1.8;
}

.edit-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #5a67d8;
}

.review-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.review-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

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

.review-item-details h4 {
    color: #374151;
    margin-bottom: 0.25rem;
}

.review-item-details p {
    color: #6b7280;
    font-size: 0.9rem;
}

.review-item-price {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.terms-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
    background: #f0f3ff;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
}

.terms-acceptance input[type="checkbox"] {
    margin-top: 0.25rem;
}

.terms-acceptance label {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

.terms-acceptance a {
    color: #667eea;
    text-decoration: none;
}

.terms-acceptance a:hover {
    text-decoration: underline;
}

/* Order Summary */
.order-summary {
    position: sticky;
    top: 120px;
}

.summary-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.item-details p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.item-price {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

/* Summary Calculations */
.summary-calculations {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #374151;
}

.calc-row.total-row {
    border-top: 2px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

.discount-row {
    color: #10b981;
}

/* Promo Code */
.promo-code {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.promo-code input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
}

.promo-code button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promo-code button:hover {
    background: #5a67d8;
}

/* Security Badges */
.security-badges {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.badge i {
    color: #10b981;
    width: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.success-animation {
    margin-bottom: 2rem;
}

.success-animation i {
    font-size: 4rem;
    color: #10b981;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    80% {
        transform: translateY(-10px);
    }
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.modal-content p {
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.order-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: left;
}

.order-details p {
    margin-bottom: 0.5rem;
    color: #374151;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #f8f9fa;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: #374151;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .checkout-header h1 {
        font-size: 2rem;
    }
    
    .checkout-steps {
        gap: 2rem;
    }
    
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .order-summary {
        position: static;
        order: -1;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-back,
    .btn-next {
        width: 100%;
        justify-content: center;
    }
    
    .summary-item {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        padding: 2rem;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-brand h2 {
        font-size: 1.2rem;
    }
    
    .checkout-header h1 {
        font-size: 1.8rem;
    }
    
    .checkout-steps {
        gap: 1rem;
    }
    
    .step::after {
        width: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .summary-card {
        padding: 1.5rem;
    }
    
    .summary-item img {
        width: 60px;
        height: 60px;
    }
    
    .item-details h4 {
        font-size: 0.9rem;
    }
    
    .item-details p {
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .success-animation i {
        font-size: 3rem;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
}
