/* ══════════════════════════════════════════════════════════════════
   MK STORE effects (assets/js/mk-fx.js toggles them from the backend).
   Every colour is a theme variable from system/mk_theme.php, so the
   effects follow "ปรับแต่งสีไฟ & ธีมเว็บ" automatically.
   ══════════════════════════════════════════════════════════════════ */

@property --mk-beam-a {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* ── 1. Light running around product / category cards ── */
.mk-fx-beam {
    position: relative;
    isolation: isolate;
}
.s5-card.mk-fx-beam,
.compact-cat-card.mk-fx-beam {
    border-color: rgba(var(--mk-accent-rgb), 0.42) !important;
    box-shadow:
        0 0 0 1px rgba(var(--mk-accent-rgb), 0.12),
        0 0 16px rgba(var(--mk-accent-rgb), 0.22),
        inset 0 0 18px rgba(var(--mk-accent-rgb), 0.07),
        0 4px 20px rgba(0, 0, 0, 0.55) !important;
}
.s5-card.mk-fx-beam:hover,
.compact-cat-card.mk-fx-beam:hover,
.s5-card.mk-fx-beam.is-atom {
    border-color: rgba(var(--mk-accent-hi-rgb), 0.75) !important;
    box-shadow:
        0 0 0 1px rgba(var(--mk-accent-rgb), 0.25),
        0 0 26px rgba(var(--mk-accent-rgb), 0.38),
        inset 0 0 24px rgba(var(--mk-accent-rgb), 0.12),
        0 6px 24px rgba(0, 0, 0, 0.6) !important;
}
.mk-fx-beam > .mk-beam {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.6px;
    pointer-events: none;
    z-index: 4;
    background: conic-gradient(from var(--mk-beam-a),
        transparent 0deg,
        transparent 245deg,
        rgba(var(--mk-accent-rgb), 0.15) 270deg,
        var(--mk-accent) 305deg,
        var(--mk-accent-hi) 335deg,
        #ffffff 350deg,
        transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: mkBeamSpin var(--mk-beam-speed, 4s) linear infinite;
    filter: drop-shadow(0 0 3px rgba(var(--mk-accent-hi-rgb), 0.9));
}
.mk-fx-beam:nth-child(3n+2) > .mk-beam { animation-delay: calc(var(--mk-beam-speed, 4s) * -0.33); }
.mk-fx-beam:nth-child(3n+3) > .mk-beam { animation-delay: calc(var(--mk-beam-speed, 4s) * -0.66); }
@keyframes mkBeamSpin {
    to { --mk-beam-a: 360deg; }
}

/* ── 2. Shop logo + 3D atom ──
   Real 3D: each orbit is a ring tilted in depth; the electron travels round it and
   passes behind / in front of the logo (the logo sits in the middle plane).
   The atom only sways gently in 3D; it never spins flat. */
.mk-atom {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    perspective: 560px;
    perspective-origin: 50% 50%;
}
.mk-a3-scene {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    animation: mkA3Sway 7.5s ease-in-out infinite;
}
@keyframes mkA3Sway {
    0%, 100% { transform: rotateX(10deg) rotateY(-14deg); }
    50%      { transform: rotateX(-8deg) rotateY(14deg); }
}
.mk-a3-ring {
    position: absolute;
    inset: 4%;
    transform-style: preserve-3d;
    transform: rotateZ(var(--mk-a3-r, 0deg)) rotateX(70deg);
}
.mk-a3-ring:nth-child(2) { --mk-a3-r: 60deg; }
.mk-a3-ring:nth-child(3) { --mk-a3-r: 120deg; }
.mk-a3-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(var(--mk-accent-rgb), 0.95);
    box-shadow: 0 0 9px rgba(var(--mk-accent-rgb), 0.75), inset 0 0 9px rgba(var(--mk-accent-rgb), 0.55);
    transform-style: preserve-3d;
    animation: mkA3Orbit var(--mk-atom-speed, 2.6s) linear infinite;
}
.mk-a3-ring:nth-child(2) .mk-a3-orbit,
.mk-a3-ring:nth-child(2) .mk-a3-e { animation-duration: calc(var(--mk-atom-speed, 2.6s) * 1.18); animation-delay: calc(var(--mk-atom-speed, 2.6s) * -0.4); }
.mk-a3-ring:nth-child(3) .mk-a3-orbit,
.mk-a3-ring:nth-child(3) .mk-a3-e { animation-duration: calc(var(--mk-atom-speed, 2.6s) * 0.86); animation-delay: calc(var(--mk-atom-speed, 2.6s) * -0.75); }
@keyframes mkA3Orbit {
    to { transform: rotateZ(360deg); }
}
/* electron: undoes the orbit turn and the tilt so it always faces the viewer (round, not squashed) */
.mk-a3-e {
    position: absolute;
    left: 50%;
    top: 0;
    width: 9%;
    height: 9%;
    margin: -4.5% 0 0 -4.5%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #ffffff 0 34%, var(--mk-accent-soft) 58%, rgba(var(--mk-accent-hi-rgb), 0) 72%);
    box-shadow: 0 0 10px 3px rgba(var(--mk-accent-hi-rgb), 0.9), 0 0 3px 1px #ffffff;
    animation: mkA3Face var(--mk-atom-speed, 2.6s) linear infinite;
}
@keyframes mkA3Face {
    from { transform: rotateZ(0deg) rotateX(-70deg); }
    to   { transform: rotateZ(-360deg) rotateX(-70deg); }
}
.mk-atom-logo {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 46%;
    height: 46%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(var(--mk-accent-rgb), 0.8)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
    transform: translateZ(0);
    animation: mkAtomFloat 3.4s ease-in-out infinite;
}
@keyframes mkAtomFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(0, -3%, 0) scale(1.035); }
}

