/* ============================================
   CHECKOUT PAGE STYLES
   ============================================ */

/* Checkout Section */
.checkout-section {
    padding: var(--space-3xl) 0;
    background-color: var(--neutral-50);
    min-height: calc(100vh - 80px);
}

.checkout-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-lg);
}

/* Shipping Notice */
.shipping-notice {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-50) 100%);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.shipping-notice .icon {
    width: 24px;
    height: 24px;
    fill: var(--primary-600);
    flex-shrink: 0;
}

.shipping-notice p {
    margin: 0;
    color: var(--primary-800);
    font-size: 14px;
    font-weight: 500;
}

.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    margin: 0 auto;
}

/* Checkout Form */
.checkout-form-container {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
}

.form-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--neutral-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-xl);
}

.form-section-title .icon {
    width: 20px;
    height: 20px;
    fill: var(--primary-600);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    color: var(--neutral-700);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    display: inline-flex;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all var(--transition-fast);
    background-color: white;
    color: var(--neutral-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--error);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Card Brand Logos */
.card-brand-logos {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding: var(--space-sm) 0;
}

.card-logo {
    width: 48px;
    height: 32px;
    opacity: 0.5;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.card-logo:hover {
    opacity: 1;
    transform: scale(1.1);
}

.form-group:focus-within .card-logo {
    opacity: 0.8;
}

.error-message {
    color: var(--error);
    font-size: 12px;
    margin-top: var(--space-xs);
    display: block;
}

/* Checkbox and Radio Styles */
.checkbox-label,
.payment-method {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--neutral-700);
}

.checkbox-label input[type="checkbox"],
.payment-method input[type="radio"] {
    display: none;
}

.checkmark,
.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--transition-fast);
    display: inline-block;
    flex-shrink: 0;
}

.radio-mark {
    border-radius: var(--radius-full);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark,
.payment-method input[type="radio"]:checked + .radio-mark {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border-color: var(--primary-600);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.payment-method input[type="radio"]:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: var(--radius-full);
}

.payment-method .icon {
    width: 20px;
    height: 20px;
    fill: var(--neutral-500);
}

.payment-method input[type="radio"]:checked ~ .icon {
    fill: var(--primary-600);
}

/* Billing Address Styles */
#billingFields {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background-color: var(--neutral-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-base);
}

#billingFields.show {
    display: block !important;
}

.checkbox-label {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background-color: var(--neutral-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-fast);
}

.checkbox-label:hover {
    background-color: white;
    border-color: var(--primary-300);
}

.checkbox-label input[type="checkbox"]:checked ~ * {
    color: var(--primary-700);
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background-color: var(--primary-50);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Payment Methods */
.payment-methods {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.payment-method {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background-color: var(--neutral-50);
}

.payment-method:hover {
    border-color: var(--primary-300);
    background-color: white;
}

.payment-method input[type="radio"]:checked ~ * {
    color: var(--primary-700);
}

.payment-method:has(input[type="radio"]:checked) {
    border-color: var(--primary-500);
    background-color: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-md);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    border: none;
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-700);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-700);
    border: 2px solid var(--primary-600);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-700);
    color: var(--primary-800);
}

/* Loading indicator */
.loading-cart {
    text-align: center;
    color: var(--neutral-500);
    font-style: italic;
    padding: var(--space-lg);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Order Summary */
.order-summary-container {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.order-summary {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    position: sticky;
    top: 100px;
}

.order-summary h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--neutral-200);
}

.order-items {
    margin-bottom: var(--space-lg);
}

.order-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--neutral-100);
}

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

.order-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
}

.order-item-details h4 {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--neutral-800);
    margin: 0 0 var(--space-xs) 0;
}

.order-item-details p {
    margin: 0;
    font-size: 13px;
    color: var(--neutral-500);
}

.order-item-price {
    margin-left: auto;
    font-weight: 700;
    color: var(--neutral-800);
    font-size: 14px;
}

.order-totals {
    border-top: 2px solid var(--neutral-200);
    padding-top: var(--space-md);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: 14px;
    color: var(--neutral-600);
}

.total-row.total-final {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--neutral-900);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--neutral-200);
    margin-top: var(--space-sm);
}

.security-badges {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--neutral-200);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 13px;
    color: var(--neutral-600);
}

.security-badge .icon {
    width: 18px;
    height: 18px;
    fill: var(--primary-600);
    background: var(--primary-50);
    padding: var(--space-xs);
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--neutral-200);
}

.modal-header .icon {
    width: 64px;
    height: 64px;
    fill: var(--primary-600);
    margin-bottom: var(--space-md);
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--neutral-800);
}

.modal-body {
    padding: var(--space-lg) var(--space-xl);
}

.modal-body p {
    margin-bottom: var(--space-md);
    color: var(--neutral-600);
}

.order-number {
    background-color: var(--primary-50);
    border: 2px solid var(--primary-200);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-800);
    margin: var(--space-md) 0;
}

.modal-footer {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
    border-top: 1px solid var(--neutral-200);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .order-summary-container {
        position: static;
    }

    .order-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .checkout-section {
        padding: var(--space-2xl) 0;
    }

    .checkout-form-container,
    .order-summary {
        padding: var(--space-lg);
    }

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

    .payment-methods {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .checkout-section {
        padding: var(--space-xl) 0;
    }

    .checkout-form-container,
    .order-summary {
        padding: var(--space-md);
    }

    .modal-content {
        margin: var(--space-md);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-lg);
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
