/* Shared cart (physical and digital products). Classes are prefixed with ct- so they don't clash with site.css */

.ct-page {
    --ct-blue: #0078D4;
    --ct-blue-dark: #005FB8;
    --ct-blue-soft: #EAF3FC;
    --ct-text: #1F1F1F;
    --ct-muted: #6B6B6B;
    --ct-border: #E6E6E6;
    --ct-card: #FFFFFF;
    --ct-green: #0E7A0D;
    --ct-green-soft: #E7F4E4;
    --ct-red: #B3261E;
    --ct-red-soft: #FDE7E9;
    --ct-amber: #8A5A00;
    --ct-amber-soft: #FFF4CE;
    --ct-radius: 14px;
    --ct-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--ct-text);
}

.darkmode .ct-page {
    --ct-text: #F2F2F2;
    --ct-muted: #B5B5B5;
    --ct-border: #333333;
    --ct-card: #1C1C1C;
    --ct-blue-soft: #10263A;
    --ct-green-soft: #12301A;
    --ct-red-soft: #3A1717;
    --ct-amber-soft: #3A2E10;
    --ct-green: #6CCB5F;
    --ct-red: #FF99A4;
    --ct-amber: #FCE100;
}

/* The select2 lists (province, city) are appended to body, outside .ct-page */
.darkmode .select2-dropdown {
    background: #1C1C1C;
    border-color: #333333;
    color: #F2F2F2;
}

.darkmode .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #262626;
    border-color: #333333;
    color: #F2F2F2;
}

.darkmode .select2-container--default .select2-results__option {
    color: #F2F2F2;
}

.darkmode .select2-container--default .select2-results__option[aria-selected=true],
.darkmode .select2-container--default .select2-results__option--selected {
    background: #2B2B2B;
}

.darkmode .select2-container--default .select2-results__option--highlighted[aria-selected],
.darkmode .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: #0078D4;
    color: #fff;
}

.ct-page *, .ct-page *::before, .ct-page *::after {
    box-sizing: border-box;
}

.cartNavigations.is-short {
    width: 380px;
    max-width: 100%;
}

.ct-message {
    background: var(--ct-amber-soft);
    color: var(--ct-amber);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 14px;
}

.ct-empty {
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: 48px 16px;
    text-align: center;
}

    .ct-empty h3 {
        font-size: 18px;
        margin: 0 0 8px;
    }

    .ct-empty p {
        color: var(--ct-muted);
        font-size: 14px;
        margin: 0 0 20px;
    }

.ct-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.ct-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ct-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 14px;
}

.ct-item-img {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    border: 1px solid var(--ct-border);
    background-position: center;
    background-size: cover;
    display: block;
}

.ct-item-body {
    min-width: 0;
}

.ct-item-kind {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ct-muted);
    background: rgba(127, 127, 127, 0.12);
    border-radius: 6px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

    .ct-item-kind.is-digital {
        color: var(--ct-blue);
        background: var(--ct-blue-soft);
    }

.ct-item-title {
    display: block;
    color: var(--ct-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    text-decoration: none;
}

    .ct-item-title:hover {
        color: var(--ct-blue);
    }

.ct-item-variant {
    color: var(--ct-muted);
    font-size: 13px;
    margin-top: 2px;
}

.ct-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ct-info-chip {
    font-size: 12px;
    background: rgba(127, 127, 127, 0.08);
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    padding: 3px 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

    .ct-info-chip b {
        font-weight: 500;
        color: var(--ct-muted);
    }

.ct-secret-toggle {
    border: 0;
    background: none;
    color: var(--ct-blue);
    font-size: 11px;
    padding: 0 4px;
    cursor: pointer;
    font-family: inherit;
}

.ct-item-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.ct-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    overflow: hidden;
}

    .ct-qty > span:not(.ct-qty-btn) {
        min-width: 34px;
        text-align: center;
        font-size: 14px;
    }

.ct-qty-btn {
    width: 34px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--ct-blue);
    text-decoration: none;
    cursor: pointer;
}

    .ct-qty-btn:hover {
        background: var(--ct-blue-soft);
        text-decoration: none;
    }

    .ct-qty-btn.is-disabled {
        color: var(--ct-border);
        cursor: default;
        background: none;
    }