/* atom shown over a product image (spotlight / hover / tap) */
.mk-card-atom {
    position: absolute;
    inset: 0;
    z-index: 2;
    /* flex (not grid): the 3D atom has no in-flow content, so a grid track would collapse it */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2, .8, .2, 1);
    background: radial-gradient(circle at 50% 50%, rgba(var(--mk-accent-rgb), 0.2) 0%, rgba(3, 4, 8, 0.55) 70%);
}
.mk-card-atom .mk-atom { width: 80%; }
/* "เฉพาะตอนกดที่การ์ด": appear right away under the finger */
.mk-atom-quick .mk-card-atom, .mk-atom-quick .s5-img-wrap > img { transition-duration: 0.16s !important; }
.mk-fx-card.is-atom .mk-card-atom {
    opacity: 1;
    transform: none;
}
.mk-fx-card .s5-img-wrap > img {
    transition: transform 0.45s ease, filter 0.45s ease !important;
}
.mk-fx-card.is-atom .s5-img-wrap > img {
    filter: blur(7px) brightness(0.32) saturate(0.6);
    transform: scale(1.08) !important;
}
/* the shop's ".s5-img-wrap img" rule must not reach the logo inside the atom */
.s5-img-wrap .mk-card-atom .mk-atom-logo {
    width: 46% !important;
    height: 46% !important;
    object-fit: contain !important;
    transition: none !important;
}

/* login / register */
.auth-celestial-wrap.mk-atom-host {
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-celestial-wrap.mk-atom-host .mk-atom {
    width: min(300px, 82%);
}
.auth-celestial-wrap.mk-atom-host .mk-atom-logo {
    width: 44%;
    height: 44%;
    border-radius: 50%;
}

/* page-change loader: same atom as the product cards, a little smaller */
.cyber-warp-stage .mk-atom.mk-atom-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 132px;
    transform: translate(-50%, -50%);
    z-index: 3;
}
.cyber-warp-stage .mk-atom.mk-atom-loader::before {
    content: '';
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--mk-accent-rgb), 0.2) 0%, transparent 68%);
    pointer-events: none;
}

