/* ===========================================================================
   Yumee hub — plans, credits, the app pages, and "Other projects" on the
   landing page. House components (.yu-card, .yu-stat, .yu-chip); every value
   is a token from site.css. Phone first: every grid is minmax(0, 1fr) or
   min(…, 100%) so nothing can widen a 360 px screen.
   =========================================================================== */

.shop-page { padding-block: clamp(16px, 4vw, 40px) clamp(40px, 6vw, 72px); }

.shop-head { max-width: 720px; margin-bottom: 28px; }
.shop-head__title { margin: 6px 0 12px; overflow-wrap: anywhere; }
.shop-head__lead { color: var(--ink-soft); margin: 0; }
.shop-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--ink); font-weight: 500; }
.shop-msg:empty { min-height: 0; margin: 0; }

/* The withdrawal card on /credits (a plan bought less than 14 days ago). */
.shop-withdraw { display: grid; gap: 12px; justify-items: start; margin: 0 0 20px; padding: 18px 20px; }
.shop-withdraw__title { margin: 0; }
.shop-withdraw__lead, .shop-withdraw__hint { margin: 0; color: var(--ink-soft); font-size: .9375rem; max-width: 62ch; }
.shop-withdraw__form { display: grid; gap: 12px; width: 100%; max-width: 30rem; }
.shop-withdraw__form[hidden], .shop-withdraw__done[hidden] { display: none; }
.shop-withdraw__contract { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .9375rem; }
.shop-withdraw__contract dt { color: var(--ink-soft); }
.shop-withdraw__contract dd { margin: 0; overflow-wrap: anywhere; }
.shop-withdraw__done { margin: 0; font-weight: 500; color: var(--ink); }

/* The box ticked before paying (withdrawal waiver): a slim centred strip under
   the plans, above the packs, so it reads as belonging to both. Outlined in
   purple when a buy button was pressed without it. */
.shop-consent {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    max-width: 720px;
    margin: 20px auto 0;
    padding: 10px 16px;
    border: 1px solid var(--line-card);
    border-radius: var(--r-md);
    background: var(--card);
    font-size: .875rem;
    line-height: 1.45;
    color: var(--ink-soft);
    cursor: pointer;
}
.shop-consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--purple); cursor: pointer; }
.shop-consent a { overflow-wrap: anywhere; }
/* On /credits it sits under the packs, centred like on /pricing. */
.shop-packs + .shop-consent { margin: 18px auto 18px; }
.shop-consent.is-needed { border-color: var(--purple); box-shadow: 0 0 0 3px var(--lav-50); color: var(--ink); }
.shop-paid { margin: 16px 0 0; padding: 14px 18px; }

/* Why a buy button did nothing: right under the box, never at the top of the
   page where nobody is looking. */
