:root {
  --navy: #120c3a;
  --navy-2: #1d1452;
  --lavender: #f1ecfb;
  --lavender-2: #e6dcf8;
  --ink: #16204a;
  --muted: #5f6684;
  --magenta: #c4148e;
  --purple: #7b1fd1;
  --accent-grad: linear-gradient(135deg, #8a1fe0 0%, #c4148e 100%);
  --card: #ffffff;
  --line: #e3e0ef;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22,32,74,.05), 0 6px 18px -10px rgba(22,32,74,.18);
  --accent: #a3157c;
  --accent-dark: #86106a;
  --font-head: "Noto Sans Thai", "IBM Plex Sans Thai", sans-serif;
  --font-body: "Noto Sans Thai", "IBM Plex Sans Thai", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.vj-body, .vj-root {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, #3b2341 0px, #6b4a86 60px, #a583c9 130px, #d5c3ec 200px, var(--lavender) 260px) no-repeat;
  background-color: var(--lavender);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}
.vj-root a { color: inherit; }
.vj-root button { font-family: inherit; }
.vj-root :focus-visible { outline: 3px solid #f2a3ff; outline-offset: 2px; border-radius: 8px; }
.vj-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.vj-header { background: var(--navy); }
.vj-header-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vj-tat { background: #fff; border-radius: 14px; padding: 6px 12px; display: flex; align-items: center; flex-shrink: 0; }
.vj-tat img { height: 46px; width: auto; display: block; }
.vj-pill { background: var(--accent-grad); color: #fff; font-family: var(--font-head); font-weight: 600; padding: 9px 18px; border-radius: 999px; font-size: 15px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }

/* Hero */
.vj-hero { background: transparent; line-height: 0; }
.vj-hero-img { display: block; width: 100%; height: auto; object-fit: cover; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0,0,0,.55) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0,0,0,.55) 82%, transparent 100%); }
@media (min-width: 768px) {
  body.vj-body, .vj-root { background: linear-gradient(180deg, #3b2341 0px, #5d3a72 110px, #8a63a8 230px, #b99ad4 340px, #dccdf0 430px, var(--lavender) 520px) no-repeat; background-color: var(--lavender); }
  .vj-hero-img { max-height: 440px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.5) 78%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.5) 78%, transparent 100%); }
}

/* Mobile-first reading and navigation */
.vj-main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 32px; }
.vj-intro { margin-bottom: 22px; }
.vj-title { font-family: var(--font-head); font-weight: 600; color: var(--ink); font-size: 24px; line-height: 1.5; margin: 0; text-wrap: balance; }
.vj-sub { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.vj-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 24px; padding: 5px; border: 1px solid #ddd3ee; border-radius: 999px; background: rgba(255,255,255,.72); box-shadow: 0 2px 10px -4px rgba(22,32,74,.12); backdrop-filter: blur(4px); }
.vj-tab { display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; min-height: 46px; padding: 8px 4px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--font-head); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .18s, color .18s, box-shadow .18s; }
.vj-tab svg { flex-shrink: 0; }
.vj-tab:hover { color: var(--ink); background: rgba(255,255,255,.85); }
.vj-tab[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px -2px rgba(22,32,74,.22), inset 0 0 0 1px #e2d8f2; }
.vj-results { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; margin-bottom: 16px; }
.vj-results h2 { margin: 0; font-size: 18px; font-weight: 500; min-width: 0; }
.vj-count { color: var(--muted); font-size: 13px; margin: 0; }
.vj-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 640px) {
  .vj-main { padding: 32px 24px 40px; }
  .vj-title { font-size: 28px; }
  .vj-sub { font-size: 15px; }
  .vj-tabs { max-width: 480px; }
  .vj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (min-width: 1100px) { .vj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.vj-card { background: var(--card); border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.vj-card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; width: 100%; height: auto; background: #eef0f6; flex-shrink: 0; }
.vj-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vj-card-media img.vj-contain, .vj-detail-media img.vj-contain { object-fit: contain; background: #eef0f6; }
.vj-detail-media { background: #eef0f6; }
.vj-logo { position: absolute; top: 10px; right: 10px; width: 76px; height: 44px; border-radius: 8px; background: #fff; padding: 5px 7px; box-shadow: 0 1px 4px rgba(22,32,74,.22); display: flex; align-items: center; justify-content: center; z-index: 2; }
.vj-card-media .vj-logo img, .vj-detail-media .vj-logo img { width: 100%; height: 100%; object-fit: contain; background: none; display: block; }
.vj-detail-media .vj-logo { width: 96px; height: 54px; padding: 6px 9px; top: 14px; right: 14px; border-radius: 10px; }
@media (max-width: 640px) { .vj-logo, .vj-detail-media .vj-logo { width: 68px; height: 40px; padding: 4px 6px; top: 10px; right: 10px; } }
.vj-typo { position: absolute; inset: 0; background: var(--navy) center 35%/cover no-repeat; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 14px 16px; color: #fff; }
.vj-typo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,12,58,.25), rgba(18,12,58,.88)); }
.vj-typo > * { position: relative; overflow-wrap: anywhere; }
.vj-typo-name { font-weight: 600; font-size: 20px; line-height: 1.35; }
.vj-typo-cat { font-size: 13px; opacity: .85; }
.vj-badge { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 100px); background: rgba(255,255,255,.95); color: var(--ink); font-weight: 500; font-size: 13px; line-height: 1.4; padding: 3px 10px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center; }
.vj-card-body { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.vj-card-name { font-weight: 500; font-size: 16px; margin: 0; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.vj-card-offer { font-weight: 600; font-size: 19px; line-height: 1.45; margin: 0; color: var(--accent); }
.vj-note { font-size: 13px; color: var(--muted); margin: 0; }
.vj-code { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 40px; }
.vj-code.is-open { background: #f6f4fb; border: 1px dashed #d7cfe8; border-radius: 10px; padding: 4px 4px 4px 12px; }
.vj-reveal { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 20px; min-height: 44px; justify-content: center; padding: 10px 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.vj-reveal:hover { background: #fbf2f8; }
.vj-code-label { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.vj-code-val { font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vj-copy { border: 1px solid var(--line); background: #fff; color: var(--accent); border-radius: 20px; min-height: 44px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; flex-shrink: 0; }
.vj-copy:hover { background: #fbf2f8; }
.vj-card-foot { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.vj-card-foot .vj-btn { justify-content: center; width: 100%; }
.vj-date { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.vj-btn { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: #fff !important; text-decoration: none; border: 0; border-radius: 20px; min-height: 44px; justify-content: center; padding: 10px 16px; font-weight: 500; font-size: 14px; cursor: pointer; }
.vj-btn:hover { background: var(--accent-dark); }
.vj-btn-ghost { background: #fff; color: var(--accent) !important; border: 1px solid var(--line); }
.vj-btn-ghost:hover { background: #fbf2f8; }

/* Detail */
.vj-detail { max-width: 860px; margin: 0 auto; }
.vj-back { margin-bottom: 16px; }
.vj-detail-card { background: #fff; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.vj-detail-media { aspect-ratio: 16 / 9; width: 100%; overflow: hidden; position: relative; }
.vj-detail-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vj-detail-body { padding: 20px 16px 28px; }
@media (min-width: 640px) { .vj-detail-body { padding: 28px 32px 36px; } }
.vj-detail h1 { font-weight: 600; font-size: 28px; margin: 0 0 4px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.vj-company { color: var(--muted); margin: 0 0 14px; }
.vj-detail h2 { font-weight: 600; font-size: 18px; color: var(--ink); margin: 26px 0 8px; line-height: 1.5; }
.vj-offer-list, .vj-terms { margin: 0; padding-left: 20px; }
.vj-terms { list-style: none; padding-left: 0; }
.vj-terms strong { font-weight: 600; color: var(--ink); }
.vj-offer-list li, .vj-terms li { margin: 4px 0; overflow-wrap: anywhere; }
.vj-offer-list { list-style: none; padding: 14px 16px; background: #f6f4fb; border-radius: 12px; }
.vj-dates { display: grid; gap: 8px; }
.vj-dates div { background: #f6f4fb; border-radius: 10px; padding: 10px 14px; }
.vj-dates strong { font-weight: 500; color: var(--ink); }
.vj-contacts { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
.vj-contact { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.vj-contact-k { font-size: 13px; color: var(--muted); }
.vj-contact-v { font-weight: 500; overflow-wrap: anywhere; }
.vj-contact .vj-btn, .vj-contact .vj-copy { align-self: flex-start; }
.vj-howto { color: var(--muted); margin: 8px 0 0; }
.vj-warn { margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: #f6f4fb; border: 1px solid var(--line); color: var(--ink); font-size: 14px; }

/* Footer */
.vj-footer { text-align: center; padding: 10px 20px 36px; color: var(--muted); font-size: 13px; }
.vj-footer-main { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink); font-weight: 500; font-size: 15px; margin-bottom: 8px; }
.vj-footer-main::before, .vj-footer-main::after { content: ""; height: 1px; width: 24px; flex-shrink: 0; background: var(--muted); opacity: .5; }
.vj-footer p { margin: 4px 0; }
.vj-dl { color: var(--muted); font-size: 12px; opacity: .8; }

/* Toast */
.vj-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; transition: all .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; pointer-events: none; }
.vj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) { .vj-title { font-size: 24px; } .vj-detail h1 { font-size: 24px; } .vj-card-offer { font-size: 18px; } }
