/* global React */
// ------------------------------------------------------------------
// Kshop Cambodia — single SKU, two pack variants.
// Prices in USD primary / KHR secondary. 1 USD ≈ 4,100 KHR, rounded to
// the nearest 500 ៛ for in-store feel (same rounding as ABA / Wing).
// ------------------------------------------------------------------

const KHR_PER_USD = 4100;

// Pretty-format KHR with ៛ symbol and thousands separator, rounded to nearest 500.
function khr(usd) {
  const raw = Math.round((usd * KHR_PER_USD) / 500) * 500;
  return "៛" + raw.toLocaleString("en-US");
}
// Full dual-currency string, e.g. "$12 / ៛49,000"
function priceDual(usd) {
  return `$${usd} / ${khr(usd)}`;
}
function usdOnly(usd) { return `$${usd}`; }

// ------------------------------------------------------------------
// The product
// ------------------------------------------------------------------
const PRODUCT = {
  id: "kshop-termite-powder",
  sku: "KS-01",
  // Name: Khmer primary, English secondary
  nameKh: "ថ្នាំសម្លាប់កណ្ដៀរ",
  name: "Termite Powder",
  subname: "KSHOP24.NET លេខ ០១",
  taglineKh: "ថ្នាំម្សៅឆ្លងកាត់សម្លាប់កណ្ដៀរទាំងសំបុក",
  tagline: "Transfer-kill dust for subterranean + drywood termites",
  blurbKh:
    "ម្សៅល្អិត ផ្ទុកសារធាតុ Fipronil ០.៥% ។ ផ្លុំចូលក្នុងរូងកណ្ដៀរ — កណ្ដៀរដើរលើវា កាន់ចូលទៅសំបុក និងសម្លាប់ក្រុមទាំងមូលក្នុងរយៈពេលប៉ុន្មានថ្ងៃ ។ គ្មានការពន្លិច គ្មានការបាញ់ថ្នាំ គ្មានការហៅជាងបាញ់ថ្នាំមកផ្ទះទេ ។",
  blurb:
    "A fine dust with 0.5% fipronil. Puff it into a gallery — termites walk through, carry it back to the colony, and the whole nest collapses within days. No tenting, no spray rigs, no pro call-out.",
  active: "Fipronil 0.5%",
  netWeight: "300 g / ដប (bottle)",
  toxicity: "Low toxicity",
  origin: "Imported from Guangdong · Repackaged in Phnom Penh",
  pack: [
    "ដប ៣០០ ក្រាម × 300 g powder bottle (pre-perforated cap)",
    "ឧបករណ៍ផ្លុំកៅស៊ូ × 1 rubber puffer applicator",
    "ទួរនាវីស × 1 slotted screwdriver (to open galleries)",
  ],
  sizes: [
    {
      id: "single",
      labelKh: "ឈុតមួយដប",
      label: "Single Kit",
      descKh: "ដប ៣០០ក្រាម ១ដប · សម្រាប់រូងកណ្ដៀរ ៨ ទីតាំង",
      desc:  "One 300 g bottle · treats ~8 galleries",
      bottles: 1,
      priceUsd: 12,
      popular: true,
    },
    {
      id: "duo",
      labelKh: "ឈុតពីរដប",
      label: "Duo Kit",
      descKh: "ដប ៣០០ក្រាម ២ដប · សម្រាប់ផ្ទះពេញ ឬការតុបតែង",
      desc:  "Two 300 g bottles · whole-house or renovation use",
      bottles: 2,
      priceUsd: 20,
      save: "Save $4",
    },
  ],
  spec: [],
  badgeKh: "ផលិតផលសំខាន់",
  badge: "FLAGSHIP",
  images: [],
};

// Pre-compute derived strings
PRODUCT.sizes = PRODUCT.sizes.map(s => ({
  ...s,
  price: s.priceUsd,          // keep legacy `price` for components that read it
  priceDual: priceDual(s.priceUsd),
  priceKhr: khr(s.priceUsd),
}));

// ── Runtime config (overridable from Firestore) ──────────────────────────────

window.STORE_CONFIG = { shippingFreeThreshold: 75, shippingRate: 9 };
window.INVENTORY    = {};

function applyProductConfig(cfg) {
  if (!cfg) return;
  const { sizes: cfgSizes, images: cfgImages, ...rest } = cfg;
  Object.assign(PRODUCT, rest);
  if (Array.isArray(cfgSizes) && cfgSizes.length) {
    PRODUCT.sizes = cfgSizes.map(s => ({
      ...s,
      price:     s.priceUsd,
      priceDual: priceDual(s.priceUsd),
      priceKhr:  khr(s.priceUsd),
    }));
  }
  if (Array.isArray(cfgImages) && cfgImages.length) {
    PRODUCT.images = cfgImages;
    window.PRODUCT_SHOTS = cfgImages.map((src, i) => ({ src, c: `PRODUCT · IMAGE ${i + 1}` }));
  }
}

