/* CART GIFTS ON THE STOREFRONT (cart-gifts.js): the celebration, the "هدیه" tag of a gift row in the mini cart and
   the cart over-page, and the short note. The cart page's own gift group is styled with it, in the theme
   (Shared/_CartGiftLines.cshtml). Also the cart page's gifts panel (the gift groups' tabs), a variant gift's sheet and the payment step's
   «بدون هدیه» mark. Sizes and weights from the theme's type ladder (base.less), never past 700. */

/* the gift's colours: gold on cream (the wrapping) and green for "free" - not the store's red, which says price,
   sale and error. --tcg-accent is the gold dark enough to carry white text and to read as text (5:1 on white). */
:root {
    --tcg-accent: #96661A;
    --tcg-accent-dark: #7A5214;
    --tcg-gold: #C9952F;
    --tcg-gold-light: #E8C26A;
    --tcg-soft: #FFF8EC;
    --tcg-line: #EEDDB9;
    --tcg-free: #0E8A5C;
    --tcg-free-soft: #E6F5EE;
    --tcg-ink: #262626;
    --tcg-muted: #6B6B6B;
}

/* ---------- the "هدیه" tag and "رایگان" of a gift row ---------- */

.tc-gift-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    width: fit-content;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--tcg-soft);
    color: var(--tcg-accent-dark);
    font-size: 11.5px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 1.7;
    white-space: nowrap;
}

.tc-gift-free {
    color: var(--tcg-free);
    font-weight: var(--tc-fw-title, 700);
}

/* a gift row qsm.js cloned from its template: the stepper and the zero price go, "رایگان" comes */
.is-gift--cloned .rh-fc-item__quantity,
.is-gift--cloned .rh-fc-item__discount,
.is-gift--cloned .rh-fc-item__price-value,
.is-gift--cloned .rh-fc-item__price-unit,
.is-gift--cloned .tc-oc-item__quantity,
.is-gift--cloned .tc-oc-item__discount {
    display: none !important;
}

.is-gift--cloned .rh-fc-item__price::before {
    content: "رایگان";
    color: var(--tcg-accent);
    font-weight: var(--tc-fw-title, 700);
}

/* ---------- the celebration ---------- */

html.tcg-locked { overflow: hidden; }

.tcg-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    font-family: inherit;
}

.tcg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .45);
    opacity: 0;
    transition: opacity .24s ease;
}

.tcg-modal__card {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 28px 24px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
    text-align: center;
    opacity: 0;
    transform: translateY(8px) scale(.96);
    transition: opacity .24s ease, transform .28s cubic-bezier(.2, .9, .3, 1.2);
}

.tcg-modal.is-open .tcg-modal__backdrop { opacity: 1; }
.tcg-modal.is-open .tcg-modal__card { opacity: 1; transform: none; }

.tcg-modal__x {
    position: absolute;
    top: 12px;
    left: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #F5F5F5;
    color: #555;
    cursor: pointer;
}

.tcg-modal__x svg { width: 16px; height: 16px; }
.tcg-modal__x:hover { background: #ECECEC; }

.tcg-modal__badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--tcg-soft);
    color: var(--tcg-accent);
}

.tcg-modal__badge svg { width: 44px; height: 44px; }

.tcg-modal.is-open .tcg-modal__badge svg { animation: tcg-pop .5s cubic-bezier(.2, .9, .3, 1.4) .08s both; }

/* six small sparks thrown out once from the badge */
.tcg-spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 2px;
    background: var(--tcg-accent);
    opacity: 0;
}

