/* Page loading overlay */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.page-loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.page-loading-spinner {
    text-align: center;
}
.spinner-pulse {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #0d6efd;
    animation: pulse-ring 1.2s ease-out infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}
.page-loading-text {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Container width override */
.container {
    max-width: 1100px;
}

/* Mobile horizontal scroll nav */
.mobile-nav-scroll {
    overflow: hidden;
}
.mobile-nav-inner {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 4px;
}
.mobile-nav-inner::-webkit-scrollbar {
    display: none;
}
.mobile-nav-link {
    white-space: nowrap;
    padding: 10px 16px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.15s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #fff;
}

/* Desktop nav links — add spacing */
#mainNav .nav-link {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Navbar search icon */
.nav-search-icon {
    color: rgba(255,255,255,0.75);
    font-size: 1.2rem;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.nav-search-icon:hover { color: #fff; }

/* Carousel */
.carousel-item img {
    height: 400px;
    object-fit: cover;
    cursor: pointer;
}
@media (max-width: 768px) {
    .carousel-item img { height: 220px; }
}

/* Article grid — 3 columns, aligned with carousel */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 100%;
}
.masonry-item {
    min-width: 0;            /* Allow grid cell to shrink below content min-width */
    width: 100%;             /* Fill assigned grid cell */
    overflow: hidden;        /* Contain child content */
}
@media (max-width: 992px) {
    .masonry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .masonry-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Article card */
.article-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.article-card .card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.article-card .card-img-placeholder {
    width: 100%;
    height: 180px;
    font-size: 2rem;
}

/* ── Lazy image loading ── */
/* Card images have a subtle background while loading */
.card-img-top {
    background: #e9ecef;
    transition: opacity 0.35s ease;
}
/* Dynamically lazy-loaded images are hidden until loaded */
.card-img-top.lazy-img {
    opacity: 0;
}
.card-img-top.lazy-img.loaded {
    opacity: 1;
}
/* Shimmer animation for the placeholder while image loads */
.card-img-shimmer {
    position: relative;
    overflow: hidden;
    background: #e9ecef;
}
.card-img-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 100%
    );
    animation: shimmer-slide 1.6s ease-in-out infinite;
}
@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Article card title — 2-line clamp */
.article-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 2.66rem;
}

/* Related articles grid — 2 columns PC/tablet, 1 column mobile */
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
@media (max-width: 576px) {
    .related-articles-grid { grid-template-columns: 1fr; }
}

/* Related article card */
.related-article-card {
    display: block;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.related-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.10);
    color: inherit;
}
.related-card-img-wrap {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #f1f3f5;
}
.related-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}
.related-card-body {
    padding: 0.875rem 1rem;
}
.related-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 2.52rem;
    margin-bottom: 0.5rem;
    color: #212529;
}
.related-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Premium badge - top right corner */
.premium-badge-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