.ct-remove {
    color: var(--ct-red);
    font-size: 13px;
    text-decoration: none;
}

    .ct-remove:hover {
        text-decoration: underline;
        color: var(--ct-red);
    }

.ct-item-price {
    text-align: left;
    white-space: nowrap;
    align-self: start;
    padding-top: 4px;
}

    .ct-item-price s {
        display: block;
        color: var(--ct-muted);
        font-size: 12px;
    }

    .ct-item-price strong {
        font-size: 16px;
        font-weight: 600;
    }

    .ct-item-price small, .ct-sum-total small {
        font-size: 11px;
        font-weight: 400;
        color: var(--ct-muted);
    }

/* ---------- Summary ---------- */

.ct-summary {
    position: sticky;
    top: 90px;
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 18px;
}

    .ct-summary h2 {
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 14px;
    }

.ct-sum-row, .ct-sum-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    padding: 6px 0;
}

    .ct-sum-row > span:first-child {
        color: var(--ct-muted);
    }

    .ct-sum-row.is-discount > span:last-child {
        color: var(--ct-green);
    }

    .ct-sum-row.is-muted > span:last-child {
        color: var(--ct-muted);
        font-size: 13px;
    }

.ct-coupon-code {
    font-weight: 500;
    color: var(--ct-text);
}

.ct-link {
    border: 0;
    background: none;
    color: var(--ct-red);
    font-size: 12px;
    padding: 0 4px;
    cursor: pointer;
    font-family: inherit;
}

.ct-sum-total {
    border-top: 1px solid var(--ct-border);
    margin-top: 8px;
    padding-top: 14px;
    font-weight: 600;
    font-size: 16px;
}

.ct-coupon {
    display: flex;
    gap: 6px;
    margin-top: 14px;
}

    .ct-coupon input {
        flex: 1;
        min-width: 0;
        height: 40px;
        border: 1px solid var(--ct-border);
        border-radius: 10px;
        padding: 0 12px;
        font-family: inherit;
        font-size: 13px;
        background: transparent;
        color: var(--ct-text);
    }

        .ct-coupon input:focus {
            outline: none;
            border-color: var(--ct-blue);
        }

    .ct-coupon button {
        height: 40px;
        border: 1px solid var(--ct-blue);
        background: none;
        color: var(--ct-blue);
        border-radius: 10px;
        padding: 0 14px;
        font-family: inherit;
        font-size: 13px;
        cursor: pointer;
    }

.ct-coupon-msg {
    font-size: 12px;
    margin-top: 8px;
    color: var(--ct-red);
}

    .ct-coupon-msg.is-ok {
        color: var(--ct-green);
    }

.ct-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    background: var(--ct-blue);
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
}

    .ct-btn:hover {
        background: var(--ct-blue-dark);
    }

    .ct-btn.is-inline {
        display: inline-block;
        width: auto;
        padding-inline: 28px;
    }

.ct-sum-note {
    color: var(--ct-muted);
    font-size: 12px;
    line-height: 1.8;
    margin: 10px 0 0;
}

/* ---------- Checkout ---------- */

.ct-message.is-error {
    background: var(--ct-red-soft);
    color: var(--ct-red);
}

    .ct-message.is-error ul {
        margin: 6px 0 0;
        padding-right: 20px;
    }

.ck-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.ck-card {
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 18px 20px 20px;
    transition: opacity 0.15s;
}

    .ck-card h2 {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 16px;
    }

.ck-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ct-blue-soft);
    color: var(--ct-blue);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ck-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.ck-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-weight: normal;
    min-width: 0;
}

    .ck-field.is-wide {
        grid-column: 1 / -1;
    }

    .ck-field > span:first-child {
        font-size: 13px;
        color: var(--ct-muted);
    }

    .ck-field input, .ck-field textarea {
        width: 100%;
        height: 44px;
        border: 1px solid var(--ct-border);
        border-radius: 10px;
        padding: 0 12px;
        font-family: inherit;
        font-size: 14px;
        background: transparent;
        color: var(--ct-text);
    }

    .ck-field textarea {
        height: auto;
        padding: 10px 12px;
        line-height: 1.8;
        resize: vertical;
    }

    .ck-field input[dir=ltr] {
        text-align: left;
    }

        .ck-field input:focus, .ck-field textarea:focus {
            outline: none;
            border-color: var(--ct-blue);
            box-shadow: 0 0 0 3px var(--ct-blue-soft);
        }

    .ck-field.is-invalid input, .ck-field.is-invalid textarea {
        border-color: var(--ct-red);
    }