// ------------------------------------------------------------------
// Section headers — overridable from Firestore content/sections
// ------------------------------------------------------------------
const SECTION_HEADERS = {
  pillars: { eyebrow: "— ហេតុអ្វី KSHOP24.NET / WHY KSHOP24.NET", h2Kh: "មិនមែនថ្នាំបាញ់ធម្មតាទេ។", h2En: "Not another hardware-aisle spray." },
  product: { eyebrow: "— ផលិតផល · THE PRODUCT", h2Kh: "មួយដប។ មួយបញ្ហា។", h2En: "One bottle. One termite problem.",
             bodyKh: "យើងលក់តែមួយផលិតផលប៉ុណ្ណោះ — ម្សៅ Fipronil 0.5% ក្នុងដប ៣០០ក្រាម ។",
             bodyEn: "We sell one thing — Fipronil 0.5% termite dust in a 300 g bottle — and we do it well." },
  science: { eyebrow: "— វិធីដំណើរការ · HOW IT WORKS", h2Kh: "គីមីធម្មតា\nលទ្ធផលដ៏អស្ចារ្យ។", h2En: "Boring chemistry, dramatic results.",
             bodyKh: "កណ្ដៀរស៊ីបាយជាមួយគ្នា និងសម្អាតខ្លួនគ្នាទៅវិញទៅមក ។",
             bodyEn: "Termites share food mouth-to-mouth and groom each other constantly. Hand the colony a slow, non-repellent dose — they deliver it themselves." },
  reviews: { eyebrow: "— អ្នកប្រើប្រាស់ · THE PEOPLE", h2Kh: "អតិថិជនពិត មិនមែនការផ្សាយ។", h2En: "Real homeowners, not hype.", reviewsLine: "4.9 / 5 · VERIFIED BUYERS" },
  faq:     { eyebrow: "— សំណួរញឹកញាប់ · FREQUENTLY ASKED", h2Kh: "គ្រប់យ៉ាងមុនពេលទិញ។", h2En: "Everything before you buy." },
  cta:     { eyebrow: "— ត្រៀមរួចហើយ · READY WHEN YOU ARE", h2Kh: "ពេលអ្នករង់ចាំ\nវាស៊ីកាន់តែច្រើន។", h2En: "The longer you wait, the more they eat.", btnText: "បញ្ជាទិញឈុត · Order the kit" },
  footer:  { tagKh: "ថ្នាំសម្លាប់កណ្ដៀរជំនាញ ដឹកជញ្ជូនដល់ទ្វារផ្ទះអ្នក ។",
             tagEn: "Professional-grade termite defense, mailed to your door. Fipronil 0.5% dust, imported and repackaged in Phnom Penh.",
             copyright: "© 2026 KSHOP CAMBODIA · SKU KS-01 · 300G NET",
             shipLine: "IMPORTED FROM GUANGDONG · REPACKAGED PHNOM PENH · SHIPS NATIONWIDE",
             c0h: "SHOP / ទិញ",
             c0: "Single Kit · ឈុតមួយដប|#shop\nDuo Kit · ឈុតពីរដប|#shop",
             c1h: "HELP / ជំនួយ",
             c1: "Telegram @KshopKH|https://t.me/KshopKH\nFacebook /kshop.kh|https://facebook.com/kshop.kh\nសំណួរ · FAQ|#learn",
             c2h: "PICKUP / ហាង",
             c2: "Borey New World KM6 / បុរីពិភពថ្មីគីឡូម៉ែត្រលេខ៦ ផ្ទះលេខ៦៤ ផ្លូវលេខ១\nPhnom Penh · Everyday 7am–6pm\n070919265|tel:+85570919265" },
};

window.PDP_CONTENT = {
  trust: {
    item0kh: "ដឹកថ្ងៃនេះ បើបញ្ជាទិញមុន ២ ល្ងាច", item0t: "Ships today before 2 pm",
    item1kh: "ធានា ៣០ ថ្ងៃ ប្ដូរ ឬ សង",           item1t: "30-day money-back guarantee",
  },
  steps: {
    count: 4,
    s1kh: "គោះលើផ្ទៃ ហើយស្ដាប់ ។ ក្រៅពីសំឡេងទទេ សញ្ញាផ្សេងៗ: ឈើខ្មៅ · ឈើទន់ ឬប្រឡូក · ដងដី (蚁路) · ជាន់ទទេ ។ ឃើញមួយ — កណ្ដៀរនៅជិតហើយ ។",
    s1t: "Tap the surface and listen for a hollow sound. Other signs: wood that's darkened, softened, or bulging; visible mud tubes along walls; or floors that feel hollow underfoot. Any one of these means termites are nearby.",
    s2kh: "ប្រើទួរនាវីសដែលមានក្នុងឈុត ពោះបើករូងសកម្ម — ប្រេះតូចបន្តិចគ្រប់គ្រាន់ ដើម្បីបង្ហាញបែហោង ។",
    s2t: "Pry open the active area with the included slotted screwdriver — a small split is enough to expose the gallery.",
    s3kh: "ដាក់ចុងឧបករណ៍ផ្លុំចូលក្នុងរូង ហើយចុចម្ដង ។ ឃើញពពកម្សៅ — គ្រប់ដូស ។ បន្ទាប់មក បិទមាត់រូង ហើយគោះ — កណ្ដៀរនឹងស្ទិចស្ទើរ ហើយប្រចាំម្សៅចូលក្នុងក្រុម ។",
    s3t: "Insert the puffer tip and squeeze once — a dust cloud inside is a good dose. Then block the hole and tap the surface; disturbed termites spread the powder through the colony faster.",
    s4kh: "បិទរូងដោយស្កុត ឬថ្នាំបំពេញឈើ ។ ពិនិត្យឡើងវិញ ១ សប្ដាហ៍ — ផ្លុំម្ដងទៀតប្រសិនបើនៅតែឃើញសកម្ម ។ ម្សៅដែលនៅក្នុងរូងការពារបានច្រើនឆ្នាំ ។",
    s4t: "Seal the opening with tape or wood filler. Re-inspect at 7 days; re-treat if still active. Powder left undisturbed inside the gallery prevents reinfestation for years.",
  },
  overview: { count: 0 },
  safety: {
    count: 2,
    s1kh: "Fipronil ០.៥% មានពុលទាប សម្រាប់ថនិកសត្វ — ប៉ុន្តែម្សៅល្អិតណាក៏ដោយ គួរចៀសវាងពីសួត ។ ពាក់ស្រោមដៃ និងម៉ាស់ ពេលផ្លុំ ។ ដកកូនក្មេង និងសត្វចិញ្ចឹមចេញ ៣០ នាទី ។",
    s1t: "Fipronil is low-toxicity to mammals at 0.5%, but any fine dust belongs in lungs never — wear a disposable glove and a dust mask while puffing. Keep children and pets out of the room during application and for 30 minutes after, until airborne particles settle. Dust sealed inside a gallery is not accessible to anyone.",
    s2kh: "រក្សាទុកដបឱ្យត្រង ក្នុងកន្លែងដែលមិនមានខ្យល់ក្ដៅ ស្ងួត ក្រោម ៣០°C ។ អាយុកាល ២ ឆ្នាំ ។",
    s2t: "Store the bottle upright, sealed, below 30°C / 86°F, out of direct sunlight. Shelf life is two years from the manufacture date printed on the base of the bottle.",
  },
  spec: { count: 0 },
};