.shop-consent__msg {
    max-width: 720px;
    margin: 8px auto 0;
    padding: 0 16px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--purple-ink);
    text-align: center;
    animation: shop-nudge 360ms var(--ease) both;
}
@keyframes shop-nudge {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- thank you ---- */
/* After a purchase: one card that rises in over a soft lavender veil, a check
   mark that draws itself, the happy mascot, the balance counting up, and the
   two ways on. Without scripts it is an ordinary card at the top of the page. */
.shop-thanks {
    position: relative;
    width: min(520px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    overflow: auto;
    margin: 24px auto;
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--line-card);
    color: var(--ink);
    text-align: center;
    animation: shop-thanks-in 620ms var(--ease) both;
}
.shop-thanks:modal { margin: auto; }
.shop-thanks::backdrop {
    background: color-mix(in srgb, var(--contrast) 30%, transparent);
    animation: shop-fade 400ms var(--ease) both;
}
.shop-thanks.is-leaving { animation: shop-thanks-out 220ms var(--ease) both; }
@keyframes shop-thanks-in {
    from { opacity: 0; transform: translateY(28px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes shop-thanks-out {
    to { opacity: 0; transform: translateY(12px) scale(.98); }
}
@keyframes shop-fade { from { opacity: 0; } to { opacity: 1; } }

.shop-thanks__top {
    position: relative;
    width: 124px;
    height: 124px;
    margin: -6px auto 6px;
    display: grid;
    place-items: center;
}
/* The check mark is a badge on the mascot's shoulder. */
.shop-thanks__check {
    position: absolute;
    right: -4px;
    bottom: 2px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--card);
    box-shadow: var(--shadow-card);
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.shop-thanks__ring {
    fill: var(--mint-soft);
    stroke: var(--mint-ink);
    stroke-width: 2.5;
    stroke-dasharray: 145;
    stroke-dashoffset: 145;
    animation: shop-draw 700ms 250ms var(--ease) forwards;
}
.shop-thanks__tick {
    stroke: var(--mint-ink);
    stroke-width: 3.5;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: shop-draw 420ms 780ms var(--ease) forwards;
}
@keyframes shop-draw { to { stroke-dashoffset: 0; } }
.shop-thanks__mascot {
    --yu-mascot-size: 124px;
    animation: shop-pop 560ms 120ms var(--ease) both;
}
@keyframes shop-pop {
    from { opacity: 0; transform: translateY(10px) scale(.8); }
    to   { opacity: 1; transform: none; }
}

.shop-thanks__title {
    margin: 6px 0 8px;
    outline: none;
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.1;
}
.shop-thanks__title:focus, .shop-thanks__title:focus-visible { outline: none; box-shadow: none; }
.shop-thanks__lead { margin: 0 auto; max-width: 40ch; color: var(--ink-soft); line-height: 1.55; }

.shop-thanks__balance {
    display: grid;
    justify-items: center;
    gap: 2px;
    margin: 20px 0 0;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--lav-50);
}
.shop-thanks__figure {
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    color: var(--purple-deep);
}
.shop-thanks__state { font-size: .8125rem; color: var(--ink-soft); }
.shop-thanks.is-arrived .shop-thanks__state { color: var(--mint-ink); font-weight: 600; }

.shop-thanks__perks {
    list-style: none;
    margin: 18px auto 0;
    padding: 0;
    display: grid;
    gap: 8px;
    max-width: 34ch;
    text-align: left;
    font-size: .9375rem;
}
.shop-thanks__perks li { display: flex; gap: 9px; align-items: flex-start; }
.shop-thanks__perks svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--mint-ink); }

.shop-thanks__where { margin: 22px 0 10px; }
.shop-thanks__apps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
    gap: 10px;
}
.shop-thanks__app {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-card);
    border-radius: var(--r-md);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.shop-thanks__app:hover { border-color: var(--lav-300); transform: translateY(-2px); }
.shop-thanks__app .yu-tile__icon { width: 34px; height: 34px; border-radius: var(--r-sm); }
.shop-thanks__app .yu-tile__icon svg { width: 18px; height: 18px; }
.shop-thanks__appname { min-width: 0; overflow-wrap: anywhere; }

.shop-thanks__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.shop-thanks__actions .yu-btn { flex: 1 1 180px; }
.shop-thanks__receipt {
    margin: 16px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    font-size: .8125rem;
    color: var(--ink-faint);
}
.shop-thanks__receipt svg { width: 15px; height: 15px; flex: none; }

@media (prefers-reduced-motion: reduce) {
    .shop-thanks, .shop-thanks::backdrop, .shop-thanks__mascot, .shop-consent__msg { animation: none; }
    .shop-thanks__ring, .shop-thanks__tick { animation: none; stroke-dashoffset: 0; }
}