/* ── 3. Shooting stars ── */
#mk-fx-sky {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.mk-star {
    position: absolute;
    width: var(--len, 150px);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(var(--mk-accent-hi-rgb), 0) 0%, rgba(var(--mk-accent-hi-rgb), 0.55) 55%, var(--mk-accent-hi) 85%, #ffffff 100%);
    filter: drop-shadow(0 0 6px rgba(var(--mk-accent-rgb), 0.95));
    transform-origin: left center;
    opacity: 0;
    animation: mkStar var(--dur, 1.2s) cubic-bezier(.3, .1, .6, 1) forwards;
}
.mk-star::after {
    content: '';
    position: absolute;
    right: -3px;
    top: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px 2px rgba(var(--mk-accent-hi-rgb), 0.95);
}
@keyframes mkStar {
    0% { opacity: 0; transform: rotate(var(--ang, 32deg)) translateX(0); }
    12% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--ang, 32deg)) translateX(var(--dist, 520px)); }
}

/* ── 4. Fade-up on scroll ── */
.mk-reveal {
    opacity: 0;
    transform: translateY(16px);
}
.mk-reveal.mk-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.2, .8, .2, 1), border-color 0.16s ease, box-shadow 0.16s ease !important;
}

/* ── 5. Light sweep over main buttons ── */
.mk-shine {
    position: relative;
    overflow: hidden;
}
.mk-shine > .mk-shine-sweep {
    position: absolute;
    top: -10%;
    bottom: -10%;
    left: -70%;
    width: 45%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.32) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: mkShine 4.2s ease-in-out infinite;
    animation-delay: var(--mk-shine-delay, 0s);
}
@keyframes mkShine {
    0%, 72% { left: -70%; }
    100% { left: 140%; }
}

/* ── 6. Small extras ── */
.mk-fx-on .nav-pill-link.active {
    animation: mkPillGlow 2.8s ease-in-out infinite;
}
@keyframes mkPillGlow {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 6px rgba(var(--mk-accent-rgb), 0.55)); }
}

/* ── Sold-count badge (backend → แสดงยอดขายบนการ์ด) ── */
.s5-sold-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 3;
    max-width: calc(100% - 16px);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    color: #ffffff;
    background: rgba(5, 7, 12, 0.78);
    border: 1px solid rgba(var(--mk-accent-rgb), 0.45);
    box-shadow: 0 0 10px rgba(var(--mk-accent-rgb), 0.25);
}
.s5-sold-badge i { color: var(--mk-accent-hi); margin-right: 3px; }
@media (max-width: 480px) {
    .s5-sold-badge { bottom: 5px; left: 5px; padding: 2px 6px; font-size: 9px; }
}