// Kick off the fetch as early as possible — firebase.jsx runs first so kDb is ready
window.kProductReady = window.kDb
  ? Promise.all([
      window.kDb.collection("config").doc("product").get(),
      window.kDb.collection("config").doc("store").get(),
      window.kDb.collection("config").doc("inventory").get(),
      window.kDb.collection("content").doc("faq").get(),
      window.kDb.collection("content").doc("pillars").get(),
      window.kDb.collection("content").doc("steps").get(),
      window.kDb.collection("content").doc("reviews").get(),
      window.kDb.collection("content").doc("photos").get(),
      window.kDb.collection("content").doc("hero").get(),
      window.kDb.collection("content").doc("sections").get(),
      window.kDb.collection("content").doc("pdp").get(),
      window.kDb.collection("content").doc("ticker").get(),
    ]).then(([pdoc, sdoc, idoc, fdoc, plrdoc, stpdoc, revdoc, photodoc, herodoc, sectionsdoc, pdpdoc, tickerdoc]) => {
      if (pdoc.exists) applyProductConfig(pdoc.data());
      if (sdoc.exists) Object.assign(window.STORE_CONFIG, sdoc.data());
      if (idoc.exists) Object.assign(window.INVENTORY, idoc.data());
      if (fdoc.exists && Array.isArray(fdoc.data().items)) window.FAQ = fdoc.data().items;
      if (plrdoc.exists && Array.isArray(plrdoc.data().items)) window.PILLARS = plrdoc.data().items;
      if (stpdoc.exists && Array.isArray(stpdoc.data().items)) window.STEPS = stpdoc.data().items;
      if (revdoc.exists && Array.isArray(revdoc.data().items)) window.REVIEWS = revdoc.data().items;
      if (photodoc.exists) {
        const pd = photodoc.data();
        Object.assign(PROBLEM_SHOTS, pd);
        if (Array.isArray(pd.gallery) && pd.gallery.length) {
          PRODUCT_SHOTS.splice(0, PRODUCT_SHOTS.length, ...pd.gallery.map((src, i) => ({ src, c: `PRODUCT · IMAGE ${i + 1}` })));
        } else {
          PRODUCT_SHOTS.forEach((shot, i) => { if (pd[`pdpShot${i}`]) shot.src = pd[`pdpShot${i}`]; });
        }
      }
      if (herodoc.exists) Object.assign(HERO_TEXT, herodoc.data());
      if (sectionsdoc.exists) Object.assign(SECTION_HEADERS, sectionsdoc.data());
      if (pdpdoc.exists) {
        const d = pdpdoc.data();
        ["overview", "safety", "trust", "steps", "spec"].forEach(k => { if (d[k]) Object.assign(window.PDP_CONTENT[k], d[k]); });
        if (d.blurb) { if (d.blurb.blurbKh) PRODUCT.blurbKh = d.blurb.blurbKh; if (d.blurb.blurb) PRODUCT.blurb = d.blurb.blurb; }
        if (d.header) { ["badge","nameKh","name"].forEach(f => { if (d.header[f] !== undefined) PRODUCT[f] = d.header[f]; }); }
        if (d.pack && d.pack.items) PRODUCT.pack = d.pack.items.split("\n").filter(Boolean);
      }
      if (tickerdoc.exists && Array.isArray(tickerdoc.data().items)) window.TICKER_ITEMS = tickerdoc.data().items;
    }).catch(() => {})
  : Promise.resolve();

const PRODUCT_SHOTS = [
  { src: "uploads/termite-hero-1.jpeg",    c: "BOTTLE + TOOLKIT · IN USE" },
  { src: "uploads/termite-detail-1.jpeg",  c: "STUDIO · BOTTLE + TOOLS"   },
  { src: "uploads/termite-hero-2.jpeg",    c: "DUO KIT · TWO BOTTLES"     },
  { src: "uploads/termite-detail-3.jpeg",  c: "DAMAGE GUIDE · SURVEY"     },
  { src: "uploads/termite-detail-5.jpeg",  c: "STEP 02 · PUFF INTO GALLERY" },
];

