/**
 * Checkout Page Styles
 * 
 * Styles for multi-step checkout with Stripe integration
 * 
 * @package MarketDope
 * @since 2.5.0
 */

/* ==========================================================================
   Checkout Wrapper
   ========================================================================== */

.checkout-page-wrapper {
    padding: 40px 0 80px;
    background: #f7fafc;
}

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

/* ==========================================================================
   Progress Steps
   ========================================================================== */

.checkout-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.checkout-steps .step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 30px;
    position: relative;
}

.checkout-steps .step:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -2px;
    width: 40px;
    height: 2px;
    background: #e2e8f0;
}

.checkout-steps .step.active:not(:last-child)::after {
    background: #667eea;
}

.checkout-steps .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #718096;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.checkout-steps .step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.checkout-steps .step-label {
    font-weight: 600;
    color: #718096;
    font-size: 0.9375rem;
}

.checkout-steps .step.active .step-label {
    color: #2d3748;
}

/* ==========================================================================
   Checkout Layout
   ========================================================================== */

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

@media (max-width: 968px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .checkout-sidebar {
        order: -1;
    }
}

/* ==========================================================================
   Main Checkout Area
   ========================================================================== */

.checkout-main {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.checkout-step-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1a202c;
}

/* ==========================================================================
   Step 1: Review
   ========================================================================== */

.enrollment-summary {
    margin-bottom: 30px;
}

.course-info {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.course-thumbnail {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-details h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #2d3748;
}

.course-details p {
    color: #718096;
    line-height: 1.6;
}

.price-breakdown {
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row.subtotal {
    font-weight: 600;
    color: #2d3748;
}

.price-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

.price-row .price {
    font-weight: 600;
}

/* ==========================================================================
   Step 2: Information
   ========================================================================== */

.login-notice {
    padding: 15px 20px;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 8px;
    margin-bottom: 25px;
}

.login-notice p {
    margin: 0;
    color: #2c5282;
}

.login-notice a {
    color: #2b6cb0;
    font-weight: 600;
    text-decoration: underline;
}

/* Form styles inherited from login.css */

/* ==========================================================================
   Step 3: Payment
   ========================================================================== */

.payment-method {
    margin-bottom: 25px;
}

.payment-method label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
}

.payment-method-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.payment-label {
    font-weight: 600;
    color: #2d3748;
}

.card-logos {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stripe-elements {
    margin-bottom: 25px;
}

.stripe-card-element {
    padding: 15px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stripe-card-element:focus-within {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.card-errors {
    margin-top: 10px;
    color: #e53e3e;
    font-size: 0.875rem;
}

.security-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.security-badges .badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

.security-badges .badge svg {
    width: 16px;
    height: 16px;
    color: #48bb78;
}

/* ==========================================================================
   Step Actions
   ========================================================================== */

.step-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.step-actions .btn {
    flex: 1;
}

.step-actions .btn-outline {
    flex: 0 0 auto;
    min-width: 120px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.checkout-sidebar {
    position: sticky;
    top: 100px;
}

.order-summary,
.help-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.order-summary h3,
.help-box h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a202c;
}

.summary-course h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2d3748;
}

.course-includes {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.course-includes li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #4a5568;
    font-size: 0.9375rem;
}

.course-includes li svg {
    width: 18px;
    height: 18px;
    color: #667eea;
    flex-shrink: 0;
}

.summary-pricing {
    padding: 20px 0;
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #4a5568;
}

.price-line.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
    margin-top: 10px;
}

.summary-guarantee {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 15px;
}

.summary-guarantee p {
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #22543d;
    font-size: 0.9375rem;
}

.summary-guarantee p svg {
    width: 20px;
    height: 20px;
    color: #38a169;
}

.summary-guarantee p.small {
    font-size: 0.875rem;
    color: #276749;
}

.help-box p {
    color: #718096;
    margin-bottom: 15px;
}

.help-box .btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .checkout-main {
        padding: 25px 20px;
    }
    
    .checkout-steps {
        padding: 15px;
        overflow-x: auto;
    }
    
    .checkout-steps .step {
        padding: 0 15px;
    }
    
    .checkout-steps .step:not(:last-child)::after {
        width: 20px;
    }
    
    .checkout-steps .step-label {
        display: none;
    }
    
    .course-info {
        flex-direction: column;
    }
    
    .course-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .step-actions .btn,
    .step-actions .btn-outline {
        width: 100%;
    }
}