/* ── 7. Tap / click marker: shows exactly where the finger or mouse pressed ── */
#mk-fx-taps {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2147483000;
    /* own variable: the site forces every span/div text colour to white */
    --mk-tap-c: var(--mk-tap-color, var(--mk-accent-hi));
}
.mk-tap {
    position: absolute;
    width: var(--s, 60px);
    height: var(--s, 60px);
    margin: calc(var(--s, 60px) / -2) 0 0 calc(var(--s, 60px) / -2);
    pointer-events: none;
}
.mk-tap::before,
.mk-tap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}
/* ripple: one ring spreading out + a bright centre */
.mk-tap-ripple::before {
    inset: 0;
    border: 2px solid var(--mk-tap-c);
    box-shadow: 0 0 12px var(--mk-tap-c), inset 0 0 8px var(--mk-tap-c);
    animation: mkTapRing 0.62s cubic-bezier(.2, .7, .3, 1) forwards;
}
.mk-tap-ripple::after {
    inset: 39%;
    background: #ffffff;
    box-shadow: 0 0 8px 3px var(--mk-tap-c);
    animation: mkTapCore 0.5s ease-out forwards;
}
/* pulse: two rings, one after the other */
.mk-tap-pulse::before,
.mk-tap-pulse::after {
    inset: 0;
    border: 2px solid var(--mk-tap-c);
    box-shadow: 0 0 10px var(--mk-tap-c);
    animation: mkTapRing 0.7s cubic-bezier(.2, .7, .3, 1) forwards;
}
.mk-tap-pulse::after {
    inset: 18%;
    animation-delay: 0.12s;
    opacity: 0;
}
/* burst: sparks flying out + small ring */
.mk-tap-burst::before {
    inset: 22%;
    border: 2px solid var(--mk-tap-c);
    box-shadow: 0 0 10px var(--mk-tap-c);
    animation: mkTapRing 0.5s ease-out forwards;
}
.mk-tap-burst > i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 24%;
    margin-left: -1.5px;
    border-radius: 3px;
    background: linear-gradient(#ffffff, var(--mk-tap-c) 45%, transparent);
    box-shadow: 0 0 6px var(--mk-tap-c);
    transform-origin: 50% 0;
    animation: mkTapSpark 0.55s ease-out forwards;
}
/* dot: soft glowing dot */
.mk-tap-dot::before {
    inset: 22%;
    background: radial-gradient(circle, #ffffff 0 22%, var(--mk-tap-c) 46%, transparent 70%);
    animation: mkTapGlow 0.6s ease-out forwards;
}
@keyframes mkTapRing {
    0%   { transform: scale(0.15); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}
@keyframes mkTapCore {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
@keyframes mkTapSpark {
    0%   { transform: rotate(var(--a)) translateY(10%) scaleY(0.4); opacity: 1; }
    100% { transform: rotate(var(--a)) translateY(150%) scaleY(1); opacity: 0; }
}
@keyframes mkTapGlow {
    0%   { transform: scale(0.4); opacity: 1; }
    60%  { opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ── 8. Cookie consent (PDPA) – compact bar; the page stays usable behind it ── */
.mkc { position: fixed; inset: 0; z-index: 2147482000; display: flex; align-items: flex-end; justify-content: flex-start; padding: 16px; pointer-events: none; }
.mkc[hidden] { display: none; }
/* dim the page only while the per-category settings are open */
.mkc-backdrop { position: absolute; inset: 0; background: rgba(2, 3, 6, 0.45); opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s; pointer-events: none; }
.mkc.is-open.is-settings .mkc-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
.mkc-card {
    position: relative; width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 12px 11px; border-radius: 16px; pointer-events: auto;
    background: linear-gradient(180deg, rgba(16, 18, 28, 0.96), rgba(8, 9, 14, 0.97));
    border: 1px solid rgba(var(--mk-accent-rgb), 0.38);
    box-shadow: 0 0 22px rgba(var(--mk-accent-rgb), 0.18), 0 14px 36px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transform: translateY(16px); opacity: 0; transition: transform 0.26s cubic-bezier(.2, .8, .2, 1), opacity 0.26s ease;
    color: #ffffff; letter-spacing: 0;
}
.mkc.is-open .mkc-card { transform: none; opacity: 1; }
.mkc-head { display: flex; gap: 10px; align-items: flex-start; }
.mkc-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 0.92rem; color: var(--mk-accent-hi); background: rgba(var(--mk-accent-rgb), 0.12); border: 1px solid rgba(var(--mk-accent-rgb), 0.32); }
.mkc-head > div { min-width: 0; }
.mkc-head h2 { margin: 0 0 1px; font-size: 0.86rem; font-weight: 800; line-height: 1.45; color: #ffffff !important; }
.mkc-head p { margin: 0; font-size: 0.74rem; line-height: 1.55; color: #cbd5e1 !important; overflow-wrap: break-word; }
.mkc-head a { color: var(--mk-accent-hi) !important; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.mkc-panel { margin: 10px 0 0; display: grid; gap: 6px; }
.mkc-panel[hidden] { display: none; }
.mkc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); cursor: pointer; }
.mkc-row.is-locked { cursor: default; }
.mkc-row-text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.mkc-row-title { font-size: 0.78rem; font-weight: 700; line-height: 1.45; color: #ffffff !important; }
.mkc-row-title i { width: 1.2em; margin-right: 5px; text-align: center; color: var(--mk-accent-hi) !important; }
.mkc-row-help { font-size: 0.68rem; line-height: 1.45; color: #94a3b8 !important; }
.mkc-row .form-switch { padding-left: 0; flex: 0 0 auto; }
.mkc-row .form-check-input { float: none; margin: 0; width: 2.1em; height: 1.15em; cursor: pointer; }
.mkc-row .form-check-input:disabled { opacity: 0.7; cursor: default; }
.mkc-actions { display: flex; gap: 6px; margin-top: 10px; }
.mkc-btn { flex: 1 1 0; min-width: 0; border-radius: 10px; padding: 7px 6px; font-weight: 700; font-size: 0.74rem; line-height: 1.3; cursor: pointer; white-space: nowrap; text-align: center; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.mkc-btn[hidden] { display: none; }
.mkc-ghost { background: rgba(255, 255, 255, 0.04); color: #e2e8f0 !important; border: 1px solid rgba(255, 255, 255, 0.14); }
.mkc-ghost:hover { border-color: rgba(var(--mk-accent-rgb), 0.6); }
.mkc-primary { flex-grow: 1.25; background: linear-gradient(135deg, var(--mk-accent-lo), var(--mk-accent)); color: var(--mk-on-accent) !important; border: 1px solid transparent; box-shadow: 0 4px 14px rgba(var(--mk-accent-rgb), 0.32); }
.mkc-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(var(--mk-accent-rgb), 0.45); }
.mkc-remember-note { margin-top: 6px; font-size: 0.76rem; line-height: 1.5; color: #94a3b8; }
.mkc-remember-note a { color: var(--mk-accent-hi); }
@media (max-width: 575.98px) {
    .mkc { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); justify-content: center; }
    .mkc-card { width: 100%; max-height: 78dvh; }
}

/* ── 9. Coins & prices ──
 * Coin colours follow the theme; the backend can give coins their own colour
 * (mk_opt_frontend_css() then overrides these variables). */
:root {
    --mk-coin-hi: var(--mk-accent-soft, #9fc0ff);
    --mk-coin: var(--mk-accent, #0055ff);
    --mk-coin-lo: var(--mk-accent-lo, #002a80);
    --mk-coin-rgb: var(--mk-accent-rgb, 0, 85, 255);
}
/* stacked coins after the big price on the product page, with a small gap */
.mk-coin {
    display: inline-block; flex: 0 0 auto; width: 1.2em; height: 1.08em; margin: 0 0 0 0.36em;
    vertical-align: baseline; overflow: visible;
    filter: drop-shadow(0 0 0.18em rgba(var(--mk-coin-rgb), 0.55));
    animation: mkCoinGlow 3.2s ease-in-out infinite;
}
/* inside price boxes that already space their parts with a flex gap */
.spp-final-price-wrap > .mk-coin,
.mk-coin-host > .mk-coin { margin-left: 0.1em; align-self: center; }
@keyframes mkCoinGlow {
    0%, 100% { filter: drop-shadow(0 0 0.14em rgba(var(--mk-coin-rgb), 0.45)); transform: translateY(0); }
    50% { filter: drop-shadow(0 0 0.32em rgba(var(--mk-coin-rgb), 0.85)); transform: translateY(-0.04em); }
}
/* number counting up: keep its final width so nothing beside it moves */
.mk-counting { display: inline-block; text-align: left; }
/* full-screen coin rain after a successful top-up */
#mk-coin-rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2147482500; pointer-events: none; }

/* motion off: system setting, or effects disabled */
/* ── 10. Product status (สถานะสินค้า): badge on the product page + warning before buying ──
   colours: backend → สถานะสินค้า (--mk-ps-safe / risk / maint) */
.mk-ps-chip { --c: var(--mk-ps-safe-rgb, 34, 197, 94); display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; color: rgb(var(--c)) !important; border-color: rgba(var(--c), 0.35) !important; background: rgba(var(--c), 0.08) !important; transition: border-color .15s ease; }
.mk-ps-chip.is-risk { --c: var(--mk-ps-risk-rgb, 245, 158, 11); }
.mk-ps-chip.is-maint { --c: var(--mk-ps-maint-rgb, 239, 68, 68); }
.mk-ps-chip:hover { border-color: rgba(var(--c), 0.75) !important; }
.mk-ps-chip[hidden] { display: none !important; }
.mk-ps-chip span { color: inherit !important; }
.mk-ps-warn { --c: var(--mk-ps-risk-rgb, 245, 158, 11); text-align: left; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--c), 0.1); border: 1px solid rgba(var(--c), 0.4); }
.mk-ps-warn-title { display: flex; align-items: center; gap: 8px; color: rgb(var(--c)) !important; font-weight: 700; font-size: 0.92rem; line-height: 1.5; }
.mk-ps-warn-note { margin-top: 4px; color: #e2e8f0; font-size: 0.85rem; line-height: 1.55; overflow-wrap: break-word; }
.mk-ps-warn-link { display: inline-block; margin-top: 6px; color: rgb(var(--c)) !important; font-size: 0.8rem; text-decoration: underline; }

/* ── 11. ปิดปรับปรุง: hammer striking an anvil + "MAINTENANCE" sign, centred on the product picture ──
   colour = backend → สถานะสินค้า → สี “ปิดปรับปรุง” (--mk-ps-maint): hot metal, sparks, sign, stripes.
   Everything is in em of .mk-maint-stage, so the same drawing scales from a shop card to the product page.
   Geometry (em): anvil 7 x 4, strike point (top centre of the hot metal) at 4.35 / 0.3;
   hammer 3.4 x 4.533, pivot = end of the handle at 7.86 / -1.06 -> at rotate(-90deg) its face lands on the metal. */
.mk-maint { --m: var(--mk-ps-maint-rgb, 239, 68, 68); position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; container-type: inline-size; overflow: hidden; border-radius: inherit;
    background: radial-gradient(ellipse at 50% 56%, rgba(var(--m), 0.2), rgba(5, 6, 12, 0.82) 70%); }
.mk-maint[hidden] { display: none !important; }
.mk-maint::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
    background: repeating-linear-gradient(-45deg, rgb(var(--m)) 0 7px, #0b0c12 7px 14px) top / 100% 6px no-repeat,
                repeating-linear-gradient(-45deg, rgb(var(--m)) 0 7px, #0b0c12 7px 14px) bottom / 100% 6px no-repeat; }
.mk-maint.is-big::before { background-size: 100% 10px, 100% 10px; }
.mk-maint::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 52%, rgba(var(--m), 0.5), transparent 50%); animation: mkMaintFlash 1.4s linear infinite; }
.mk-maint-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding-top: 5.5em; font-size: 7px; font-size: clamp(5px, 6.3cqw, 13px); }
.mk-maint.is-big .mk-maint-stage { font-size: 14px; font-size: clamp(9px, 4.7cqw, 22px); }
.mk-maint-forge { position: relative; width: 7em; height: 4em; animation: mkMaintJolt 1.4s linear infinite; }
.mk-maint-anvil { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0.25em 0.35em rgba(0, 0, 0, 0.6)); }
.mk-maint-anvil .a-body { fill: #2f3a4b; stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.2; }
.mk-maint-anvil .a-face { fill: #5b6b82; }
.mk-maint-anvil .a-base { fill: #232c3a; }
.mk-maint-anvil .a-hot { fill: rgb(var(--m)); stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.8; }
.mk-maint-anvil .a-hotcore { fill: #ffffff; opacity: 0.75; }
.mk-maint-glow { position: absolute; left: 3.35em; top: -0.55em; width: 2em; height: 1.5em; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--m), 0.95), rgba(var(--m), 0) 100%); animation: mkMaintGlow 1.4s ease-out infinite; }
.mk-maint-hammer { position: absolute; left: 6.16em; top: -5.42em; width: 3.4em; height: 4.533em; overflow: visible; transform-origin: 50% 96.25%; animation: mkMaintSwing 1.4s linear infinite; filter: drop-shadow(0 0.18em 0.3em rgba(0, 0, 0, 0.6)); }
.mk-maint-hammer .h-handle { fill: #5a3d2b; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; }
.mk-maint-hammer .h-grip { fill: #111827; stroke: rgba(var(--m), 0.7); stroke-width: 1.2; }
.mk-maint-hammer .h-head, .mk-maint-hammer .h-peen { fill: #94a3b8; stroke: rgba(0, 0, 0, 0.4); stroke-width: 1; }
.mk-maint-hammer .h-band { fill: rgb(var(--m)); }
.mk-maint-hammer .h-face { fill: #e2e8f0; }
.mk-maint-hammer .h-shine { fill: rgba(255, 255, 255, 0.55); }
.mk-maint-sparks { position: absolute; left: 4.35em; top: 0.3em; width: 0; height: 0; }
.mk-maint-sparks span { position: absolute; left: -0.06em; top: -0.5em; width: 0.12em; height: 0.5em; border-radius: 0.1em; opacity: 0; transform-origin: 50% 100%;
    background: linear-gradient(to top, rgb(var(--m)), #fff7d6); animation: mkMaintSpark 1.4s ease-out infinite; }
.mk-maint-sparks span:nth-child(1) { --a: -78deg; --d: -1.6em; }
.mk-maint-sparks span:nth-child(2) { --a: -55deg; --d: -2.3em; }
.mk-maint-sparks span:nth-child(3) { --a: -30deg; --d: -1.8em; }
.mk-maint-sparks span:nth-child(4) { --a: -10deg; --d: -2.6em; }
.mk-maint-sparks span:nth-child(5) { --a: 12deg; --d: -2.1em; }
.mk-maint-sparks span:nth-child(6) { --a: 34deg; --d: -2.5em; }
.mk-maint-sparks span:nth-child(7) { --a: 58deg; --d: -1.7em; }
.mk-maint-sparks span:nth-child(8) { --a: 80deg; --d: -1.3em; }
.mk-maint-label { margin-top: 0.55em; display: inline-block; padding: 0.5em 0.95em; border-radius: 0.5em; line-height: 1; font-family: var(--font-main, inherit); font-weight: 800; font-size: 0.86em; letter-spacing: 0.1em; white-space: nowrap;
    background: repeating-linear-gradient(-45deg, rgb(var(--m)) 0 0.55em, rgba(var(--m), 0.78) 0.55em 1.1em);
    border: 0.08em solid rgba(255, 255, 255, 0.32); box-shadow: 0 0.3em 1.1em rgba(var(--m), 0.4), inset 0 -0.16em 0 rgba(0, 0, 0, 0.22);
    animation: mkMaintSign 1.4s ease-out infinite; }
.mk-maint-label span { color: #ffffff !important; text-shadow: 0 0.08em 0.2em rgba(0, 0, 0, 0.45); }
.mk-maint-sub { position: relative; z-index: 1; margin-top: 0.7em; font-size: 16px; font-size: clamp(12px, 3.6cqw, 19px); font-weight: 700; line-height: 1.4; color: #ffffff !important; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.mk-maint-note { position: relative; z-index: 1; max-width: 84%; margin-top: 0.45em; padding: 0.45em 0.85em; border-radius: 0.65em; text-align: center; font-size: 13px; font-size: clamp(11px, 2.9cqw, 15px); line-height: 1.5; overflow-wrap: break-word;
    color: #e2e8f0 !important; background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(var(--m), 0.4); }
.mk-maint-note[hidden] { display: none; }
@keyframes mkMaintSwing {
    0% { transform: rotate(6deg); }
    30% { transform: rotate(18deg); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
    44% { transform: rotate(-90deg); animation-timing-function: ease-out; }
    50% { transform: rotate(-74deg); animation-timing-function: ease-in; }
    56% { transform: rotate(-89deg); animation-timing-function: ease-out; }
    74%, 100% { transform: rotate(6deg); }
}
@keyframes mkMaintJolt {
    0%, 43% { transform: none; }
    45% { transform: translateY(0.07em); }
    48% { transform: none; }
    56% { transform: translateY(0.04em); }
    59%, 100% { transform: none; }
}
@keyframes mkMaintGlow {
    0%, 42% { opacity: 0.55; transform: scale(1); }
    45% { opacity: 1; transform: scale(1.7); }
    70%, 100% { opacity: 0.55; transform: scale(1); }
}
@keyframes mkMaintSpark {
    0%, 43% { opacity: 0; transform: rotate(var(--a)) translateY(0) scaleY(0.3); }
    46% { opacity: 1; transform: rotate(var(--a)) translateY(-0.2em) scaleY(1.1); }
    66% { opacity: 0; transform: rotate(var(--a)) translateY(var(--d)) scaleY(0.4); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(var(--d)) scaleY(0.4); }
}
@keyframes mkMaintSign {
    0%, 44% { box-shadow: 0 0.3em 1.1em rgba(var(--m), 0.4), inset 0 -0.16em 0 rgba(0, 0, 0, 0.22); }
    47% { box-shadow: 0 0.3em 1.8em rgba(var(--m), 0.85), inset 0 -0.16em 0 rgba(0, 0, 0, 0.22); }
    70%, 100% { box-shadow: 0 0.3em 1.1em rgba(var(--m), 0.4), inset 0 -0.16em 0 rgba(0, 0, 0, 0.22); }
}
@keyframes mkMaintFlash {
    0%, 43% { opacity: 0; }
    46% { opacity: 0.5; }
    62%, 100% { opacity: 0; }
}

/* ── 12. ของแถม: "มีของแถม" ribbon on shop cards (colours from the theme) ── */
.s5-gift-badge { position: absolute; bottom: 8px; left: 8px; z-index: 2; max-width: calc(100% - 16px); display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.2; white-space: nowrap;
    color: var(--mk-on-accent, #ffffff) !important; background: linear-gradient(135deg, var(--mk-accent), var(--mk-accent-hi)); box-shadow: 0 0 12px rgba(var(--mk-accent-rgb), 0.55), 0 2px 8px rgba(0, 0, 0, 0.6); }
.s5-gift-badge i { animation: mkGiftWiggle 2.4s ease-in-out infinite; transform-origin: 50% 80%; }
.s5-sold-badge + .s5-gift-badge { bottom: 34px; }
@keyframes mkGiftWiggle { 0%, 78%, 100% { transform: rotate(0); } 82% { transform: rotate(-14deg); } 88% { transform: rotate(12deg); } 94% { transform: rotate(-6deg); } }
@media (max-width: 480px) {
    .s5-gift-badge { bottom: 5px; left: 5px; padding: 2px 7px; font-size: 9.5px; gap: 3px; }
    .s5-sold-badge + .s5-gift-badge { bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .mk-fx-beam > .mk-beam,
    .mk-a3-scene,
    .mk-a3-orbit,
    .mk-atom-logo,
    .mk-shine > .mk-shine-sweep,
    .mk-fx-on .nav-pill-link.active { animation: none !important; }
    .mk-a3-e { display: none; }
    #mk-fx-sky { display: none; }
    .mk-reveal { opacity: 1 !important; transform: none !important; }
    .mkc-card, .mkc-backdrop { transition: none !important; }
    .mk-coin { animation: none !important; }
    #mk-coin-rain { display: none !important; }
    .mk-maint-hammer { animation: none !important; transform: rotate(-30deg); }
    .mk-maint-label, .mk-maint::after, .mk-maint-forge, .mk-maint-glow { animation: none !important; }
    .mk-maint-sparks { display: none !important; }
    .s5-gift-badge i { animation: none !important; }
}