const PROBLEM_SHOTS = {
  hero:           "uploads/termite-hero-1.jpeg",
  damage:         "uploads/termite-detail-3.jpeg",
  apply:          "uploads/termite-detail-5.jpeg",
  productSlab:    "uploads/termite-detail-1.jpeg",
  science:        "uploads/termite-detail-5.jpeg",
  pdpTabOverview: "uploads/termite-hero-2.jpeg",
  pdpTabHow:      "uploads/termite-detail-5.jpeg",
  pdpTabSafety:   "uploads/termite-detail-1.jpeg",
};

// ------------------------------------------------------------------
// Pillars — "Why Kshop" value prop cards
// ------------------------------------------------------------------
const PILLARS = [
  {
    i: "shield",
    tKh: "សារធាតុកម្រិតជំនាញ", t: "Pro-grade active",
    dKh: "Fipronil ០.៥% — សារធាតុប្រឆាំងសត្វល្អិតដដែលដែលអ្នកបាញ់ថ្នាំជំនាញក្នុងកម្ពុជាប្រើ ។",
    d: "Fipronil 0.5% — the same non-repellent nerve agent licensed pest pros in Phnom Penh reach for.",
  },
  {
    i: "beaker",
    tKh: "សម្លាប់ទាំងសំបុក", t: "Transfer-kill by design",
    dKh: "កណ្ដៀរមួយយកម្សៅទៅសំបុក ឆ្លងដល់មួយរយក្បាល ។",
    d: "One treated termite grooms the dust onto dozens of nestmates. The colony collapses itself.",
  },
  {
    i: "leaf",
    tKh: "គ្មានការពន្លិច", t: "No tenting, no mess",
    dKh: "ផ្លុំម្សៅបន្តិចបន្តួចទៅក្នុងរូង រួចបិទវិញ។ មិនទាមទារឲ្យចាកចេញពីផ្ទះ ។",
    d: "Puff a pinch of powder into a gallery, seal the opening. No need to evacuate the house for three days.",
  },
  {
    i: "truck",
    tKh: "ដឹកជញ្ជូនភ្លាមៗ", t: "Same-day delivery",
    dKh: "ក្នុងភ្នំពេញ — ម៉ូតូដឹកភ្លាមៗ ។ ខេត្តផ្សេង — J&T · Kerry ។ ទូទាត់ ABA · Wing · COD ។",
    d: "Phnom Penh — same-day moto. Provinces — J&T or Kerry. Pay with ABA, Wing, KHQR, or cash on delivery.",
  },
];

// ------------------------------------------------------------------
// Steps — How it works
// ------------------------------------------------------------------
const STEPS = [
  { n: "01", tKh: "រកមើល",   t: "Find",
    dKh: "គោះក្រុមឈើ ផ្ទៃផ្ទះ និងទ្វារ — ប្រសិនបើសំឡេងទទេ រូងកណ្ដៀរនៅទីនោះ ។",
    d: "Tap baseboards, door frames, and floors. A hollow sound means they're eating inside.",
    meta: "~20 MIN SEARCH" },
  { n: "02", tKh: "បើក",     t: "Open",
    dKh: "ប្រើទួរនាវីសដែលមានក្នុងឈុត ចង្អូរបើករូងដែលសកម្ម ។",
    d: "Pry open the active spot with the slotted screwdriver. A small split exposes the gallery.",
    meta: "~2 MIN / GALLERY" },
  { n: "03", tKh: "ផ្លុំម្សៅ", t: "Puff",
    dKh: "ចុចកៅស៊ូផ្លុំម្សៅចូលក្នុងរូង ១ ដង ។ មើលឃើញពពកម្សៅក្នុងរូង — គ្រប់គ្រាន់ ។",
    d: "Squeeze the bulb once — a visible cloud of dust inside the cavity is a good dose.",
    meta: "~1 TSP / GALLERY" },
  { n: "04", tKh: "រង់ចាំ",  t: "Wait",
    dKh: "កណ្ដៀរយកម្សៅចូលសំបុក ។ សំបុករលាយក្នុង ៥–១៤ ថ្ងៃ ។",
    d: "Workers groom the dust onto nestmates. Colony collapses in 5–14 days.",
    meta: "TYPICAL · 7 DAYS" },
];

// ------------------------------------------------------------------
// Hero copy — overridable from Firestore content/hero
// ------------------------------------------------------------------
const HERO_TEXT = {
  h1Kh:        "ក្រុមមួយ ស៊ីឈើ",
  h1AccentKh:  "ពេលអ្នកគេង",
  subEn:       "By the time you see the damage, they've been eating for 2 years.",
  bodyKh:      "ក្រុម Coptotermes មួយ ស៊ីឈើ ១ ផោន ក្នុងមួយថ្ងៃ — ស្ងៀម ស្ងាត់ ។ ពេលអ្នកស្ដាប់ឮ​សំឡេងទទេ ឬ ឃើញឈើខ្មៅ — ការខូចខាតបានធ្ងន់ ២–៣ ឆ្នាំ ហើយ ។ ការជួសជុល ចំណាយ ជាមធ្យម $៣,០០០ ។",
  bodyEn:      "A single Coptotermes colony eats a pound of wood every day — silently, inside your walls. By the time you hear the hollow knock, they've typically been active for 2–3 years. Average repair bill: $3,000. KSHOP24.NET's fipronil dust collapses the colony in 5–14 days — starting at $12.",
  reviewsText: "4.9 / 5 · 1,284 VERIFIED REVIEWS",
};

