/* Checkout Page Styles - Premium Modern Design */
.checkout-page {
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f8 100%);
    min-height: calc(100vh - 80px);
    padding: 112px 0 56px;
    margin: 0;
    color: #2d3748;
}


.checkout-container {
    max-width: 1200px;
    margin: 50px auto 0;
    padding: 0 24px;
}

@media (min-width: 1024px) {
    .checkout-container {
        padding: 0 80px;
    }
}

/* Unified hero: title + breadcrumb band */
.checkout-hero {
    margin-bottom: 32px;
    padding: 32px 32px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 85, 145, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 85, 145, 0.05);
}

.checkout-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.checkout-hero__title-block {
    flex: 0 1 auto;
    min-width: 0;
}

html[dir="rtl"] .checkout-hero__title-block {
    text-align: right;
    order: 1;
}

html[dir="rtl"] .checkout-hero .breadcrumb-nav {
    order: 2;
    margin-inline-start: auto;
}

html[dir="ltr"] .checkout-hero__title-block {
    text-align: left;
    order: 1;
}

html[dir="ltr"] .checkout-hero .breadcrumb-nav {
    order: 2;
    margin-inline-start: auto;
}

/* Breadcrumbs pill */
.breadcrumb-nav {
    margin-bottom: 0;
    padding: 10px 18px;
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid rgba(0, 85, 145, 0.1);
    display: flex;
    box-shadow: 0 2px 12px rgba(0, 85, 145, 0.06);
    flex-shrink: 1;
    max-width: 100%;
    min-width: 0;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
    row-gap: 6px;
}

.breadcrumb-sep-icon {
    width: 14px;
    height: 14px;
    opacity: 0.45;
    display: block;
}

html[dir="rtl"] .breadcrumb-sep-icon {
    transform: rotate(180deg);
}

.breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.breadcrumb-link:hover {
    color: #005591;
}

.breadcrumb-sep {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.breadcrumb-current {
    color: #005591;
    font-weight: 700;
    white-space: nowrap;
}

.breadcrumb-link--course {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

.checkout-title {
    font-size: clamp(1.375rem, 2.2vw, 1.875rem);
    font-weight: 800;
    color: #005591;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
    line-height: 1.25;
    padding-bottom: 10px;
}

.checkout-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 44px;
    height: 3px;
    background: linear-gradient(90deg, #005591, #46a0e2);
    border-radius: 2px;
}

html[dir="rtl"] .checkout-title::after {
    left: auto;
    right: 0;
}

@media (max-width: 768px) {
    .checkout-page {
        padding: 96px 0 40px;
    }

    .checkout-container {
        margin-top: 24px;
        padding: 0 16px;
    }

    .checkout-hero {
        padding: 24px 20px;
        margin-bottom: 24px;
    }

    .checkout-hero__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    html[dir="rtl"] .checkout-hero__title-block,
    html[dir="ltr"] .checkout-hero__title-block {
        text-align: inherit;
        order: unset;
    }

    html[dir="rtl"] .checkout-hero .breadcrumb-nav,
    html[dir="ltr"] .checkout-hero .breadcrumb-nav {
        order: unset;
        margin-inline-start: 0;
        width: 100%;
        justify-content: flex-start;
        border-radius: 14px;
        padding: 12px 14px;
    }

    .breadcrumb-container {
        justify-content: flex-start;
        width: 100%;
        row-gap: 8px;
    }

    .breadcrumb-link,
    .breadcrumb-current {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Course title can use more width and wrap */
    .breadcrumb-link--course {
        max-width: min(100%, 18rem);
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.35;
    }

    /* Payment (current) drops to its own line on mobile */
    .breadcrumb-current {
        flex: 1 0 100%;
        margin-top: 2px;
        padding-top: 6px;
        border-top: 1px dashed rgba(0, 85, 145, 0.12);
    }

    .breadcrumb-sep:has(+ .breadcrumb-current) {
        display: none;
    }

    .checkout-panel {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .course-summary-card {
        flex-direction: column;
        gap: 18px;
    }

    .course-summary-card:hover {
        transform: none;
    }

    .course-thumbnail-wrap {
        width: 100%;
    }

    .course-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 220px;
    }

    .course-summary-details {
        min-width: 0;
    }

    .course-summary-title {
        font-size: 18px;
    }

    .course-summary-meta {
        flex-direction: column;
        gap: 10px;
    }

    .payment-card {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .payment-card-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .payment-card-desc {
        margin: -12px 0 20px;
    }

    .order-item {
        font-size: 14px;
        gap: 12px;
    }

    .order-item-label {
        flex: 1;
        min-width: 0;
        padding-inline-end: 8px;
    }

    .order-item-value {
        flex-shrink: 0;
        text-align: end;
    }

    .order-item.order-total {
        font-size: 18px;
        padding: 14px;
    }

    .payment-button {
        padding: 16px;
        font-size: 16px;
    }

    .payment-security {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .checkout-page {
        padding: 88px 0 32px;
    }

    .checkout-container {
        margin-top: 16px;
        padding: 0 12px;
    }

    .checkout-hero {
        padding: 18px 14px;
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .checkout-title {
        font-size: 1.25rem;
    }

    .breadcrumb-nav {
        padding: 10px 12px;
    }

    .breadcrumb-container {
        font-size: 12px;
        gap: 6px;
    }

    .breadcrumb-link--course {
        max-width: 100%;
    }

    .checkout-panel {
        padding: 16px 14px;
    }

    .course-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    .benefit-item {
        font-size: 12px;
    }

    .payment-modal-top {
        padding: 18px 16px 12px;
    }

    .payment-modal-title {
        font-size: 17px;
    }

    .payment-modal-subtitle {
        font-size: 12px;
    }

    .payment-modal-summary {
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto auto;
        gap: 10px 12px;
        padding: 14px 16px;
    }

    .payment-modal-summary__amount {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: start;
        padding-top: 10px;
        border-top: 1px solid #e2e8f0;
        margin-top: 2px;
    }

    .payment-modal-trust {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 16px;
    }

    .payment-modal-form {
        padding: 16px;
    }

    .payment-cancel-confirm__actions {
        flex-direction: column;
    }
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .checkout-payment {
        order: -1;
    }

    .payment-card {
        position: static;
        top: auto;
    }
}

/* Course Summary Card - Glass & Hover */
.course-summary-card {
    background: rgba(255, 255, 255, 0.8);

    border-radius: 20px;

    display: flex;
    gap: 28px;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.course-summary-card:hover {
    transform: translateY(-5px);

}

.course-thumbnail {
    width: 160px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease;
}

.course-summary-card:hover .course-thumbnail {
    transform: scale(1.03);
}

.course-summary-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.course-summary-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a202c;
    line-height: 1.3;
}

.course-summary-category {
    font-size: 14px;
    color: #005591;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.course-summary-meta {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #4a5568;
    flex-wrap: wrap;
    background: #f7fafc;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #edf2f7;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.meta-item svg {
    color: #ed8936;
}

/* Payment Card - Premium Look */
.payment-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 32px;
    transition: box-shadow 0.3s ease;
}

.payment-card:hover {
    box-shadow: 0 20px 60px rgba(0, 85, 145, 0.1), 0 0 0 1px rgba(0, 85, 145, 0.05);
}

.payment-card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-items {
    margin-bottom: 32px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    color: #4a5568;
}

.order-item-label {
    font-weight: 500;
}

.order-item-value {
    font-weight: 600;
    color: #2d3748;
}

.order-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 24px 0;
}

.order-item.order-total {
    font-weight: 800;
    color: #1a202c;
    font-size: 22px;
    margin-bottom: 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}

.order-total .order-item-value {
    color: #005591;
}

/* Modern Animated Button */
.payment-button {
    width: 100%;
    background: linear-gradient(135deg, #005591 0%, #46a0e2 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 85, 145, 0.28);
    position: relative;
    overflow: hidden;
}

.payment-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.payment-button:hover::before {
    left: 100%;
}

.payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 85, 145, 0.35);
}

.payment-button:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(0, 85, 145, 0.25);
}

.payment-button:disabled {
    background: #cbd5e0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.payment-security {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.payment-security svg {
    color: #48bb78;
}

/* Modal — enhanced card popup */
.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.35s, opacity 0.35s ease;
}

@media (min-width: 640px) {
    .payment-modal {
        align-items: center;
        padding: 24px;
    }
}

.payment-modal[style*="display: flex"] {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.payment-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.payment-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 28px 28px 20px 20px;
    padding: 0;
    position: relative;
    z-index: 1001;
    box-shadow: 0 32px 64px -16px rgba(0, 85, 145, 0.22), 0 0 0 1px rgba(0, 85, 145, 0.06);
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .payment-modal-content {
        border-radius: 24px;
        transform: scale(0.92) translateY(24px);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    }
}

.payment-modal[style*="display: flex"] .payment-modal-content {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .payment-modal[style*="display: flex"] .payment-modal-content {
        transform: scale(1) translateY(0);
    }
}

.payment-modal-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, rgba(0, 85, 145, 0.04) 0%, transparent 100%);
}