.tcg-spark--2, .tcg-spark--5 { background: #F5B731; border-radius: 50%; }
.tcg-spark--3, .tcg-spark--6 { background: #3BB273; }

.tcg-modal.is-open .tcg-spark { animation: tcg-spark .8s ease-out .15s both; }
.tcg-spark--1 { --tcg-x: -46px; --tcg-y: -30px; }
.tcg-spark--2 { --tcg-x: 44px; --tcg-y: -34px; }
.tcg-spark--3 { --tcg-x: -52px; --tcg-y: 14px; }
.tcg-spark--4 { --tcg-x: 52px; --tcg-y: 10px; }
.tcg-spark--5 { --tcg-x: -24px; --tcg-y: -50px; }
.tcg-spark--6 { --tcg-x: 26px; --tcg-y: -50px; }

@keyframes tcg-pop {
    from { transform: scale(.55) rotate(-8deg); }
    to { transform: none; }
}

@keyframes tcg-spark {
    0% { opacity: 0; transform: translate(0, 0) scale(.4); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--tcg-x), var(--tcg-y)) scale(1) rotate(90deg); }
}

.tcg-modal__title {
    margin: 0 0 6px;
    color: var(--tcg-ink);
    font-size: var(--tc-fs-section, 19px);
    font-weight: var(--tc-fw-title, 700);
    line-height: 1.6;
}

.tcg-modal__text {
    margin: 0 0 16px;
    color: var(--tcg-muted);
    font-size: var(--tc-fs-small, 14px);
    line-height: 1.9;
}

.tcg-modal__text b { color: var(--tcg-ink); font-weight: var(--tc-fw-label, 600); }

.tcg-modal__items {
    max-height: 232px;
    overflow: auto;
    margin: 0 0 18px;
    padding: 0;
    border: 1px solid #F0F0F0;
    border-radius: 14px;
    list-style: none;
    text-align: start;
}