// ------------------------------------------------------------------
// Reviews — Cambodian buyers, bilingual quotes
// ------------------------------------------------------------------
const REVIEWS = [
  {
    name: "Sokha L.", city: "ភ្នំពេញ · Phnom Penh", rating: 5,
    titleKh: "សំបុកបាត់ក្នុងពេល ៩ ថ្ងៃ។",
    title: "Colony gone in nine days.",
    body: "I found a gallery behind the pantry in my Boeung Keng Kang villa. I pried it open with the included screwdriver, puffed about one teaspoon of powder, taped it back. By day nine the wood was quiet — just dry, dead workers inside.",
    size: "Single Kit",
  },
  {
    name: "Dara P.", city: "សៀមរាប · Siem Reap", rating: 5,
    titleKh: "ពិតជាឆ្លងកាត់មែន។",
    title: "The transfer-kill is real.",
    body: "I only dusted two obvious spots in my old wooden house near Wat Bo. Three weeks later, my contractor found dead soldiers in a ceiling beam sixteen feet away that I never touched. The workers did the spreading for me.",
    size: "Duo Kit",
  },
  {
    name: "Chantha N.", city: "បាត់ដំបង · Battambang", rating: 5,
    titleKh: "សន្សំ $៨០០ ពីជាងបាញ់ថ្នាំ។",
    title: "Saved $800 vs. the pro quote.",
    body: "A company in Phnom Penh wanted $800 USD to fumigate my guesthouse. I ordered two Duo Kits, treated every window frame over a weekend, and it's been dry for four months. I kept one bottle spare for flare-ups.",
    size: "Duo Kit",
  },
  {
    name: "Vuth T.", city: "ព្រះសីហនុ · Sihanoukville", rating: 5,
    titleKh: "ឧបករណ៍ផ្លុំប្រើស្រួលណាស់។",
    title: "The puffer is seriously good.",
    body: "I expected the rubber bulb to be a throwaway. It isn't — soft enough for a pinch into a hairline crack, firm enough to push dust 30 cm into a long beam gallery. Every tool in the kit earns its place.",
    size: "Single Kit",
  },
];