.payment-modal-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.payment-modal-brand__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #005591, #46a0e2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 85, 145, 0.25);
}

.payment-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.2;
}

.payment-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #64748b;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.payment-modal-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.payment-modal-summary__thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.payment-modal-summary__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-modal-summary__label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.payment-modal-summary__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.payment-modal-summary__amount {
    text-align: end;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-modal-summary__amount strong {
    font-size: 20px;
    font-weight: 900;
    color: #005591;
    line-height: 1;
}

.payment-modal-summary__amount strong small {
    font-size: 12px;
    font-weight: 700;
}

.payment-modal-trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.payment-modal-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}

.payment-modal-trust__logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
}

.payment-modal-form {
    padding: 20px 24px 28px;
    min-height: 120px;
}

.payment-cancel-confirm {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px 24px;
    text-align: center;
}

.payment-cancel-confirm[hidden] {
    display: none !important;
}

.payment-cancel-confirm p {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.payment-cancel-confirm__actions {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}

.payment-cancel-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-cancel-btn:hover {
    background: #f8fafc;
}

.payment-cancel-btn.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.payment-cancel-btn.danger:hover {
    background: #fee2e2;
}

/* Loader Animation */
.button-loader {
    display: inline-block;
    position: relative;
}

.button-loader::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Checkout layout extras */
.checkout-panel {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(0, 85, 145, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.course-thumbnail-wrap {
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
}

.course-thumbnail-link {
    display: block;
    line-height: 0;
}

.course-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: linear-gradient(135deg, #005591, #46a0e2);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 85, 145, 0.3);
    pointer-events: none;
}

html[dir="rtl"] .course-badge {
    right: auto;
    left: 8px;
}

.course-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.benefit-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 85, 145, 0.08);
    color: #005591;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-card-desc {
    font-size: 14px;
    color: #64748b;
    margin: -20px 0 24px;
    line-height: 1.5;
}

.provider-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
}

.button-loader {
    display: flex;
    align-items: center;
    gap: 6px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: loaderBounce 1.2s infinite ease-in-out both;
}

.loader-dot:nth-child(1) { animation-delay: -0.24s; }
.loader-dot:nth-child(2) { animation-delay: -0.12s; }

@keyframes loaderBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}