/* =====================================================================
   Extra storefront skins: Mint, Orbit, P.SHOP, Clay, Cyber.
   Adapted from the shop owner's theme files onto this app's tokens.
   - Raw colours live only in the token blocks below; components read tokens.
   - Every skin has a light and a dark set. Cyber opens dark first, the rest open light.
   - Contrast (checked): body text >= 4.5:1 on bg/surface; text on primary >= 4.5:1;
     muted text >= 4.5:1 on bg, surface and surface-2, in both modes.
   ===================================================================== */

/* ---------- Shared skin knobs (defaults = current look) ---------- */
:root {
  --page-bg: none;          /* extra page backdrop layered over --color-bg */
  --btn-grad: none;         /* optional gradient on primary buttons */
  --card-radius: 22px;
  --card-ring: 0 0 0 0 transparent; /* outer ring on product cards */
}

/* =================== Mint · เขียวมิ้นต์สะอาด การ์ดขาวขอบเรืองแสง =================== */
[data-skin="mint"] {
  --rail-c: #1d4a3f; --shell-bg: rgb(255 255 255 / 0.5); --shell-shadow: 0 30px 80px -30px rgb(22 48 42 / 0.3); --art-a: #d9f3e8; --art-b: #bfe6d8;
  --font-heading: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --color-bg: #e3ece9; --color-surface: #ffffff; --color-surface-2: #f1f7f4;
  --color-text: #16302a; --color-text-muted: #4a6157;
  --color-border: #d3e0db; --color-border-strong: #8fa69d;
  --color-primary: #1d4a3f; --color-primary-hover: #163a31; --color-on-primary: #ffffff;
  --color-primary-soft: #d9f3e8; --color-on-primary-soft: #163a31;
  --color-accent: #b83a35; --color-on-accent: #ffffff;
  --glow: rgb(42 157 124 / 0.26);
  --hero-from: #d9f3e8; --hero-to: #bfe6d8;
  --page-bg: radial-gradient(1100px 620px at 8% -8%, #bfe6d8 0, transparent 60%), radial-gradient(900px 700px at 100% 75%, #f0e4d8 0, transparent 60%);
  --card-ring: 0 0 0 3px rgb(255 255 255 / 0.75);
  --card-sh-tint: rgb(22 48 42 / 0.10);
}
[data-mode="dark"][data-skin="mint"] {
  --rail-c: #1f5a4b; --shell-bg: rgb(19 36 31 / 0.6); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); --art-a: #1a3a31; --art-b: #13241f;
  --color-bg: #0d1a17; --color-surface: #13241f; --color-surface-2: #1a302a;
  --color-text: #e8f5ef; --color-text-muted: #a9c4b9;
  --color-border: #24403a; --color-border-strong: #4c6e64;
  --color-primary: #6fd3b0; --color-primary-hover: #a9ecd2; --color-on-primary: #06231b;
  --color-primary-soft: #133a30; --color-on-primary-soft: #d9f3e8;
  --color-accent: #ff8a80; --color-on-accent: #2a0605;
  --glow: rgb(42 157 124 / 0.30);
  --hero-from: #12352c; --hero-to: #0f1d19;
  --page-bg: radial-gradient(1100px 620px at 8% -8%, rgb(42 157 124 / 0.22) 0, transparent 60%);
  --card-ring: 0 0 0 1px rgb(169 236 210 / 0.10);
}

/* =================== Orbit · ขาว-เขียว-แดง สดใส รูปสินค้าวงกลม =================== */
[data-skin="orbit"] {
  --rail-c: #2e7d32; --shell-bg: #fbfdf9; --shell-shadow: 0 30px 80px -30px rgb(40 80 30 / 0.3); --art-a: #eef7e4; --art-b: #dcedc8;
  --font-heading: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --color-bg: #f3f6f1; --color-surface: #ffffff; --color-surface-2: #f3f7ee;
  --color-text: #1b2419; --color-text-muted: #4f5a4b;
  --color-border: #e2e9dc; --color-border-strong: #9aa894;
  --color-primary: #2a7230; --color-primary-hover: #1b5e20; --color-on-primary: #ffffff;
  --color-primary-soft: #e4f1d6; --color-on-primary-soft: #1b5e20;
  --color-accent: #c62828; --color-on-accent: #ffffff;
  --glow: rgb(139 195 74 / 0.30);
  --hero-from: #e3f2d3; --hero-to: #ffffff;
  --page-bg: radial-gradient(900px 520px at 100% -10%, #e3f2d3 0, transparent 60%), radial-gradient(800px 600px at -10% 90%, #fdecea 0, transparent 55%);
  --card-radius: 26px;
  --card-sh-tint: rgb(30 70 20 / 0.16);
}
[data-mode="dark"][data-skin="orbit"] {
  --rail-c: #2e7d32; --shell-bg: rgb(22 31 19 / 0.7); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); --art-a: #233a17; --art-b: #161f13;
  --color-bg: #0e140c; --color-surface: #161f13; --color-surface-2: #1f2b1b;
  --color-text: #eef5ea; --color-text-muted: #b3c2ad;
  --color-border: #2b3a26; --color-border-strong: #56704e;
  --color-primary: #9ccc65; --color-primary-hover: #c5e1a5; --color-on-primary: #10200a;
  --color-primary-soft: #233a17; --color-on-primary-soft: #dcedc8;
  --color-accent: #ff8a80; --color-on-accent: #2a0605;
  --glow: rgb(139 195 74 / 0.22);
  --hero-from: #1d3014; --hero-to: #121a10;
  --page-bg: radial-gradient(900px 520px at 100% -10%, rgb(139 195 74 / 0.16) 0, transparent 60%);
}

/* =================== P.SHOP · ม่วงอินดิโก พื้นลาเวนเดอร์ การ์ดขาว =================== */
[data-skin="pshop"] {
  --rail-c: #5b45e6; --shell-bg: #f6f5fd; --shell-shadow: 0 30px 80px -30px rgb(80 60 180 / 0.35); --art-a: #ece8ff; --art-b: #d9d2ff;
  --font-heading: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --color-bg: #eceaf8; --color-surface: #ffffff; --color-surface-2: #f7f6fd;
  --color-text: #14121f; --color-text-muted: #55516d;
  --color-border: #e6e3f5; --color-border-strong: #a29dc4;
  --color-primary: #6a45f2; --color-primary-hover: #5534d6; --color-on-primary: #ffffff;
  --color-primary-soft: #ece8ff; --color-on-primary-soft: #3d2a99;
  --color-accent: #6a45f2; --color-on-accent: #ffffff;
  --glow: rgb(106 69 242 / 0.30);
  --hero-from: #ece8ff; --hero-to: #d9d2ff;
  --page-bg: radial-gradient(900px 500px at 15% -10%, rgb(217 210 255 / 0.55), transparent);
  --btn-grad: linear-gradient(135deg, #8a63ff, #6a45f2);
  --card-radius: 20px;
  --card-sh-tint: rgb(70 50 170 / 0.18);
}
[data-mode="dark"][data-skin="pshop"] {
  --rail-c: #5b45e6; --shell-bg: rgb(24 21 48 / 0.7); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); --art-a: #2a2160; --art-b: #181530;
  --color-bg: #0f0d1c; --color-surface: #181530; --color-surface-2: #221e40;
  --color-text: #eeebff; --color-text-muted: #b8b2dc;
  --color-border: #2f2a55; --color-border-strong: #5b5490;
  --color-primary: #a993ff; --color-primary-hover: #c7b8ff; --color-on-primary: #150b3d;
  --color-primary-soft: #2a2160; --color-on-primary-soft: #ece8ff;
  --color-accent: #a993ff; --color-on-accent: #150b3d;
  --glow: rgb(138 99 255 / 0.28);
  --hero-from: #241c52; --hero-to: #141126;
  --page-bg: radial-gradient(900px 500px at 15% -10%, rgb(138 99 255 / 0.20), transparent);
  --btn-grad: linear-gradient(135deg, #c7b8ff, #a993ff);
}

/* =================== Clay · ม่วงพาสเทลนุ่ม มุมโค้ง เงานูน =================== */
[data-skin="clay"] {
  --rail-c: #5b45e6; --shell-bg: rgb(255 255 255 / 0.45); --shell-shadow: 0 30px 80px -30px rgb(80 60 180 / 0.35); --art-a: #ffe3f3; --art-b: #d4c5ff;
  --font-heading: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans Thai", system-ui, sans-serif;
  --color-bg: #d9ccf7; --color-surface: #ffffff; --color-surface-2: #f1ecff;
  --color-text: #2b2150; --color-text-muted: #54488a;
  --color-border: #e6dffa; --color-border-strong: #a596d6;
  --color-primary: #5b38d4; --color-primary-hover: #4a2bb8; --color-on-primary: #ffffff;
  --color-primary-soft: #ece4ff; --color-on-primary-soft: #3b2590;
  --color-accent: #d6335a; --color-on-accent: #ffffff;
  --glow: rgb(106 71 224 / 0.32);
  --hero-from: #ffe3f3; --hero-to: #d4c5ff;
  --page-bg: radial-gradient(50% 40% at 0% 0%, #e6dcff 0, transparent 70%), radial-gradient(50% 40% at 100% 100%, #f7d9f0 0, transparent 70%), linear-gradient(160deg, #d9ccf7, #c9bdf0);
  --btn-grad: linear-gradient(180deg, #8a6bf5, #5b38d4);
  --card-radius: 26px;
  --card-ring: inset 0 2px 0 #ffffff;
  --card-sh-tint: rgb(110 80 220 / 0.18);
}
[data-mode="dark"][data-skin="clay"] {
  --rail-c: #5b45e6; --shell-bg: rgb(34 26 66 / 0.6); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); --art-a: #3a2463; --art-b: #221a42;
  --color-bg: #17112e; --color-surface: #221a42; --color-surface-2: #2d2454;
  --color-text: #f1ecff; --color-text-muted: #c4b9ec;
  --color-border: #3a3068; --color-border-strong: #6c5fa8;
  --color-primary: #b6a0ff; --color-primary-hover: #d3c6ff; --color-on-primary: #1a0c4d;
  --color-primary-soft: #34296b; --color-on-primary-soft: #ece4ff;
  --color-accent: #ff8fb0; --color-on-accent: #3a0617;
  --glow: rgb(157 128 255 / 0.28);
  --hero-from: #3a2463; --hero-to: #1c1538;
  --page-bg: radial-gradient(50% 40% at 0% 0%, rgb(157 128 255 / 0.20) 0, transparent 70%), radial-gradient(50% 40% at 100% 100%, rgb(255 143 198 / 0.12) 0, transparent 70%);
  --btn-grad: linear-gradient(180deg, #d3c6ff, #b6a0ff);
  --card-ring: inset 0 1px 0 rgb(255 255 255 / 0.10);
}

/* =================== Cyber HUD · ขาว/ดำ/แดง พื้นดำนุ่ม (เปิดโหมดมืดก่อน) =================== */
[data-skin="cyber"] {
  --rail-c: #c4121f; --shell-bg: rgb(255 255 255 / 0.7); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.25); --art-a: #fde3e5; --art-b: #ececf0;
  --font-heading: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --color-bg: #f4f4f6; --color-surface: #ffffff; --color-surface-2: #ececf0;
  --color-text: #111114; --color-text-muted: #4a4a55;
  --color-border: #dcdce2; --color-border-strong: #9a9aa6;
  --color-primary: #c4121f; --color-primary-hover: #9b0e18; --color-on-primary: #ffffff;
  --color-primary-soft: #fde3e5; --color-on-primary-soft: #7a0f18;
  --color-accent: #c4121f; --color-on-accent: #ffffff;
  --glow: rgb(225 29 46 / 0.22);
  --hero-from: #fde3e5; --hero-to: #ffffff;
  --page-bg: radial-gradient(900px 600px at 8% -10%, rgb(225 29 46 / 0.12), transparent 60%);
  --btn-grad: linear-gradient(135deg, #d91e2c, #a50f1a);
  --card-ring: 0 0 0 1px rgb(17 17 20 / 0.08);
}
[data-mode="dark"][data-skin="cyber"] {
  --rail-c: #c4121f; --shell-bg: rgb(21 21 24 / 0.62); --shell-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.85), 0 0 0 1px rgb(255 255 255 / 0.08); --art-a: #2b0d11; --art-b: #212126;
  --color-bg: #0b0b0d; --color-surface: #151518; --color-surface-2: #212126;
  --color-text: #ffffff; --color-text-muted: #c2c2cc;
  --color-border: #2e2e35; --color-border-strong: #5a5a66;
  /* Red tuned for dark: 5.6:1 as text on surface, 6.0:1 with near-black text on it */
  --color-primary: #ff4d5a; --color-primary-hover: #ff7a84; --color-on-primary: #0b0b0d;
  --color-primary-soft: #3a1016; --color-on-primary-soft: #ffd6da;
  --color-accent: #ff4d5a; --color-on-accent: #0b0b0d;
  --glow: rgb(225 29 46 / 0.35);
  --hero-from: #2b0d11; --hero-to: #151518;
  --page-bg: radial-gradient(900px 600px at 8% -10%, rgb(225 29 46 / 0.28), transparent 60%), radial-gradient(800px 600px at 100% 100%, rgb(255 255 255 / 0.06), transparent 60%), linear-gradient(160deg, #17171b, #0b0b0d 70%);
  --btn-grad: linear-gradient(135deg, #ff5a66, #f0303f);
  --card-ring: 0 0 0 1px rgb(255 255 255 / 0.10);
  --card-sh-tint: rgb(0 0 0 / 0.55);
}

/* =================== Components that read the skin knobs =================== */
[data-skin="mint"] .store, [data-skin="orbit"] .store, [data-skin="pshop"] .store,
[data-skin="clay"] .store, [data-skin="cyber"] .store {
  background: var(--page-bg), var(--color-bg);
  background-attachment: fixed;
}
:is([data-skin="mint"], [data-skin="orbit"], [data-skin="pshop"], [data-skin="clay"], [data-skin="cyber"]) .store {
  --card-sh: var(--card-sh-tint, rgb(15 23 42 / 0.16));
}

/* Primary buttons pick up the skin gradient (solid colour stays as the fallback) */
:is([data-skin="pshop"], [data-skin="clay"], [data-skin="cyber"]) .store :is(.btn-primary, .add-btn) {
  background-image: var(--btn-grad);
}
:is([data-skin="pshop"], [data-skin="clay"], [data-skin="cyber"]) .store :is(.btn-primary, .add-btn):hover {
  background-image: none;
}

/* Product cards: radius + outer ring per skin */
:is([data-skin="mint"], [data-skin="orbit"], [data-skin="pshop"], [data-skin="clay"], [data-skin="cyber"]) .store :is(.pcard, .mini-card) {
  border-radius: var(--card-radius);
  box-shadow: var(--card-ring), inset 0 1px 0 var(--card-hi), 0 18px 36px -16px var(--card-sh);
}
[data-skin="mint"] .store .pcard, [data-skin="clay"] .store .pcard { border-color: transparent; }
[data-skin="pshop"] .store .pcard { border-color: var(--color-border); }
/* The orange key-light sheen belongs to Ember: light skins get a softer tint */
:is([data-skin="mint"], [data-skin="orbit"], [data-skin="pshop"], [data-skin="clay"]) .store .pcard::before { opacity: 0.55; }

/* Orbit: round product image floating in the middle of the card, centred text, red price */
[data-skin="orbit"] .store .pcard .pcard-media {
  width: min(78%, 180px); margin: var(--sp-2) auto 0; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--color-surface-2), var(--color-primary-soft) 70%);
  box-shadow: 0 14px 26px -10px var(--card-sh), 0 0 0 5px var(--color-surface);
}
[data-skin="orbit"] .store .pcard .pcard-floor { display: none; }
[data-skin="orbit"] .store .pcard-title { text-align: center; }
[data-skin="orbit"] .store .pcard-meta { justify-content: center; }
[data-skin="orbit"] .store .pcard-price .price { color: var(--color-accent); }
[data-mode="dark"][data-skin="orbit"] .store .pcard-price .price { color: var(--color-text); }
[data-skin="orbit"] .store .pcard-badge { top: var(--sp-3); }

/* Clay: puffy cards and a softer, rounder hero */
[data-skin="clay"] .store .promo, [data-skin="clay"] .store .rent-checkout { border-radius: 34px; }
[data-skin="clay"] .store .add-btn { border-radius: 16px; }

/* Cyber: hover glows red, prices stay white/black for legibility */
[data-skin="cyber"] .store .pcard:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 35%, transparent), 0 26px 50px -16px var(--card-sh), 0 0 40px var(--glow);
}
[data-skin="cyber"] .store .pcard-price .price { color: var(--color-text); }

/* Mobile cards keep the balanced proportions from store.css; Orbit's round image shrinks with them */
@media (max-width: 639px) {
  [data-skin="orbit"] .store .pcard .pcard-media { width: 72%; aspect-ratio: 1; margin-top: var(--sp-2); }
}
