/**
 * Checkout Page Styles
 */

.checkout-page {
    padding-bottom: 2rem;
}

.checkout {
    max-width: 800px;
    margin: 0 auto;
}

/* Auth Section */
.checkout__section {
    background: var(--color-white);
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 2rem;
    margin-bottom: 2rem;
}

.checkout__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.checkout__section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.checkout__section-header h2 {
    margin-bottom: 0;
}

.checkout__section-description {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Checkout Items */
.checkout__items-list {
    margin-bottom: 1.5rem;
}

.checkout__item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.checkout__item:last-child {
    border-bottom: none;
}

.checkout__item-image {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
}

.checkout__item-title {
    font-family: "Maax Medium";
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.checkout__item-meta {
    font-size: 0.9rem;
    color: #666;
}

.checkout__item-total {
    font-family: "Maax Medium";
    font-weight: 400;
    text-align: right;
}

.checkout__subtotal {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

/* Form Styles */
.checkout__form-group {
    margin-bottom: 1.5rem;
}

.checkout__form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: "Maax Medium";
    font-weight: 400;
}

.checkout__form-group input,
.checkout__form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-gray-mid);
    border-radius: 0;
    font-size: 1rem;
}

.checkout__form-group input:focus,
.checkout__form-group select:focus {
    outline: none;
    border-color: var(--color-black);
}

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

/* Promo Code */
.checkout__promo-input {
    display: flex;
    gap: 0.5rem;
}

.checkout__promo-input input {
    flex: 1;
}

/* Message Boxes (Tax and Promo) */
.checkout__message {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 0;
    font-size: 0.9rem;
    display: none;
}

.checkout__message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.checkout__message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Order Total */
.checkout__total-breakdown {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 0;
}

.checkout__total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.checkout__total-row--total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-gray-mid);
    font-size: 1.2rem;
}

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

.checkout__payment-errors {
    color: #c62828;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Checkout Actions */
.checkout__actions {
    margin-top: 2rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
    margin-left: 0.5rem;
}

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

/* Loading State */
.checkout__loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .checkout__form-row {
        grid-template-columns: 1fr;
    }

    .checkout__item {
        grid-template-columns: 1fr;
    }

    .checkout__item-image {
        display: none;
    }
}
