/**
 * Checkout Page - Optimized Layout
 * Professional two-column design to minimize scrolling
 */

/* Checkout Section Optimization */
.checkout-section {
    padding: 2rem 0 3rem;
    min-height: 100vh;
}

.checkout-section .container {
    max-width: 1200px;
}

/* Header Optimization - More Compact */
.checkout-header {
    text-align: center;
    margin-bottom: 3rem;
}

.checkout-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.checkout-header .lead {
    font-size: 1rem;
    color: var(--dark-gray);
    margin-bottom: 0;
}

/* Two-Column Layout */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2.5rem;
    align-items: start;
}

/* Left Column - Customer & Payment Info */
.checkout-main {
    min-width: 0;
    /* Prevent grid blowout */
}

/* Right Column - Order Summary (Sticky) */
.checkout-sidebar {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Section Styling - More Compact */
.checkout-section-block {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.checkout-section-block h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Form Optimization - Compact Inputs */
.checkout-section-block .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--secondary-color);
}

.checkout-section-block .form-control,
.checkout-section-block .form-select {
    height: 42px;
    font-size: 0.9375rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.875rem;
}

.checkout-section-block .form-control:focus,
.checkout-section-block .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(234, 87, 55, 0.1);
}

.checkout-section-block textarea.form-control {
    height: 80px;
    resize: none;
}

.checkout-section-block .form-text {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Row Spacing Optimization */
.checkout-section-block .row.g-3 {
    --bs-gutter-y: 0.875rem;
    --bs-gutter-x: 0.875rem;
}

/* Order Summary Card */
.order-summary-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.order-summary-card .card-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
}

.order-summary-card .card-body {
    padding: 1.25rem;
}

/* Quantity Selector - Compact */
.quantity-section {
    margin-bottom: 1.25rem;
}

.quantity-section .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.quantity-section .input-group {
    max-width: 100%;
}

.quantity-section .input-group .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.quantity-section .input-group .form-control {
    height: 42px;
    font-size: 1rem;
    font-weight: 600;
}

.discount-code-area .form-control {
    height: 40px;
    font-size: 0.875rem;
}

.discount-code-area .btn {
    height: 40px;
    padding: 0 1rem;
    font-size: 0.875rem;
}

.discount-code-area #discount-message {
    font-size: 0.8125rem;
}

/* Payment Section (Left Column) */
.payment-section {
    margin-bottom: 0;
}

.payment-section #card-element {
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
}

.payment-section #card-errors {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.payment-section small {
    font-size: 0.8125rem;
}

/* Payment Buttons Section (Right Sidebar) */
.payment-buttons-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 1rem;
}

.payment-buttons-section .btn-lg {
    height: 52px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.payment-buttons-section .btn-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 87, 55, 0.3);
}

.alternative-payment-methods {
    margin-top: 0.75rem;
}

.alternative-payment-methods small {
    font-size: 0.8125rem;
    color: #6b7280;
}

.alternative-payment-methods .btn {
    height: 46px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.alternative-payment-methods .btn:hover {
    transform: translateY(-1px);
}

/* Badge & Promotion */
.badge-corner {
    font-size: 0.8125rem;
}

.promotion-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}

/* Alert Optimization */
.alert {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 991px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .checkout-sidebar {
        position: static;
        max-height: none;
        order: -1;
        /* Show order summary first on mobile */
    }

    .checkout-section {
        padding: 1.5rem 0 2rem;
    }

    .checkout-header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 767px) {
    .checkout-section-block {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .order-summary-card .card-body {
        padding: 1rem;
    }

    .price-summary {
        padding: 0.875rem;
    }

    .checkout-header {
        margin-bottom: 1.5rem;
    }
}

/* Utility Classes for Checkout */
.border-dashed {
    border-style: dashed !important;
}

/* Smooth Scrolling for Sticky Sidebar */
.checkout-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.checkout-sidebar::-webkit-scrollbar {
    width: 6px;
}

.checkout-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.checkout-sidebar::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.checkout-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}