* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header styles */
.checkout-header {
    text-align: center;
    margin-bottom: 2rem;
}

.checkout-header h1 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.step {
    padding: 0.5rem 1rem;
    background: #e2e8f0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #718096;
    transition: all 0.3s ease;
}

.step.active {
    background: #4299e1;
    color: white;
    transform: scale(1.05);
}

/* Checkout container */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

/* Form styles */
.checkout-form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.form-section h2 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

input::placeholder {
    color: transparent;
}

label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 0 4px;
    color: #718096;
    transition: all 0.3s ease;
    pointer-events: none;
}

input:focus + label,
input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.85rem;
    color: #4299e1;
    transform: translateY(-50%) scale(0.85);
}

/* Payment methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.payment-method:hover {
    border-color: #4299e1;
    background: #f7fafc;
    transform: translateY(-2px);
}

.payment-method.selected {
    border-color: #4299e1;
    background: #ebf8ff;
}

.payment-method input[type="radio"] {
    display: none;
}

.payment-method label {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.radio-button {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-button:after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #4299e1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.payment-method input[type="radio"]:checked + label .radio-button {
    border-color: #4299e1;
}

.payment-method input[type="radio"]:checked + label .radio-button:after {
    transform: translate(-50%, -50%) scale(1);
}

.payment-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 0.5rem;
}

.payment-logo img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

/* Card details */
.card-details {
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* PayPal details */
.paypal-details {
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    color: #4a5568;
    animation: fadeIn 0.3s ease-out;
}

/* Order summary */
.order-summary {
    background: #f8fafc;
    padding: 2rem;
    border-left: 1px solid #e2e8f0;
}

.order-summary h2 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.checkout-items {
    margin-bottom: 1.5rem;
}

.checkout-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    animation: slideIn 0.3s ease-out forwards;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.item-price {
    color: #4a5568;
    font-size: 0.9rem;
}

.summary-totals {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: #4a5568;
}

.summary-row.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.place-order-btn {
    width: 100%;
    padding: 1rem;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.place-order-btn:not(:disabled):hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.place-order-btn:not(:disabled):active {
    transform: translateY(0);
}

.place-order-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
    width: 20px;
    height: 20px;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Error states */
.error {
    border-color: #e53e3e !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.notification.success {
    background: #48bb78;
}

.notification.error {
    background: #e53e3e;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Responsive design */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .payment-method label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .payment-logo {
        margin-left: 2.5rem;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}