/* Premium paywall card */
.premium-gate-card {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Footer */
footer,
footer a,
footer p,
footer h5,
footer h6 { color: #eeeeee; }
footer a:hover { color: #ffffff; }

/* Comments — Douyin style */
.cmt-item {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #f2f2f2;
}
.cmt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1;
}
.cmt-main {
    flex: 1;
    min-width: 0;
}
.cmt-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}
.cmt-nick {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.cmt-country {
    font-size: 11px;
    color: #999;
}
.cmt-time {
    font-size: 11px;
    color: #bbb;
    margin-left: auto;
}
.cmt-text {
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    margin-bottom: 6px;
    word-break: break-word;
}
.cmt-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cmt-act {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
    transition: color 0.15s;
}
.cmt-act:hover {
    color: #555;
}
.cmt-act.cmt-like .bi-heart {
    font-size: 13px;
}
.cmt-act.cmt-like:hover {
    color: #ff4d4f;
}
.cmt-pending {
    opacity: 0.6;
}
/* Replies */
.cmt-replies {
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid #f0f0f0;
}
.cmt-reply {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}
.cmt-reply + .cmt-reply {
    border-top: 1px solid #f8f8f8;
}
.cmt-more-replies {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    padding: 6px 0 0 12px;
}
.cmt-more-replies:hover {
    color: #555;
}
.cmt-reply-form {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Comment fade-in animation */
#commentsSection {
    transition: opacity 0.25s ease;
}
.cmt-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#page-article .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Loading spinner for infinite scroll */
.load-more-sentinel {
    text-align: center;
    padding: 2rem;
}

/* Plans */
.plan-card.featured {
    border: 2px solid #0d6efd;
    transform: scale(1.05);
}

/* Category page */
.category-tree { font-size: 0.9rem; }
.cat-tree-label { border-radius: 4px; transition: background 0.15s; }
.cat-tree-label:hover { background: #f0f0f0; }
.cat-toggle { color: #6c757d; transition: transform 0.2s; }
.cat-tree-list { list-style: none; padding-left: 0; margin-bottom: 0; }
.mobile-cat-panel { max-height: 60vh; overflow-y: auto; }

/* Search bar on category page */
.search-bar .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 8px;
    overflow: hidden;
}
.search-bar .form-control {
    border-right: none;
    padding: 0.6rem 1rem;
    font-size: 1rem;
}
.search-bar .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}
.search-bar .btn {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

/* Maintenance page */
.maintenance-page {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .cmt-replies { padding-left: 8px; }
    .plan-card.featured { transform: none; }
}

/* Floating suggestion button */
.suggest-float-btn {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #ffc107;
    color: #212529;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.suggest-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0,0,0,0.28);
    color: #212529;
}

/* Floating ask question button */
.ask-float-btn {
    position: fixed;
    bottom: 95px;
    right: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #0d6efd;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
/* Article content responsive images */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
}
.article-content * {
    max-width: 100%;
}

.ask-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0,0,0,0.28);
    color: #fff;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.toast-item {
    margin-bottom: 10px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    animation: toastIn 0.25s ease;
    font-size: 14px;
    min-width: 120px;
    max-width: 300px;
    text-align: center;
}
.toast-item .toast-icon { font-size: 28px; margin-bottom: 6px; }
.toast-item.toast-success .toast-icon { color: #4caf50; }
.toast-item.toast-error   .toast-icon { color: #f44336; }
.toast-item.toast-warning .toast-icon { color: #ff9800; }
.toast-item.toast-info    .toast-icon { color: #fff; }
@keyframes toastIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* Cookie consent banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.10);
    animation: cookieSlideUp 0.4s ease;
}
.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cookie-text {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
    flex: 1;
}
.cookie-text i { color: #0d6efd; margin-right: 4px; }
.cookie-link {
    color: #0d6efd;
    white-space: nowrap;
    margin-left: 4px;
}
.cookie-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
@keyframes cookieSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Mobile cookie banner */
@media (max-width: 576px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }
    .cookie-text { font-size: 0.8125rem; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { width: 100%; }
}

/* ========== Prevent auth flash ========== */
html.js-has-token #authButtons { display: none !important; }

/* ========== Auth Modal ========== */
.auth-modal-dialog { max-width: 440px; }

.auth-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

.auth-modal-body { padding: 32px 28px 24px; position: relative; }

.auth-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 1.25rem; color: #999;
    cursor: pointer; padding: 4px 8px; line-height: 1;
}
.auth-modal-close:hover { color: #333; }

.auth-title {
    font-size: 1.35rem; font-weight: 700;
    text-align: center; margin-bottom: 20px;
}

.auth-step {
    opacity: 0; transform: translateY(8px);
    max-height: 0; overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.35s ease;
    pointer-events: none;
}
.auth-step.active {
    opacity: 1; transform: translateY(0);
    max-height: 600px; overflow: visible;
    pointer-events: auto;
}

/* Google button */
.google-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem; font-weight: 500; color: #3c4043;
    background: #fff; border: 1px solid #dadce0; border-radius: 24px;
    cursor: pointer; transition: background 0.15s;
}
.google-btn:hover { background: #f8f9fa; }
.google-btn img { width: 18px; height: 18px; }

/* "or" divider */
.auth-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 18px 0; color: #999; font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: #e0e0e0;
}

/* Inputs */
.auth-form-group {
    position: relative; margin-bottom: 16px;
}
.auth-input {
    width: 100%; border: none; border-bottom: 1px solid #ddd;
    border-radius: 0; padding: 14px 0 6px;
    font-size: 0.95rem; background: transparent; outline: none;
    transition: border-color 0.15s;
}
.auth-input:focus { border-bottom-color: #0d6efd; }
.auth-label {
    position: absolute; left: 0; top: 14px;
    font-size: 0.9rem; color: #999;
    transition: all 0.15s ease; pointer-events: none;
}
.auth-input:focus ~ .auth-label,
.auth-input:not(:placeholder-shown) ~ .auth-label {
    top: -6px; font-size: 0.7rem; color: #0d6efd;
}

/* Country select */
.auth-select {
    width: 100%; border: none; border-bottom: 1px solid #ddd;
    border-radius: 0; padding: 14px 0 6px;
    font-size: 0.95rem; background: transparent; outline: none;
    color: #333;
}

/* Email display in step 2 */
.auth-email-display {
    text-align: center; font-size: 0.9rem; color: #6c757d;
    margin-bottom: 16px; word-break: break-all;
}

/* Submit button */
.auth-submit-btn {
    width: 100%; border-radius: 24px; padding: 10px 24px;
    font-size: 0.95rem; font-weight: 600; margin-top: 8px;
}

/* Stay signed in + forgot row */
.auth-checkbox-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 12px; font-size: 0.85rem;
}
.auth-checkbox-row label { margin: 0; color: #555; cursor: pointer; }
.auth-checkbox-row input[type="checkbox"] { margin-right: 6px; }
.auth-forgot { color: #6c757d; cursor: pointer; text-decoration: none; }
.auth-forgot:hover { color: #0d6efd; }

/* Error */
.auth-error {
    color: #d32f2f; font-size: 0.8rem; text-align: center;
    margin-top: 10px;
}

/* Back link */
.auth-back {
    display: block; text-align: center; margin-top: 14px;
    color: #999; font-size: 0.85rem; cursor: pointer;
    background: none; border: none; width: 100%;
}
.auth-back:hover { color: #333; }

/* Terms */
.auth-terms {
    font-size: 0.7rem; color: #aaa; text-align: center; margin-top: 20px;
}
.auth-terms a { color: #6c757d; text-decoration: underline; }
.auth-terms a:hover { color: #333; }

/* ========== PayPal Payment Card ========== */
.paypal-payment-card {
    max-width: 480px;
    margin: 1.5rem auto;
    animation: paypalCardIn 0.35s ease;
}
@keyframes paypalCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.paypal-payment-inner {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.08);
}

/* Header */
.paypal-payment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.paypal-payment-type-icon {
    font-size: 1rem;
    color: #0d6efd;
    background: #e8f0fe;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.paypal-payment-type-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
}

/* Plan name */
.paypal-payment-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

/* Price */
.paypal-payment-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0d6efd;
    margin-bottom: 14px;
}

/* Features list */
.paypal-summary-features {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}
.paypal-summary-features li {
    font-size: 0.875rem;
    color: #4b5563;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.paypal-summary-features li i {
    color: #10b981;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Divider */
.paypal-payment-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.paypal-payment-divider::before,
.paypal-payment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Payment methods badge */
.paypal-payment-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 10px;
}
.paypal-method-logo {
    width: 20px;
    height: 20px;
}
.paypal-method-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
}

/* PayPal button wrapper */
.paypal-buttons-wrapper {
    min-height: 44px;
    margin-bottom: 14px;
}
.paypal-buttons-wrapper iframe {
    max-width: 100% !important;
}

/* Loading state */
.paypal-loading {
    text-align: center;
    padding: 20px 0;
}

/* Secure badge */
.paypal-payment-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 16px;
}
.paypal-payment-secure i {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Cancel button */
.paypal-cancel-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #6c757d;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}
.paypal-cancel-btn:hover {
    background: #f9fafb;
    color: #333;
    border-color: #d1d5db;
}
.paypal-cancel-btn i {
    margin-right: 4px;
}

/* Plan card — highlight when selected */
.plan-card.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* ========== Payment Success / Cancel pages ========== */
.payment-result-card {
    border-radius: 16px;
    overflow: hidden;
}
.payment-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.payment-result-icon.success {
    background: #d1fae5;
    color: #059669;
}
.payment-result-icon.cancelled {
    background: #f3f4f6;
    color: #6b7280;
}
.payment-result-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
}

/* ========== Mobile PayPal ========== */
@media (max-width: 576px) {
    .paypal-payment-card {
        max-width: 100%;
        margin: 0.5rem 0;
    }
    .paypal-payment-inner {
        padding: 20px 14px 16px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    }
    .paypal-payment-name {
        font-size: 1.05rem;
    }
    .paypal-payment-price {
        font-size: 1.35rem;
    }
    .paypal-payment-methods {
        padding: 8px;
    }
    .paypal-buttons-wrapper {
        min-height: 40px;
    }
    .paypal-cancel-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* ========== Checkout Page — Polished ========== */
:root {
    --cko-radius: 14px;
    --cko-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.06);
    --cko-shadow-lg: 0 2px 4px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.10);
    --cko-accent: #2563eb;
}

.cko-page {
    max-width: 940px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

/* ── Progress steps ── */
.cko-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.75rem;
    padding: 0;
}
.cko-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c0c7cf;
    font-size: 0.82rem;
    font-weight: 500;
}
.cko-step.active { color: #374151; }
.cko-step + .cko-step::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: #e5e7eb;
    margin-right: 6px;
}
.cko-step.active + .cko-step::before { background: #2563eb; }
.cko-step-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.3s;
}
.cko-step.active .cko-step-num {
    background: #2563eb;
    color: #fff;
}
.cko-step-text {
    white-space: nowrap;
}

/* ── Title ── */
.cko-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.75rem;
}

/* ── Layout ── */
.cko-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.75rem;
    align-items: start;
}

/* ── Cards ── */
.cko-card {
    background: #fff;
    border-radius: var(--cko-radius);
    box-shadow: var(--cko-shadow);
    overflow: hidden;
    animation: ckoFadeUp 0.4s ease;
}
.cko-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}
.cko-card-body {
    padding: 28px 26px;
}
@keyframes ckoFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Plan card ── */
.cko-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f3f4f6;
}
.cko-plan-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2px;
}
.cko-plan-cycle {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0;
}
.cko-plan-price-tag {
    text-align: right;
    flex-shrink: 0;
    line-height: 1;
}
.cko-plan-currency {
    font-size: 1rem;
    color: #6c757d;
    vertical-align: super;
}
.cko-plan-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
}
.cko-plan-period {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Features */
.cko-features {
    margin-bottom: 0;
}
.cko-features-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 12px;
}
.cko-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}
.cko-features-list li {
    font-size: 0.875rem;
    color: #4b5563;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.cko-feature-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.cko-feature-icon i { font-size: 0.65rem; }

/* Trust row */
.cko-trust-row {
    display: flex;
    gap: 16px;
    margin-top: 1rem;
}
.cko-trust-badge {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #6c757d;
}
.cko-trust-badge i { color: #9ca3af; font-size: 0.9rem; }

/* ── Payment card ── */
.cko-pay-card {
    box-shadow: var(--cko-shadow-lg);
    position: sticky;
    top: 1rem;
}
.cko-pay-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* Order summary */
.cko-summary {
    margin-bottom: 22px;
}
.cko-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
}
.cko-summary-label { color: #6c757d; }
.cko-summary-value { color: #374151; font-weight: 500; }
.cko-summary-divider {
    padding-bottom: 10px;
    border-bottom: 1px dashed #e5e7eb;
    margin-bottom: 2px;
}
.cko-summary-total {
    padding-top: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}
.cko-summary-total small {
    font-size: 0.7rem;
    font-weight: 500;
    color: #9ca3af;
}

/* PayPal */
.cko-paypal-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f5ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e40af;
}
.cko-paypal-icon {
    width: 18px; height: 18px;
}
.cko-paypal-btns {
    min-height: 44px;
}
.cko-paypal-btns iframe {
    max-width: 100% !important;
}
.cko-paypal-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 12px;
    text-align: center;
    line-height: 1.45;
}
.cko-paypal-note i {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Loading pulse */
.cko-loading {
    text-align: center;
    padding: 32px 16px;
}
.cko-loading-pulse {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}
.cko-loading-pulse span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #2563eb;
    animation: ckoPulse 1.2s ease-in-out infinite;
}
.cko-loading-pulse span:nth-child(2) { animation-delay: 0.15s; }
.cko-loading-pulse span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ckoPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}
.cko-loading p {
    color: #9ca3af;
    font-size: 0.84rem;
    margin: 0;
}