.ck-optional {
    font-size: 11px;
    color: var(--ct-muted);
}

.ck-field-error {
    color: var(--ct-red);
    font-size: 12px;
}

    .ck-field-error[hidden] {
        display: none;
    }

/* select2 in the same shape as the inputs */
.ck-field .select2-container .select2-selection--single {
    height: 44px;
    border: 1px solid var(--ct-border) !important;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
}

.ck-field .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
    background: none;
    color: var(--ct-text);
    padding-right: 12px;
    line-height: 42px;
    width: 100%;
}

.ck-field .select2-container .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.ck-field .select2-container--open .select2-selection--single {
    border-color: var(--ct-blue) !important;
}

.ck-ships {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ck-ship {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

    .ck-ship:hover {
        border-color: var(--ct-blue);
    }

    .ck-ship.is-selected {
        border-color: var(--ct-blue);
        background: var(--ct-blue-soft);
    }

    .ck-ship input {
        width: 18px;
        height: 18px;
        margin: 0;
        flex: none;
        accent-color: var(--ct-blue);
    }

.ck-ship-text {
    flex: 1;
    min-width: 0;
}

    .ck-ship-text b {
        display: block;
        font-size: 14px;
        font-weight: 500;
    }

    .ck-ship-text small {
        display: block;
        color: var(--ct-muted);
        font-size: 12px;
        margin-top: 2px;
        line-height: 1.7;
    }

.ck-ship-price {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

    .ck-ship-price.is-free {
        color: var(--ct-green);
    }

.ck-empty-ship {
    color: var(--ct-muted);
    font-size: 13px;
}

#ckShipCard .ck-field-error {
    display: block;
    margin-top: 10px;
}

.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.ck-lines {
    list-style: none;
    margin: 0 0 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--ct-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

    .ck-lines li {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.ck-line-img {
    position: relative;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 10px;
    border: 1px solid var(--ct-border);
    background-position: center;
    background-size: cover;
}

.ck-line-qty {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--ct-blue);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck-line-text {
    min-width: 0;
}

    .ck-line-text b {
        display: block;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ck-line-text small {
        display: block;
        font-size: 12px;
        color: var(--ct-muted);
    }

.ck-back {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: var(--ct-blue);
}

.ct-btn:disabled {
    opacity: 0.7;
    cursor: progress;
}

/* ---------- Payment result ---------- */

.rp-hero {
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 32px 24px 28px;
    margin-bottom: 20px;
    text-align: center;
}

    .rp-hero h1 {
        font-size: 22px;
        font-weight: 700;
        margin: 14px 0 8px;
        color: var(--ct-text);
    }

    .rp-hero > p {
        color: var(--ct-muted);
        font-size: 14px;
        line-height: 1.9;
        margin: 0;
    }

        .rp-hero > p b {
            color: var(--ct-text);
        }

.rp-check {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--ct-green-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .rp-check svg {
        width: 52px;
        height: 52px;
        fill: none;
        stroke: var(--ct-green);
        stroke-width: 3;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .rp-check circle {
        stroke-dasharray: 151;
        stroke-dashoffset: 151;
        animation: rp-draw 0.6s ease-out forwards;
    }

    .rp-check path {
        stroke-dasharray: 36;
        stroke-dashoffset: 36;
        animation: rp-draw 0.35s 0.5s ease-out forwards;
    }

@keyframes rp-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rp-check circle, .rp-check path {
        animation: none;
        stroke-dashoffset: 0;
    }
}

.rp-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 860px;
    margin: 24px auto 0;
}

    .rp-facts > div {
        background: rgba(127, 127, 127, 0.06);
        border: 1px solid var(--ct-border);
        border-radius: 12px;
        padding: 12px 10px;
        min-width: 0;
    }

    .rp-facts span {
        display: block;
        font-size: 12px;
        color: var(--ct-muted);
        margin-bottom: 4px;
    }

    .rp-facts b {
        font-size: 15px;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

        .rp-facts b small {
            font-size: 11px;
            font-weight: 400;
            color: var(--ct-muted);
        }

.rp-ref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.rp-copy {
    border: 1px solid var(--ct-border);
    background: var(--ct-card);
    color: var(--ct-blue);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
}

.rp-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

    .rp-actions .ct-btn {
        margin-top: 0;
    }

.rp-btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    color: var(--ct-text);
    font-size: 15px;
    text-decoration: none !important;
}

    .rp-btn-outline:hover {
        border-color: var(--ct-blue);
        color: var(--ct-blue);
    }

.rp-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

    .rp-items li {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid var(--ct-border);
    }

        .rp-items li:first-child {
            padding-top: 0;
        }

    .rp-items .ck-line-img {
        width: 56px;
        height: 56px;
    }

.rp-item-text {
    flex: 1;
    min-width: 0;
}

    .rp-item-text b {
        display: block;
        font-size: 14px;
        font-weight: 500;
    }

    .rp-item-text small {
        display: block;
        color: var(--ct-muted);
        font-size: 12px;
        margin-top: 4px;
    }

    .rp-item-text .ct-item-kind {
        margin: 0 0 0 4px;
    }

.rp-item-side {
    text-align: left;
    white-space: nowrap;
}

    .rp-item-side b {
        display: block;
        font-size: 14px;
        font-weight: 600;
    }

        .rp-item-side b small {
            font-size: 11px;
            font-weight: 400;
            color: var(--ct-muted);
        }

    .rp-item-side a {
        font-size: 12px;
        color: var(--ct-blue);
    }

.rp-totals {
    padding-top: 10px;
}

.rp-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rp-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .rp-timeline li {
        position: relative;
        padding: 0 30px 18px 0;
    }

        .rp-timeline li::before {
            content: "";
            position: absolute;
            right: 5px;
            top: 4px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid var(--ct-border);
            background: var(--ct-card);
            box-sizing: border-box;
        }

        .rp-timeline li::after {
            content: "";
            position: absolute;
            right: 11px;
            top: 20px;
            bottom: 0;
            width: 2px;
            background: var(--ct-border);
        }

        .rp-timeline li:last-child {
            padding-bottom: 0;
        }

            .rp-timeline li:last-child::after {
                display: none;
            }

        .rp-timeline li.is-done::before {
            background: var(--ct-green);
            border-color: var(--ct-green);
        }

        .rp-timeline li.is-done::after {
            background: var(--ct-green);
        }

        .rp-timeline li.is-current::before {
            border-color: var(--ct-blue);
            box-shadow: 0 0 0 4px var(--ct-blue-soft);
        }

    .rp-timeline b {
        display: block;
        font-size: 14px;
        font-weight: 500;
    }

    .rp-timeline small {
        display: block;
        color: var(--ct-muted);
        font-size: 12px;
        line-height: 1.8;
        margin-top: 2px;
    }

.rp-address {
    font-size: 14px;
    line-height: 1.9;
}

    .rp-address b {
        display: block;
        font-weight: 500;
    }

    .rp-address span {
        color: var(--ct-muted);
        font-size: 13px;
    }

    .rp-address p {
        margin: 6px 0 0;
    }

    .rp-address small {
        color: var(--ct-muted);
        font-size: 12px;
    }

@media (max-width: 900px) {
    .ct-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-summary {
        position: static;
    }
}

@media (max-width: 760px) {
    .rp-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .ck-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ck-card {
        padding: 16px;
    }

    .ct-item {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }

    .ct-item-img {
        width: 72px;
        height: 72px;
    }

    /* Flex items keep the two numbers from being reordered together by the bidi algorithm */
    .ct-item-price {
        grid-column: 2;
        display: flex;
        align-items: baseline;
        gap: 8px;
        padding-top: 0;
    }
}
