/* Checkout Page Styles */

:root {
    --color-primary-red: rgb(244, 50, 69);
    --color-primary-red-light: rgb(255, 52, 71);
    --color-purple-dark: rgb(40, 35, 89);
    --color-charcoal: #2B2B2B;
    --color-off-white: #FAF8F5;
    --color-light-gray: #F5F5F5;
    --color-text-dark: #1A1A1A;
    --color-text-medium: #6B6B6B;
}

.checkout-container {
    min-height: 100vh;
    background: var(--color-off-white);
    padding: 8rem 2rem 4rem;
}

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

/* Order Summary */
.order-summary {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-dark);
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E0E0E0;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--color-light-gray);
}

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

.cart-item-name {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.25rem;
}

.cart-item-quantity {
    font-size: 0.875rem;
    color: var(--color-text-medium);
}

.cart-item-price {
    font-weight: 600;
    color: var(--color-primary-red);
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #E0E0E0;
    font-size: 1.25rem;
    font-weight: 700;
}

.total-amount {
    color: var(--color-primary-red);
}

/* Checkout Form */
.checkout-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.checkout-form h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--color-text-dark);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #E0E0E0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary-red);
    box-shadow: 0 0 0 3px rgba(244, 50, 69, 0.1);
}

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

/* Stripe Payment Element */
#payment-element {
    margin-bottom: 1.5rem;
}

#payment-message {
    color: #df1b41;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(223, 27, 65, 0.1);
}

#payment-message.hidden {
    display: none;
}

/* Pay Button */
.pay-button {
    width: 100%;
    padding: 1.125rem 2rem;
    background: linear-gradient(45deg, var(--color-primary-red) 0%, var(--color-primary-red-light) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(244, 50, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.pay-button:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--color-primary-red-light) 0%, var(--color-primary-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(244, 50, 69, 0.4);
}

.pay-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner.hidden {
    display: none;
}

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

    100% {
        transform: rotate(360deg);
    }
}

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

    .order-summary {
        position: relative;
        top: 0;
    }
}

@media (max-width: 640px) {
    .checkout-container {
        padding: 6rem 1rem 2rem;
    }

    .checkout-form,
    .order-summary {
        padding: 1.5rem;
    }

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