/* Error */
.cko-error {
    text-align: center;
    padding: 20px 8px;
}
.cko-error-icon {
    font-size: 2.2rem;
    color: #f59e0b;
    margin-bottom: 8px;
}
.cko-error p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Already premium */
.cko-already {
    text-align: center;
    padding: 20px 0 8px;
}
.cko-already-icon {
    font-size: 2.4rem;
    color: #f59e0b;
    margin-bottom: 8px;
}
.cko-already h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.cko-already p {
    font-size: 0.84rem;
    color: #6c757d;
    margin-bottom: 14px;
}

/* Buttons */
.cko-btn {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.cko-btn-primary {
    background: #2563eb;
    color: #fff;
}
.cko-btn-primary:hover { background: #1d4ed8; color: #fff; }
.cko-btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.cko-btn-outline:hover { background: #f9fafb; color: #111827; }

/* Back link */
.cko-back-link-wrap {
    text-align: center;
    margin-top: 0.75rem;
}
.cko-back-link {
    color: #9ca3af;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.15s;
}
.cko-back-link:hover { color: #6c757d; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .cko-steps {
        gap: 2px;
        margin-bottom: 1.25rem;
    }
    .cko-step { font-size: 0.75rem; gap: 5px; }
    .cko-step + .cko-step::before {
        width: 24px;
        margin-right: 2px;
    }
    .cko-step-text { display: none; }
    .cko-step.active .cko-step-text { display: inline; }

    .cko-title {
        font-size: 1.15rem;
        margin-bottom: 1.25rem;
    }

    .cko-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cko-card-body {
        padding: 22px 16px;
    }

    .cko-plan-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .cko-plan-price-tag {
        text-align: left;
    }
    .cko-plan-amount {
        font-size: 1.6rem;
    }

    .cko-features-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cko-trust-row {
        flex-direction: column;
        gap: 8px;
    }

    .cko-pay-card {
        position: static;
        box-shadow: var(--cko-shadow);
    }

    .cko-summary-total {
        font-size: 0.95rem;
    }
}