.tcg-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.tcg-item + .tcg-item { border-top: 1px solid #F3F3F3; }

.tcg-item__media {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 10px;
    background: #FAFAFA;
}

.tcg-item__media img { width: 100%; height: 100%; object-fit: contain; display: block; }

.tcg-item__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.tcg-item__name {
    color: var(--tcg-ink);
    font-size: var(--tc-fs-caption, 13px);
    font-weight: var(--tc-fw-label, 600);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tcg-item__qty {
    align-self: flex-start;
    padding: 0 8px;
    border-radius: 6px;
    background: #F5F5F5;
    color: #5E5E5E;
    font-size: 12px;
    line-height: 1.8;
}

.tcg-item__price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tcg-item__was { color: #A6A6A6; font-size: var(--tc-fs-small, 14px); white-space: nowrap; }
.tcg-item__unit { margin-inline-start: 3px; font-size: 12px; }
.tcg-item__free { color: var(--tcg-free); font-size: var(--tc-fs-caption, 13px); font-weight: var(--tc-fw-title, 700); }

.tcg-modal__actions { display: flex; gap: 10px; }

.tcg-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: var(--tc-fs-small, 14px);
    font-weight: var(--tc-fw-label, 600);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease;
}

.tcg-btn--primary { background: var(--tcg-accent); color: #fff; }
.tcg-btn--primary:hover, .tcg-btn--primary:focus { background: var(--tcg-accent-dark); color: #fff; text-decoration: none; }
.tcg-btn--ghost { background: #F5F5F5; color: var(--tcg-ink); }
.tcg-btn--ghost:hover { background: #ECECEC; }
.tcg-btn:focus-visible { outline: 2px solid var(--tcg-accent); outline-offset: 2px; }

/* a phone: a bottom sheet */
@media (max-width: 640px) {
    .tcg-modal { align-items: flex-end; padding: 0; }

    .tcg-modal__card {
        width: 100%;
        max-height: 88vh;
        padding: 26px 16px calc(16px + env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
    }

    .tcg-modal__card::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 36px;
        height: 4px;
        margin-left: -18px;
        border-radius: 2px;
        background: #E2E2E2;
    }

    .tcg-modal__badge { width: 64px; height: 64px; margin-bottom: 10px; }
    .tcg-modal__badge svg { width: 38px; height: 38px; }
    .tcg-modal__title { font-size: var(--tc-fs-section, 16px); }
    .tcg-modal__items { max-height: 38vh; }
}

@media (prefers-reduced-motion: reduce) {
    .tcg-modal__card,
    .tcg-modal__backdrop { transition: opacity .15s linear; transform: none !important; }
    .tcg-modal.is-open .tcg-modal__badge svg,
    .tcg-modal.is-open .tcg-spark { animation: none; }
}

/* ---------- the note, when the theme's toastr is not on the page ---------- */

.tcg-note {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 100000;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 12px;
    background: #262626;
    color: #fff;
    font-size: var(--tc-fs-small, 14px);
    line-height: 1.8;
    direction: rtl;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .25s ease, transform .25s ease;
}

.tcg-note.is-open { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the cart page's gifts panel (Views/Panel.cshtml) ----------

   The gift's own colours, apart from the store's red (which says price, sale, error): gold on cream - the wrapping -
   with the gift's "free" in green. The store's red stays only on QSM's controls, which are the store's buttons. */

.tcgp { margin: 16px 0 8px; direction: rtl; }

.tcgp-groups,
.tcgp-auto {
    position: relative;
    border: 1px solid var(--tcg-line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(140, 100, 32, .06);
}

.tcgp-groups + .tcgp-groups,
.tcgp-groups + .tcgp-auto,
.tcgp-auto + .tcgp-groups,
.tcgp-auto + .tcgp-auto { margin-top: 12px; }

/* the head: a cream band with a ribbon across its corner */
.tcgp-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(120deg, #FFF4DE 0%, var(--tcg-soft) 55%, #FFFDF8 100%);
    overflow: hidden;
}

.tcgp-head::before,
.tcgp-head::after {
    content: "";
    position: absolute;
    left: 56px;
    top: -10px;
    bottom: -10px;
    width: 10px;
    background: linear-gradient(180deg, var(--tcg-gold-light), var(--tcg-gold));
    opacity: .22;
    transform: skewX(-18deg);
    pointer-events: none;
}

.tcgp-head::after { left: 72px; width: 4px; opacity: .16; }

.tcgp-head__icon {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--tcg-gold-light), var(--tcg-gold));
    color: #fff;
    box-shadow: 0 4px 10px rgba(184, 134, 43, .28);
}

.tcgp-head__icon svg { width: 22px; height: 22px; }
.tcgp-head__text { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tcgp-head__title { color: var(--tcg-ink); font-size: var(--tc-fs-h4, 15px); font-weight: var(--tc-fw-title, 700); }
.tcgp-head__note { color: var(--tcg-muted); font-size: var(--tc-fs-caption, 13px); line-height: 1.7; }
.tcgp-head__note b { color: var(--tcg-accent-dark); font-weight: var(--tc-fw-label, 600); }

/* an auto campaign: how far its next gift is */
.tcgp-auto {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(120deg, #FFF4DE 0%, var(--tcg-soft) 55%, #FFFDF8 100%);
}

.tcgp-auto__text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.tcgp-progress {
    position: relative;
    display: block;
    height: 6px;
    margin-top: 4px;
    border-radius: 3px;
    background: #F3E6CC;
    overflow: hidden;
}

.tcgp-progress__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    border-radius: 3px;
    background: linear-gradient(270deg, var(--tcg-gold), var(--tcg-gold-light));
    transition: width .4s ease;
}

/* the groups' tabs: a row that scrolls sideways when the groups are more than the width */
.tcgp-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px 0;
    border-top: 1px solid var(--tcg-line);
    border-bottom: 1px solid #F2EBDD;
    background: #fff;
    overflow-x: auto;
    scrollbar-width: none;
}

.tcgp-tabs::-webkit-scrollbar { display: none; }

.tcgp-tab {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--tcg-muted);
    font: inherit;
    font-size: var(--tc-fs-small, 14px);
    font-weight: var(--tc-fw-label, 600);
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.tcgp-tab::after {
    content: "";
    position: absolute;
    right: 10px;
    left: 10px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}

.tcgp-tab:hover { color: var(--tcg-ink); background: #FFFBF3; }
.tcgp-tab.is-active { color: var(--tcg-accent-dark); }
.tcgp-tab.is-active::after { background: linear-gradient(90deg, var(--tcg-gold-light), var(--tcg-gold)); }
.tcgp-tab.is-locked { color: #A3A3A3; }
.tcgp-tab.is-locked.is-active { color: #6B6B6B; }
.tcgp-tab.is-locked.is-active::after { background: #CFCFCF; }
.tcgp-tab:focus-visible { outline: 2px solid var(--tcg-gold); outline-offset: -2px; }
.tcgp-tab__title { display: inline-flex; align-items: center; gap: 4px; }

.tcgp-tab__badge {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--tcg-free-soft);
    color: var(--tcg-free);
    font-size: 11.5px;
    line-height: 20px;
}

.tcgp-lock { flex: 0 0 auto; width: 14px; height: 14px; }

/* a group: its description, the state of the pick, the products */
.tcgp-group { padding: 14px 16px 6px; transition: opacity .15s ease; }
.tcgp-group[hidden] { display: none; }
.tcgp-group.is-busy { pointer-events: none; }

.tcgp-group__desc {
    margin: 0;
    color: var(--tcg-ink);
    font-size: var(--tc-fs-small, 14px);
    line-height: 1.9;
}

.tcgp-group__desc b { color: var(--tcg-accent-dark); font-weight: var(--tc-fw-label, 600); }

.tcgp-group__lock,
.tcgp-group__warn,
.tcgp-group__count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: var(--tc-fs-caption, 13px);
    line-height: 1.8;
}

.tcgp-group__lock { background: #F5F5F5; color: #5E5E5E; }
.tcgp-group__lock b { color: var(--tcg-ink); font-weight: var(--tc-fw-label, 600); }
.tcgp-group__warn { background: #FFF6E0; color: #7A5A00; }
.tcgp-group__count { justify-content: space-between; background: var(--tcg-soft); color: var(--tcg-ink); box-shadow: inset 0 0 0 1px #F6EAD2; }
.tcgp-group__count b { color: var(--tcg-accent-dark); font-weight: var(--tc-fw-title, 700); }
.tcgp-group__empty { margin: 12px 0 8px; color: var(--tcg-muted); font-size: var(--tc-fs-caption, 13px); }

.tcgp-dots { display: flex; gap: 5px; }
.tcgp-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px #E6CF9F; }
.tcgp-dot.is-on { background: linear-gradient(145deg, var(--tcg-gold-light), var(--tcg-gold)); box-shadow: none; }

.tcgp-list { margin: 8px 0 0; padding: 0; list-style: none; }

.tcgp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.tcgp-item + .tcgp-item { border-top: 1px solid #F3F0EA; }

.tcgp-item__media {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 10px;
    background: #FAFAFA;
}

.tcgp-item__media img { width: 100%; height: 100%; object-fit: contain; display: block; }

.tcgp-item__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.tcgp-item__name {
    color: var(--tcg-ink);
    font-size: var(--tc-fs-small, 14px);
    font-weight: var(--tc-fw-label, 600);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tcgp-item__name:hover { color: var(--tcg-accent-dark); }

.tcgp-item__price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.tcgp-item__was { color: #A0A0A0; font-size: var(--tc-fs-body, 15px); white-space: nowrap; }
.tcgp-item__unit { margin-inline-start: 3px; font-size: var(--tc-fs-caption, 13px); }

.tcgp-item__free {
    padding: 0 8px;
    border-radius: 6px;
    background: var(--tcg-free-soft);
    color: var(--tcg-free);
    font-size: var(--tc-fs-caption, 13px);
    font-weight: var(--tc-fw-title, 700);
    line-height: 22px;
}

.tcgp-item__limit { color: var(--tcg-muted); font-size: 12px; }

.tcgp-item__variant {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--tcg-soft);
    color: var(--tcg-accent-dark);
    font-size: 12px;
    line-height: 1.8;
}

.tcgp-item__action { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; min-width: 48px; }

/* a closed group: the products are seen, not taken */
.tcgp-group.is-locked .tcgp-item__media { filter: grayscale(1); opacity: .6; }
.tcgp-group.is-locked .tcgp-item__name { color: #8A8A8A; }
.tcgp-group.is-locked .tcgp-item__free { background: #F2F2F2; color: #8A8A8A; }

/* ---------- QSM's own control on a gift (qsm.css draws it; only what its input would do is added) ----------
   The control is QSM's markup without QSM's input (a gift is not QSM's cart line): the count is a read-only field of
   its own, set like QSM's .vp-quantity-supermarket-v3 is in the same place. */

.tcgp-qsm { position: relative; display: inline-block; }
.tcgp-qsm .vp-btn { cursor: pointer; }
.tcgp-qsm .vp-btn:focus-visible { outline: 2px solid var(--tcg-gold); outline-offset: -2px; }

.tcgp-qsm .vp-input {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tcgp-qsm__count {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 16px;
    line-height: inherit;
    text-align: center;
    pointer-events: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.tcgp-qsm__count::-webkit-outer-spin-button,
.tcgp-qsm__count::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* a wide screen: the cart line's face (cart-desk.css), whose count is QSM's input at 17/700 */
html body.page-cart .tc-cd-item__qty.tcgp-qsm .tcgp-qsm__count {
    height: auto;
    font-size: 17px;
    font-weight: var(--tc-fw-title, 700);
    line-height: 1.2;
    color: #1A1A1A;
}

/* nothing more of it can come (the quota or its maximum): QSM's own greyed face */
.tcgp-qsm--off { opacity: .4; box-shadow: none; filter: grayscale(1); }
.tcgp-qsm--off .vp-btn { cursor: default; pointer-events: none; }

@media only screen and (max-width: 959.98px) {
    .tcgp { margin: 12px 0 4px; }
    .tcgp-head, .tcgp-auto { padding: 12px; }
    .tcgp-tabs { padding: 6px 8px 0; }
    .tcgp-group { padding: 12px 12px 4px; }
    .tcgp-item { gap: 10px; padding: 10px 0; }
    .tcgp-item__media { flex-basis: 64px; width: 64px; height: 64px; }
}

/* ---------- the sheet: a variant product of a gift group ---------- */

.tcgs {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    font-family: inherit;
}

.tcgs__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .45);
    opacity: 0;
    transition: opacity .24s ease;
}

.tcgs__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(8px) scale(.97);
    transition: opacity .24s ease, transform .28s cubic-bezier(.2, .9, .3, 1.1);
}

.tcgs.is-open .tcgs__backdrop { opacity: 1; }
.tcgs.is-open .tcgs__card { opacity: 1; transform: none; }

.tcgs__grip { display: none; }

.tcgs__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 10px;
}

.tcgs__titles { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tcgs__title { margin: 0; color: var(--tcg-ink); font-size: var(--tc-fs-h4, 16px); font-weight: var(--tc-fw-title, 700); line-height: 1.6; }
.tcgs__sub { color: var(--tcg-muted); font-size: var(--tc-fs-caption, 13px); line-height: 1.6; }

.tcgs__x {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #F5F5F5;
    color: #555;
    cursor: pointer;
}

.tcgs__x svg { width: 16px; height: 16px; }

.tcgs__count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 20px 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--tcg-soft);
    color: var(--tcg-ink);
    font-size: var(--tc-fs-caption, 13px);
}

.tcgs__count b { color: var(--tcg-accent-dark); font-weight: var(--tc-fw-title, 700); }
.tcgs__dots { display: flex; gap: 4px; }
.tcgs__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px #E6CF9F; }
.tcgs__dot.is-on { background: linear-gradient(145deg, var(--tcg-gold-light), var(--tcg-gold)); box-shadow: none; }

.tcgs__warn {
    margin: 0 20px 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #FFF8E6;
    color: #7A5A00;
    font-size: var(--tc-fs-caption, 13px);
    line-height: 1.8;
}

.tcgs__list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0 20px 4px;
    overflow: auto;
    list-style: none;
    overscroll-behavior: contain;
}

.tcgs__empty { padding: 24px 0; color: var(--tcg-muted); text-align: center; }

.tcgs-item {
    padding: 12px;
    border: 1px solid #EFEFEF;
    border-radius: 14px;
    transition: border-color .15s ease;
}

.tcgs-item + .tcgs-item { margin-top: 10px; }
.tcgs-item.is-picked { border-color: var(--tcg-line); background: #FFFDF8; }

.tcgs-item__row { display: flex; align-items: center; gap: 12px; }

.tcgs-item__media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 10px;
    background: #FAFAFA;
}

.tcgs-item__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tcgs-item__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.tcgs-item__name {
    color: var(--tcg-ink);
    font-size: var(--tc-fs-caption, 13px);
    font-weight: var(--tc-fw-label, 600);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tcgs-item__price { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tcgs-item__price s { color: #A6A6A6; }
.tcgs-item__free { color: var(--tcg-free); font-weight: var(--tc-fw-title, 700); font-size: var(--tc-fs-caption, 13px); }
.tcgs-item__limit { color: var(--tcg-muted); font-size: 12px; }

.tcgs-item__variants { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.tcgs-attr { display: flex; flex-direction: column; gap: 6px; }
.tcgs-attr__name { color: var(--tcg-muted); font-size: 12px; }
.tcgs-attr__chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tcgs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #E3E3E3;
    border-radius: 999px;
    background: #fff;
    color: var(--tcg-ink);
    font: inherit;
    font-size: var(--tc-fs-caption, 13px);
    cursor: pointer;
}

.tcgs-chip.is-selected { border-color: var(--tcg-accent); box-shadow: inset 0 0 0 1px var(--tcg-accent); color: var(--tcg-accent-dark); }
.tcgs-chip:disabled { color: #B8B8B8; cursor: default; background: #FAFAFA; opacity: .7; }
.tcgs-chip__swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

.tcgs-add {
    align-self: flex-start;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--tcg-soft);
    color: var(--tcg-accent-dark);
    font: inherit;
    font-size: var(--tc-fs-caption, 13px);
    font-weight: var(--tc-fw-label, 600);
    cursor: pointer;
}

.tcgs-add:disabled { background: #F5F5F5; color: #A6A6A6; cursor: default; }

.tcgs-picked { margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed #EFD5D9; list-style: none; }
.tcgs-picked__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.tcgs-picked__name { color: var(--tcg-ink); font-size: var(--tc-fs-caption, 13px); }

.tcgs__foot {
    display: flex;
    gap: 10px;
    padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #F2F2F2;
}

.tcgs__foot .tcg-btn--primary { flex: 2 1 0; }

.tcgs button:focus-visible { outline: 2px solid var(--tcg-accent); outline-offset: 2px; }

/* a phone: a bottom sheet */
@media (max-width: 640px) {
    .tcgs { align-items: flex-end; padding: 0; }

    .tcgs__card {
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
    }

    .tcgs__grip {
        display: block;
        width: 36px;
        height: 4px;
        margin: 8px auto 0;
        border-radius: 2px;
        background: #E2E2E2;
    }

    .tcgs__head { padding: 10px 16px 8px; }
    .tcgs__count, .tcgs__warn { margin-left: 16px; margin-right: 16px; }
    .tcgs__list { padding: 0 16px 4px; }
    .tcgs__foot { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .tcgs__card, .tcgs__backdrop { transition: opacity .15s linear; transform: none !important; }
}

/* ---------- the payment step: a method an order with gifts cannot take ---------- */

.tcg-pay-excluded { position: relative; }

.tcg-pay-note {
    display: inline-flex;
    align-items: center;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 6px;
    background: #FFF4E5;
    color: #9A5B00;
    font-size: 11.5px;
    font-weight: var(--tc-fw-label, 600);
    line-height: 1.7;
    white-space: nowrap;
}
