/* Checkout Page Styles */

.checkout-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.checkout-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.checkout-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.checkout-content {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Order Summary */
.order-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.order-summary h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.order-items {
    margin-bottom: 20px;
}

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

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

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

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

.item-quantity {
    margin: 0 15px;
    font-weight: 500;
    color: #666;
}

.item-price {
    font-weight: 600;
    color: #333;
}

.order-total {
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

.total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
}

/* Checkout Form */
.checkout-form {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.checkout-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.checkout-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

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

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1.125rem 1.5rem;
    border: 2px solid #e5e5e7;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    position: relative;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a1a1a6;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), 0 8px 25px rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
    color: #c7c7cc;
    transform: translateY(-2px);
}

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

.form-group input:valid {
    border-color: #27ae60;
}

/* Payment Methods */
.payment-methods {
    display: grid;
    gap: 15px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border: 2px solid #e5e5e7;
    border-radius: 16px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.payment-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.payment-option:hover {
    border-color: #667eea;
    background-color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.payment-option:hover::before {
    transform: scaleX(1);
}

.payment-option input[type="radio"] {
    margin-right: 12px;
    width: auto;
}

.payment-option input[type="radio"]:checked + .payment-label {
    color: #667eea;
    font-weight: 600;
}

.payment-option:has(input:checked) {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.payment-option:has(input:checked)::before {
    transform: scaleX(1);
}

.payment-label {
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.payment-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.btn-primary,
.btn-secondary {
    padding: 1.125rem 2rem;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    flex: 1;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.35);
}

.btn-secondary {
    background: #fafafa;
    color: #666;
    border: 2px solid #e5e5e7;
}

.btn-secondary:hover {
    background: #f0f0f0;
    border-color: #d1d1d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Empty Cart Message */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-cart p {
    margin-bottom: 20px;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    z-index: 11;
    animation: spin 1s linear infinite;
}

.loading .btn-primary {
    background: #667eea;
    position: relative;
    overflow: hidden;
}

.loading .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Success Message */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
/* Large tablets */
@media (max-width: 1024px) {
    .checkout-wrapper {
        gap: 30px;
        max-width: 900px;
        padding: 0 20px;
    }
    
    .checkout-hero {
        padding: 70px 0 50px;
    }
    
    .checkout-hero h1 {
        font-size: 2.2rem;
    }
    
    .checkout-hero p {
        font-size: 1.1rem;
    }
    
    .order-summary,
    .checkout-form {
        padding: 25px;
    }
    
    .order-summary h2,
    .checkout-form h2 {
        font-size: 1.4rem;
    }
}

/* Tablets and mobile landscape */
@media (max-width: 768px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 15px;
    }
    
    .order-summary {
        order: 2;
        position: static;
    }
    
    .checkout-form {
        order: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .checkout-hero {
        padding: 60px 0 40px;
    }
    
    .checkout-hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .checkout-hero p {
        font-size: 1rem;
    }
    
    .checkout-content {
        padding: 40px 0;
    }
    
    .order-summary,
    .checkout-form {
        padding: 20px;
        border-radius: 10px;
    }
    
    .order-summary h2,
    .checkout-form h2 {
        font-size: 1.3rem;
    }
    
    .order-item {
        padding: 12px 0;
    }
    
    .item-name {
        font-size: 0.95rem;
    }
    
    .item-details {
        font-size: 0.85rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 25px;
        font-size: 0.95rem;
        width: 100%;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .checkout-hero {
        padding: 50px 0 30px;
    }
    
    .checkout-hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .checkout-hero p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .checkout-content {
        padding: 30px 0;
    }
    
    .checkout-wrapper {
        gap: 20px;
        padding: 0 10px;
    }
    
    .order-summary,
    .checkout-form {
        padding: 15px;
        border-radius: 8px;
    }
    
    .order-summary h2,
    .checkout-form h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .order-item {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-info {
        width: 100%;
    }
    
    .item-name {
        font-size: 0.9rem;
    }
    
    .item-details {
        font-size: 0.8rem;
    }
    
    .item-quantity,
    .item-price {
        margin: 0;
        font-size: 0.9rem;
    }
    
    .total-row {
        padding: 8px 0;
    }
    
    .total-label,
    .total-value {
        font-size: 0.95rem;
    }
    
    .final-total .total-value {
        font-size: 1.1rem;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .form-row {
        gap: 15px;
    }
    
    .form-actions {
        gap: 12px;
        margin-top: 20px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .success-message,
    .error-message {
        padding: 12px;
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .checkout-hero {
        padding: 40px 0 25px;
    }
    
    .checkout-hero h1 {
        font-size: 1.6rem;
    }
    
    .checkout-hero p {
        font-size: 0.9rem;
    }
    
    .checkout-wrapper {
        padding: 0 8px;
        gap: 15px;
    }
    
    .order-summary,
    .checkout-form {
        padding: 12px;
    }
    
    .order-summary h2,
    .checkout-form h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .order-item {
        padding: 8px 0;
    }
    
    .item-name {
        font-size: 0.85rem;
    }
    
    .item-details {
        font-size: 0.75rem;
    }
    
    .item-quantity,
    .item-price {
        font-size: 0.85rem;
    }
    
    .total-label,
    .total-value {
        font-size: 0.9rem;
    }
    
    .final-total .total-value {
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 9px 10px;
        font-size: 0.85rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .success-message,
    .error-message {
        padding: 10px;
        font-size: 0.85rem;
    }
}