.shop-section { margin: 44px 0 14px; }
.shop-note { color: var(--ink-soft); font-size: .9375rem; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.shop-note--foot { margin-top: 32px; font-size: .8125rem; }


/* -------------------------------------------------------------- costs ---- */
.shop-costs {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.shop-cost { min-width: 0; }
.shop-cost__list { list-style: none; margin: 8px 0 0; padding: 0; }
.shop-cost__row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
    padding: 10px 0; border-top: 1px solid var(--line);
}
.shop-cost__row:first-child { border-top: 0; }
.shop-cost__name { overflow-wrap: anywhere; }
.shop-cost__plan { margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.shop-cost__price { font-weight: 600; font-size: 1.0625rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-cost__unit { font-family: var(--font); font-size: .75rem; color: var(--ink-faint); }
.shop-cost__once { margin: 8px 0 0; }

/* -------------------------------------------------------------- stats ---- */
.shop-stats {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.shop-stats .yu-stat { min-width: 0; }
.shop-stats .yu-stat__caption a { color: var(--purple-ink); }

/* ------------------------------------------------------------ history ---- */
.shop-history__list { list-style: none; margin: 0; padding: 0; }
.shop-history__row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 12px 0; border-top: 1px solid var(--line);
}
.shop-history__row:first-child { border-top: 0; }
.shop-history__what { display: grid; min-width: 0; }
.shop-history__when { color: var(--ink-faint); font-size: .8125rem; overflow-wrap: anywhere; }
.shop-history__delta { font-weight: 600; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.shop-history__delta.is-minus { color: var(--ink-soft); }

/* ---------------------------------------------------------- app page ---- */
.shop-app__head { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); max-width: 820px; }
.shop-app__head .shop-head__title { margin: 2px 0 8px; }
.shop-app__icon { width: clamp(64px, 7vw, 88px); height: clamp(64px, 7vw, 88px); border-radius: 24px; background: var(--card); box-shadow: var(--shadow-card); }
.shop-app__icon svg { width: 46%; height: 46%; }
.shop-app { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.shop-app__desc { color: var(--ink-soft); margin: 0; max-width: var(--measure); font-size: 1rem; line-height: 1.65; }
.shop-app__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 18px; }
.shop-app__side { display: grid; gap: 16px; justify-items: center; }
.shop-app__side .shop-cost { width: 100%; }
.shop-app__mascot { --yu-mascot-size: 150px; }

/* ------------------------------------------------ other projects fold ---- */
.shop-others { margin-top: 28px; padding: 0; }
.shop-others__summary {
    list-style: none; cursor: pointer;
    display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
    padding: 18px 22px;
}
.shop-others__summary::-webkit-details-marker { display: none; }
.shop-others__summary:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.shop-others__hint { color: var(--ink-soft); font-size: .875rem; }
.shop-others__list { list-style: none; margin: 0; padding: 0 22px 12px; }
.shop-others__row {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 12px 0; border-top: 1px solid var(--line);
}
.shop-others__icon svg { width: 24px; height: 24px; }
.shop-others__text { display: grid; min-width: 0; }
.shop-others__tag { color: var(--ink-soft); font-size: .8125rem; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .shop-app { grid-template-columns: minmax(0, 1fr); }
    .shop-app__mascot { display: none; }
    .shop-others__row { grid-template-columns: 28px minmax(0, 1fr); }
    .shop-others__row .yu-more { grid-column: 2; }
}

/* ---------------------------------------- pack figures (credits.php too) */
.shop-plan__amount {
    font-size: clamp(2.25rem, 3.4vw, 2.75rem); line-height: 1;
    font-weight: var(--w-hero); letter-spacing: -.03em; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.shop-plan__per { color: var(--ink-faint); font-size: .875rem; }
/* The per-credit yardstick: priced by 100 credits, and how much less that
   is than Lite. A comparison with a plan we sell, never a struck-out price. */
.shop-plan__rate {
    margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    font-size: .875rem; color: var(--ink-soft);
}
.shop-plan__pill {
    display: inline-flex; align-items: center;
    margin: 0; padding: 3px 10px; border-radius: var(--r-pill);
    background: var(--lav-50); color: var(--purple-ink);
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.shop-plan__btn { width: 100%; justify-content: center; }

/* -------------------------------------------------------------- packs ---- */
.shop-packs {
    list-style: none; margin: 0 0 12px; padding: 0;
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.shop-pack { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px; }
.shop-pack .yu-label { margin: 0; }
.shop-pack__credits { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.shop-pack__credits .shop-plan__amount { font-size: 2rem; }
.shop-pack__price { margin: 0; font-size: 1.0625rem; font-weight: var(--w-head); color: var(--ink); }
.shop-pack__cta { margin-top: auto; padding-top: 6px; display: grid; }