// ------------------------------------------------------------------
// FAQ — bilingual questions, English answers (matches audience lead)
// ------------------------------------------------------------------
const FAQ = [
  {
    qKh: "១០ ការពិតអំពីកណ្ដៀរនៅកម្ពុជា",
    q: "10 facts about termites in Cambodia",
    aKh: `១. ការបំផ្លិចបំផ្លាញដែលមើលមិនឃើញ៖ នៅពេលដែលអ្នកចាប់ផ្តើមមើលឃើញការខូចខាតជាក់ស្តែងដល់ទ្រព្យសម្បត្តិរបស់អ្នក សំបុកកណ្តៀរជាធម្មតាបានធ្វើសកម្មភាព និងស៊ីបំផ្លាញអស់រយៈពេល ២ ទៅ ៣ ឆ្នាំ មកហើយ។
២. កណ្តៀរហើរ (Swarmers)៖ ចន្លោះពីខែមីនា ដល់ខែមិថុនា ជារៀងរាល់ឆ្នាំ កណ្តៀរហើរបន្តពូជនឹងលេចចេញមកដើម្បីបង្កាត់ពូជ និងបង្កើតសំបុកថ្មី
។ ការឃើញកណ្តៀរហើរនៅក្នុងផ្ទះ គឺជាសញ្ញាបង្ហាញថាមានសំបុកនៅក្បែរនោះ
។
៣. អានុភាពបំផ្លាញដ៏ខ្លាំងក្លា៖ ប្រភពបានបញ្ជាក់ថា សូម្បីតែ**"ទំនប់ទឹកប្រវែងរាប់ពាន់ម៉ាយ"** ក៏អាចត្រូវបានបំផ្លាញទាំងស្រុងដោយសំបុកកណ្តៀរតែមួយដែរ
។
៤. ការស៊ីបំផ្លាញយ៉ាងស្ងៀមស្ងាត់៖ សំបុកកណ្តៀរធំមួយអាចស៊ីឈើប្រហែល ៤៥០ ក្រាម (១ ផោន) ជារៀងរាល់ថ្ងៃ ដោយស្ងាត់ៗពីខាងក្នុងជញ្ជាំងរបស់អ្នក។
៥. តំបន់គោលដៅ៖ កណ្តៀរច្រើនតែទាក់ទាញដោយឈើដែលនៅក្បែរប្រភពទឹកបំផុត
។ បន្ទាប់មកវានឹងរាលដាលដល់ទូខោអាវ ក្របបង្អួច កម្រាលឥដ្ឋ និងពិដាន
។
៦. ផ្លូវកណ្តៀរ (Mud Tubes)៖ កណ្តៀរដីសាងសង់ផ្លូវកណ្តៀរ (ផ្លូវរូងក្រោមដីធ្វើពីដី) នៅលើជញ្ជាំង ឬដើមឈើ ដើម្បីធ្វើដំណើរពីដីទៅកាន់ឈើដោយមិនឱ្យប៉ះពាល់នឹងពន្លឺ ឬខ្យល់
។
៧. សញ្ញាព្រមាន៖ សញ្ញាសម្គាល់សំខាន់ៗនៃការបំផ្លាញរួមមាន ឈើឡើងខ្មៅ, ផុយស្រួយ, ហើម ឬមានសំឡេងប្រហោងនៅពេលយើងគោះលើវា
។
៨. ហានិភ័យចំពោះឈើប្រភេទរឹង៖ ឈើប្រភេទរឹងរបស់កម្ពុជា ដូចជាឈើធ្នង់ និងឈើគ្រញូង ក៏មិនអាចជៀសផុតពីការបំផ្លាញបានដែរ ដោយសារប្រភេទកណ្តៀរ Cryptotermes ដែលស៊ីឈើពីខាងក្នុង។
៩. ការកម្ចាត់ចោលតាមរយៈការចម្លងបន្តគ្នា៖ ម្សៅ Fipronil 0.5% ដំណើរការតាមរយៈ**"ការចម្លងបន្តគ្នា"**
។ នៅពេលកណ្តៀរមួយប៉ះម្សៅ វានឹងនាំទៅដល់សំបុក បង្កជាប្រតិកម្មចម្លងសម្លាប់សំបុកទាំងមូល រួមទាំងមេកណ្តៀរផងដែរ
។
១០. ផលប៉ះពាល់សេដ្ឋកិច្ច៖ នៅអាស៊ីអាគ្នេយ៍ ការខូចខាតដោយសារកណ្តៀរត្រូវបានគេប៉ាន់ប្រមាណថាមានតម្លៃ ១,៥ ពាន់លានដុល្លារក្នុងមួយឆ្នាំ ដែលធ្វើឱ្យការការពារមានតម្លៃថោកជាងការជួសជុល។`,
    a: `1. Invisible Destruction: By the time you notice visible damage to your property, a termite colony has typically been active and feeding for 2 to 3 years.
2. Flying Termites (Swarmers): Between March and June each year, reproductive "flying termites" emerge to mate and establish new colonies
. Finding these swarmers inside is a strong indicator of a nearby nest
.
3. Massive Power: The sources emphasize the scale of their destructive capability, noting that even a "thousand-mile dike" can be completely destroyed by a single termite nest
.
4. Stealthy Consumption: A single large colony can silently eat approximately 450g (1 lb) of wood every day from inside your walls.
5. Target Areas: Termites are most attracted to wooden materials located near water sources, initially nesting there before spreading to cabinets, window frames, and ceilings
.
6. Mud Tubes: Subterranean termites build specialized mud tubes (mud tunnels) on walls or tree trunks to travel from the soil to their food source without being exposed to light or air
.
7. Warning Signs: Key indicators of an infestation include wood turning black, softening, bulging, or a hollow sound when tapped
.
8. Hardwood Risks: Cambodian hardwoods, such as teak and ironwood, are not immune; specific species like Cryptotermes are known to attack dry hardwood from the inside.
9. Contagious Eradication: Professional treatments often use 0.5% Fipronil powder, which works through "mutual infection"
. When one termite touches the powder, it carries it back to the nest, starting a chain reaction that kills the entire colony, including the queen
.
10. Economic Impact: In Southeast Asia, termite damage is estimated to cause $1.5 billion in costs annually, making prevention significantly cheaper than repairs.`,
  },
  {
    qKh: "តើថ្នាំនេះមានប្រសិទ្ធភាពលើសត្វប្រភេទណាខ្លះ?",
    q: "What species does this actually work on?",
    aKh: `ម្សៅកម្ចាត់សត្វល្អិតនេះត្រូវបានផលិតឡើងយ៉ាងពិសេសដើម្បីកម្ចាត់សត្វកណ្តៀរគ្រប់ប្រភេទ និងគ្រប់ទីកន្លែង៖

• កណ្តៀរគ្រប់ប្រភេទ (All Termite Species): ថ្នាំនេះមានប្រសិទ្ធភាពលើសត្វកណ្តៀរទូទៅ ដោយប្រើគោលការណ៍ "ចម្លងបន្តគ្នា" (Mutual Infection) ដែលធ្វើឱ្យវារាលដាលសម្លាប់ដល់សំបុកទាំងមូល ។

• កណ្តៀរក្នុងផ្ទះ (Indoor Termites): វាត្រូវបានប្រើសម្រាប់កម្ចាត់កណ្តៀរដែលស៊ីបំផ្លាញ ទូខោអាវ, ក្របបង្អួច, កម្រាលឥដ្ឋ, ពិដាន និងធ្នឹមផ្ទះ ។

• កណ្តៀរដី និងកណ្តៀរក្រៅផ្ទះ (Outdoor & Subterranean Termites): ថ្នាំនេះមានប្រសិទ្ធភាពលើកណ្តៀរដែលរស់នៅក្នុងដី តាមគល់ឈើ និងដើមឈើ ។

• កណ្តៀរហើរ (Flying Termites/Swarmers): វាប្រើសម្រាប់បង្ការ និងកម្ចាត់កណ្តៀរហើរដែលលេចឡើងនៅចន្លោះខែមីនា ដល់ខែមិថុនា ។

• ការការពារទ្រង់ទ្រាយធំ: វាក៏ត្រូវបានប្រើដើម្បីការពារទំនប់ទឹក និងសួនច្បារពីការបំផ្លាញរបស់សត្វកណ្តៀរផងដែរ ។`,
    a: `This insecticide powder is specifically designed for the professional eradication and prevention of termites in all their common forms and habitats.

• Indoor Termites: Effective against termites infesting wooden furniture, floorboards, cabinets, door frames, and structural beams. Targets termites hiding in dark, damp areas inside buildings.

• Outdoor & Subterranean Termites: Treats termites found in tree trunks, tree roots, and building foundations. Effective for protecting forests, gardens, dikes, and dams.

• Flying Termites (Swarmers): Use the powder around windows and furniture where reproductive termites attempt to build new nests — especially March to June.

• Broad Eradication: Active ingredient Fipronil 0.5% works through a contagious chain reaction — any termite that contacts the powder carries it back to the colony, spreading the kill to the entire nest regardless of species.`
  },
  {
    qKh: "ហេតុអ្វីបានជាប្រើម្សៅជាជាងថ្នាំបាញ់?",
    q: "Powder vs. spray — why powder?",
    aKh: "ថ្នាំបាញ់ ប្រែបន្ទាចកណ្ដៀរ ហើយជំរុញពួកវារករូងថ្មី ជៀសវាងតំបន់ដែលបាញ់ ។ ម្សៅស្ងួតជាប់នៅខ្លួនសត្វ ហើយត្រូវបានស្ជែងចែករំលែកទៅដល់មិត្ដ — ម្ចាស់ការម្នាក់ ឆ្លងបង់ ១០–៣០ ។ គឺជាឧបករណ៍ដែលអ្នកជំនាញសំលាប់សត្វល្អិតប្រើ នៅពេលគេរកឃើញរូងដ៏សកម្ម ។",
    a: "Sprays bead up on tropical humidity, repel termites, and push them to reroute around the treated zone. Dry powder clings to the insect's cuticle and gets groomed onto nestmates — one treated worker contaminates dozens. It's the tool professional exterminators reach for when they actually find an active gallery."
  },
  {
    qKh: "តើខ្ញុំត្រូវការប៉ុន្មានដប?",
    q: "How much do I need?",
    aKh: "ដបមួយ ៣០០ ក្រាម ព្យាបាលបានប្រហែល ៨ រូង ឬបំពង់ដី ។ ការឆ្លងក្នុងបន្ទប់តែមួយ ជាធម្មតាដោះស្រាយបានជាមួយ Single Kit ។ យក Duo Kit ប្រសិនបើអ្នកកំពុងការពារក្នុងអំឡុងពេលជួសជុល ដំណើរការផ្ទះស្នាក់នៅមានបន្ទប់ឈើច្រើន ឬចង់ទុកដបបម្រុងសម្រាប់ការឆ្លងនៅរដូវវស្សាបន្ទាប់ ។",
    a: "One 300 g bottle treats roughly 8 separate galleries or mud tubes at label dose. A single-room infestation is usually handled by the Single Kit. Take the Duo Kit if you're doing renovation prevention, running a guesthouse with multiple timber rooms, or want a spare bottle on hand for the next monsoon swarm."
  },
  {
    qKh: "តើវាមានសុវត្ថិភាពសម្រាប់កុមារ និងសត្វចិញ្ចឹមដែរឬទេ?",
    q: "Is it safe around kids and pets?",
    aKh: "Fipronil ០.៥% ត្រូវបានចាត់ថ្នាក់ជាពុលទាប — ប៉ុន្តែម្សៅល្អិតណាក៏ មិនគួរចូលក្នុងសួតឡើយ — ពាក់ស្រោមដៃ និងម៉ាស់ ។ រក្សាកូនក្មេង និងសត្វចិញ្ចឹម ចេញពីបន្ទប់ ក្នុងអំឡុងពេលប្រើ និង ៣០ នាទីក្រោយ ។ ម្សៅដែលបិទក្នុងរូង មិនអាចដល់នរណាម្នាក់ ។",
    a: "Fipronil at 0.5% is classified as low-toxicity for mammals, but any fine dust belongs in lungs never — wear a disposable glove and a dust mask. Keep children and pets out of the room during application and for 30 minutes after, until airborne particles settle. Dust sealed inside a gallery is not accessible to anyone."
  },
  {
    qKh: "តើឧបករណ៍ផ្លុំ និងទួរនាវីសប្រើសម្រាប់អ្វី?",
    q: "What do the screwdriver and rubber puffer do?",
    aKh: "កណ្ដៀរលាក់ខ្លួននៅពីក្រោយថ្នាំលាប ដំបូលឈើ និងក្ដារចរន្ត ។ ចុចលើផ្ទៃ ស្ដាប់ទីបង្ហាញចន្លោះទទេ បើកដោយប្រើទួរនាវីស ហើយប្រើឧបករណ៍ផ្លុំច្រានម្សៅចូលទៅក្នុងបែហោងធ្មែញ ។ ត្របកផ្លុំ ជំនួសឧបករណ៍ Bellows Duster ដែលអ្នកជំនាញប្រើ ។",
    a: "Termites hide behind paint, wood veneer, and thin baseboards. Tap the surface, listen for the hollow patch, pry it open with the slotted screwdriver, and use the rubber puffer to push a controlled cloud of dust into the cavity. The bulb replaces a pro's bellows duster."
  },
  {
    qKh: "តើពេលណាដែលវាមិនមានប្រសិទ្ធភាព?",
    q: "When won't it work?",
    aKh: "ប្រសិនបើអ្នករករូងសកម្មមិនឃើញ ។ ថ្នាំប្រភេទនេះជាម្សៅសម្រាប់គោលដៅ មិនមែនជាបង្ការជាប្រព័ន្ធ ។ ប្រសិនបើត្រូវការចរន្តដីឬការការពារខាងក្រៅ អ្នកត្រូវការថ្នាំរាវ ។ ផ្ញើរូបថតមកកាន់ Telegram @KshopKH ហើយយើងនឹងប្រាប់ដោយស្មោះត្រង់ ។",
    a: "If you can't find an active gallery. This is a targeted dust, not a prophylactic barrier. For pre-construction soil barriers or large outdoor perimeters you want a liquid termiticide. Send photos to our Telegram (@KshopKH) and we'll tell you honestly if this is the right tool before you buy."
  },
  {
    qKh: "របៀបបញ្ជាទិញ និងដឹកជញ្ជូន?",
    q: "How do I order and get it delivered?",
    aKh: "លឿនបំផុត: ផ្ញើសារមក Telegram @KshopKH ឬ Facebook /kshop.kh — យើងទទួលការបញ្ជាទិញ ផ្ទៀងផ្ទាត់ស្ទុក ហើយផ្ញើតំណភ្ជាប់ទូទាត់ ។ COD អាចប្រើបានក្នុងភ្នំពេញ និងសៀមរាប ។ ដឹក: ម៉ូតូថ្ងៃតែមួយក្នុងភ្នំពេញ (មុន ម.ម ៣), ថ្ងៃបន្ទាប់ទៅ សៀមរាប / បាត់ដំបង / ព្រះសីហនុ តាម J&T ឬ Kerry, ១–៣ ថ្ងៃ ទីផ្សេង ។ ទូទាត់: ABA Pay, Wing, KHQR, ឬ COD ។",
    a: "Fastest: message us on Telegram @KshopKH or Facebook /kshop.kh — we take the order, confirm stock, and send a payment link. COD available inside Phnom Penh and Siem Reap. Delivery: same-day moto in Phnom Penh before 3 pm, next-day to Siem Reap / Battambang / Sihanoukville via J&T or Kerry, 1–3 days elsewhere. Payment: ABA Pay, Wing, KHQR, or cash on delivery."
  },
  {
    qKh: "ខ្ញុំឃើញស្រមោចមានស្លាប់ — ត្រូវធ្វើអ្វី?",
    q: "I see flying termites — what do I do?",
    aKh: "ស្រមោចមានស្លាប់ ចេញ ខែ​មីនា–​មិថុនា ។ ពួកវាជា ស្ដេច និង ម្ចាស់ស្ដេច ដែលកំពុងស្វែងរកទីតាំងធ្វើសំបុក ។ ភ្លាមៗ: (១) ប្រើ WordPress ចាប់ ក្នុងផ្ទះ ។ (២) ដំឡើងម្សៅជុំវិញ ទ្វារ បង្អួច ជ្រុង ជ្រោល ជាន់ — ការពារស្ដេចបង្ករសំបុក ។ (៣) ប្រសិនបើ ស្រមោចចេញ ពីក្នុងជញ្ជាំង — នោះ មានរូងកណ្ដៀរ ស្រាប់ — ធ្វើតាម How to Apply ។",
    a: "Flying termites (swarmers) appear March–June each year — they are reproductive queens and kings looking to found new colonies. Act immediately: (1) Kill flying ones indoors with an electric swatter. (2) Spread powder around door frames, window sills, floor edges, and cabinet bases to prevent queens from nesting. (3) If swarmers came from inside your walls, there is already an active colony — follow the How to Apply steps to find and treat the source gallery.",
  },
  {
    qKh: "តើខ្ញុំអាចទៅយកនៅហាងបានទេ?",
    q: "Can I pick up in person?",
    aKh: "បាទ/ចាស ។ ហាងរបស់យើងស្ថិតនៅ ផ្លូវ ២៧១ ជិតទួលទំពូង (ផ្សាររុស្ស៊ី) បើកពី ៨ ព្រឹក – ៦ ល្ងាច ចន្ទ – សៅរ៍ ។ តម្លៃដូចគ្នានឹងអ៊ីនធឺណិត ។ អញ្ជើញមក ប្រសិនបើចង់មើលឧបករណ៍ ហើយសួរបុគ្គលិករបស់យើង — សំណួរភាគច្រើនដោះស្រាយបានក្នុង ៥ នាទី ។",
    a: "Yes. Our shop is on Street 271 near Toul Tompoung (Russian Market), open 8 am–6 pm Mon–Sat. Same prices as online. Drop by if you want to see the kit and ask our staff about your specific problem — most questions are answered in five minutes."
  },
];

// ------------------------------------------------------------------
// Ticker items (rotating announcement bar)
// ------------------------------------------------------------------
const TICKER_ITEMS = [
  { kh: "ទូទាត់ដោយ ABA · Wing · KHQR · COD", en: "Pay with ABA · Wing · KHQR · Cash on delivery" },
  { kh: "ដឹកតាម J&T · Kerry ទូទាំងកម្ពុជា", en: "Nationwide via J&T · Kerry" },
  { kh: "ធានាមិនត្រូវ សងលុយវិញក្នុង ៣០ ថ្ងៃ", en: "30-day money-back if it doesn't work" },
  { kh: "Telegram @KshopKH · Facebook /kshop.kh", en: "Telegram @KshopKH · Facebook /kshop.kh" },
];

// Expose to other scripts
Object.assign(window, {
  PRODUCT, PRODUCT_SHOTS, PROBLEM_SHOTS, REVIEWS, FAQ, TICKER_ITEMS,
  KHR_PER_USD, khr, priceDual, usdOnly, applyProductConfig,
});
