/* ============================================================
   irobot-th-2026 — assets/css/pdp.css
   ------------------------------------------------------------
   CSS เฉพาะหน้าสินค้า (single product)
   ที่มา: <style> ใน /irobot-web/pdp/preview.html
          + .pdp-prelaunch-banner จาก /irobot-web/pdp/675.html
          + ส่วนที่เพิ่มเพื่อรองรับ markup จริงของ WooCommerce
            (form.cart / .quantity input.qty / .single_add_to_cart_button / .star-rating)

   โหลดหลัง design-system.css เสมอ (handle: irb-pdp, deps: irb-design-system)
   คอมโพเนนต์ร่วม (.section, .section-head, .review-grid, .robot-ph,
   breadcrumb, .ptile*) อยู่ใน design-system.css แล้ว — ห้ามประกาศซ้ำที่นี่

   ทุกสีอ้างอิงจาก var(--brand-color-*) เท่านั้น ห้าม hex/rgb ฝังตรง
   ============================================================ */

/* ------------------------------------------------------------
   1) แบนเนอร์รุ่นยังไม่วางขาย (prelaunch)
   render เมื่อ meta _irb_prelaunch = '1' เท่านั้น
   ------------------------------------------------------------ */
.pdp-prelaunch-banner { background: var(--brand-color-mint); padding: 10px 0; margin-top: 14px; }
.pdp-prelaunch-banner p { font-size: 14px; font-weight: 600; color: var(--brand-color-black); text-align: center; }

/* แถบรุ่นเลิกจำหน่าย (template-parts/pdp/eol-banner.php — ขึ้นเมื่อหมดสต็อกเท่านั้น) */
.pdp-eol-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--brand-color-mint); border-radius: var(--irb-radius-card);
  padding: 16px 24px; margin-top: 20px;
}
.pdp-eol-banner p { font-size: 15px; font-weight: 600; color: var(--brand-color-black); }
.pdp-eol-banner .textlink { margin-left: auto; white-space: nowrap; }

/* ------------------------------------------------------------
   1b) จังหวะ section ตามต้นแบบ (pdp/*.html ใส่ style="padding-top:0" ให้ section ที่ต่อกัน)
   ไม่ตัด = ช่องว่างระหว่าง section เป็น 2 เท่าของต้นแบบ (ล่าง 96 + บน 96)
   ยกเว้น 2 จุดที่ต้นแบบเว้นเต็ม: carousel ชุดแรก และตารางสเปก
   ------------------------------------------------------------ */
.single-product div.product > .section + .section { padding-top: 0; }
/* ส่วนถัดจาก "จุดเด่นหลัก" เว้นบนเต็ม: แถบพื้นอ่อนแยกส่วนแล้ว ถ้า 0 หัวข้อจะชิดขอบแถบ (04.10.2026 · ต้นแบบเอา padding-top:0 ออกเหมือนกัน) */
.single-product div.product > .section:not(.pdp-stories) + .pdp-stories,
.single-product div.product > .pdp-keyfeat-section + .pdp-stories,
.single-product div.product > .section + .pdp-specs { padding-top: clamp(56px, 8vw, 96px); }

/* ------------------------------------------------------------
   2) Hero 2 คอลัมน์ (gallery + buybox)
   ------------------------------------------------------------ */
.pdp-hero { padding: 28px 0 clamp(48px, 7vw, 88px); }
.pdp-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
/* กัน grid track ขยายกว้างเกิน viewport ตาม max-content ของแถว thumbnail
   (overflow-x:auto ต้องทำงานภายในคอลัมน์เท่านั้น) */
.pdp-grid > * { min-width: 0; }
/* div.summary ของ Woo เป็นลูก grid — ถอน float/width 48% จาก woocommerce-layout.css */
.woocommerce div.product .pdp-grid > div.summary { float: none; width: auto; margin: 0; clear: none; }

/* ------------------------------------------------------------
   3) Gallery — render เองจาก get_gallery_image_ids() (ปิด gallery ของ Woo)
   markup: [data-irb-gallery] > .pdp-gallery-frame(.pdp-gallery-arrow,
           .pdp-gallery-stage > img) + .pdp-thumbs > button[data-irb-thumb]
   ------------------------------------------------------------ */
.pdp-gallery-frame { display: flex; align-items: center; gap: 12px; }
.pdp-gallery-stage {
  flex: 1 1 auto; min-width: 0; aspect-ratio: 1 / 1;
  border-radius: var(--irb-radius-card);
}
.pdp-gallery-arrow {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--brand-color-clover);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pdp-gallery-arrow:hover { background: rgba(var(--brand-color-clover-rgb), .12); }
.pdp-gallery-arrow[disabled] { opacity: .35; cursor: default; }
.pdp-gallery-arrow[disabled]:hover { background: transparent; }
/* gallery รูปเดียว: ไม่ต้องมีลูกศร/แถบ thumbnail
   หมายเหตุ: ถ้าอนาคตใส่ data-count="<จำนวนรูป>" ให้ .pdp-gallery จะซ่อนได้ตั้งแต่ CSS
   (ไม่ใส่ก็ได้ — pdp.js ซ่อนปุ่มลูกศรให้อยู่แล้วเมื่อมี thumbnail น้อยกว่า 2 อัน) */
.pdp-gallery[data-count="1"] .pdp-gallery-arrow,
.pdp-gallery[data-count="1"] .pdp-thumbs { display: none; }

/* แถว thumbnail เลื่อนแนวนอน — ขนาด thumb คงที่ ไม่บีบเล็กลงตามจำนวนรูป */
.pdp-thumbs {
  display: flex; gap: 10px; margin-top: 16px;
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pdp-thumbs::-webkit-scrollbar { display: none; }
.pdp-thumb {
  flex: 0 0 104px; width: 104px; scroll-snap-align: start;
  padding: 0; border: 2px solid transparent;
  border-radius: 14px; background: none; cursor: pointer; overflow: hidden;
}
.pdp-thumb.is-active { border-color: var(--brand-color-clover); }
.pdp-thumb-media { aspect-ratio: 1 / 1; border-radius: 12px; }

/* ------------------------------------------------------------
   4) Buybox
   ------------------------------------------------------------ */
.pdp-buybox { display: flex; flex-direction: column; gap: 4px; }
.pdp-buybox .flag { align-self: flex-start; margin-bottom: 10px; }
.pdp-buybox h1 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 600; line-height: 1.25; margin-bottom: 14px; }

/* -- รหัสสินค้า (template-parts/pdp/buybox.php — มีเฉพาะสินค้าที่กรอก SKU) · ตัวอักษรเท่า .apdp-sku ของต้นแบบอะไหล่
   ชิดใต้ชื่อเป็นบรรทัดรอง แล้วเว้นก่อนแถวรีวิวเท่าระยะเดิมของ h1 (ไม่มี SKU = หน้าตาเหมือนก่อน 06.10.2026) */
.pdp-buybox h1:has(+ .pdp-sku) { margin-bottom: 2px; }
.pdp-sku { font-size: 13px; line-height: 1.5; color: rgba(var(--brand-color-gray-rgb), .85); letter-spacing: .02em; margin: 0 0 14px; }
.pdp-sku .sku { overflow-wrap: anywhere; } /* SKU ยาวไม่มีช่องว่าง เช่น R-SKURI715-BUNDLE-W */

/* -- คะแนนรีวิว --
   มีรีวิวจริง → wc_get_rating_html() (.star-rating ของ Woo)
   ไม่มีรีวิว   → .pdp-rating-empty (ห้ามใส่ดาว/รีวิวประดิษฐ์) */
.pdp-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.pdp-stars { display: flex; gap: 3px; }
.pdp-stars svg { width: 16px; height: 16px; }
.pdp-stars path { fill: var(--brand-color-clover); }
.pdp-star-partial { position: relative; width: 16px; height: 16px; display: inline-block; }
.pdp-star-partial svg { position: absolute; inset: 0; width: 16px; height: 16px; }
.pdp-star-partial .star-bg path { fill: var(--brand-color-border); opacity: .4; }
.pdp-star-partial .star-fill-clip { position: absolute; inset: 0; width: 60%; overflow: hidden; }
.pdp-star-partial .star-fill-clip path { fill: var(--brand-color-clover); }
.pdp-rating-num { font-size: 15px; font-weight: 700; color: var(--brand-color-black); }
.pdp-rating-empty { font-size: 14px; color: var(--brand-color-gray); }

/* ดาวของ Woo (wc_get_rating_html) — ปรับสีให้ตรง design system */
.woocommerce .pdp-rating .star-rating,
.woocommerce .woocommerce-product-rating .star-rating { float: none; margin: 0; font-size: 14px; }
.woocommerce .pdp-rating .star-rating::before,
.woocommerce .woocommerce-product-rating .star-rating::before { color: rgba(var(--brand-color-border-rgb), .6); }
.woocommerce .pdp-rating .star-rating span::before,
.woocommerce .woocommerce-product-rating .star-rating span::before { color: var(--brand-color-clover); }

.pdp-desc { font-size: 16px; line-height: 1.65; color: rgba(var(--brand-color-black-rgb), .82); max-width: 52ch; margin-bottom: 22px; }

/* -- ราคา + ผ่อน (ตัวเลขทั้งหมดคำนวณใน PHP ห้าม hard-code) -- */
.pdp-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pdp-price .now { font-size: 30px; font-weight: 700; color: var(--brand-color-black); }
.pdp-price .was { font-size: 17px; color: var(--brand-color-gray); text-decoration: line-through; }
.pdp-price .save { font-size: 14px; font-weight: 600; color: var(--brand-color-clover); }
.pdp-installment { font-size: 14px; color: var(--brand-color-gray); margin-bottom: 22px; }
/* ราคาที่ Woo พิมพ์เอง (composite/bundle ที่ fallback ไป get_price_html) */
.pdp-buybox .price { font-size: 30px; font-weight: 700; color: var(--brand-color-black); margin: 0 0 6px; }
.pdp-buybox .price del { font-size: 17px; font-weight: 400; color: var(--brand-color-gray); }
.pdp-buybox .price ins { text-decoration: none; }

/* ------------------------------------------------------------
   5) ฟอร์ม add-to-cart ของจริง (woocommerce_template_single_add_to_cart)
   🔴 ห้าม override template ใน single-product/add-to-cart/ (composite/bundle พึ่งอยู่)
      ที่นี่แต่งหน้าตาอย่างเดียว — name/min/max/step ของ qty ต้องเป็นของ Woo
   ------------------------------------------------------------ */
#pdpBuyboxCta { display: block; }

/* 5.1 แถว "จำนวน + ปุ่ม" (เจ้าของ 04.10.2026: เดิมกล่องเลข 1 ลอยอยู่บรรทัดเดียว ปุ่มอีกบรรทัด "แปลก ๆ"
       ref irobot.com: Qty อยู่ข้าง Add to Cart แถวเดียวกัน — ของเราโค้งทั้งคู่ สูงเท่ากัน 58px)
   ทุกอย่างในฟอร์มที่ไม่ใช่ช่องจำนวน/ปุ่ม (ตารางตัวเลือกของสินค้าแบบมีตัวเลือก · ชิ้นส่วน bundle/composite) กินเต็มแถว
   → ช่องจำนวน + ปุ่มอยู่แถวเดียวกันเสมอ · input hidden ของ Woo เป็น display:none ไม่กินช่อง */
.pdp-buybox form.cart,
.woocommerce div.product .pdp-buybox form.cart,
.pdp-buybox .woocommerce-variation-add-to-cart {
  display: flex; flex-flow: row wrap; align-items: stretch;
  gap: 16px 12px; margin: 0 0 4px;
}
.pdp-buybox form.cart > :not(.quantity):not(.single_add_to_cart_button),
.pdp-buybox .woocommerce-variation-add-to-cart > :not(.quantity):not(.single_add_to_cart_button) { flex: 1 0 100%; }
/* clearfix ของ Woo `.woocommerce div.product form.cart::before/::after { content:" "; display:table }` (0,3,3) แรงกว่า
   → กลายเป็นช่อง flex ว่างที่กินระยะ gap (แถวจำนวนเยื้อง 12px · ปุ่มหล่นบรรทัดใหม่บนมือถือ) — ต้องยกเป็น (0,4,3) */
.pdp-buybox form.cart::before,
.pdp-buybox form.cart::after,
.woocommerce div.product .pdp-buybox form.cart::before,
.woocommerce div.product .pdp-buybox form.cart::after { content: none; display: none; }

/* 5.2 ช่องจำนวน = แคปซูล [ − 1 + ] — Woo พิมพ์ <div class="quantity"><input type="number" class="qty" min max step>
   ปุ่ม −/+ (.irb-qty-btn) pdp.js เติมรอบ input เดิม (ค่าที่ส่งยังเป็นของ input ตัวเดิม) · ไม่มี JS = แคปซูลพิมพ์เลขได้ */
.pdp-qty { display: flex; align-items: center; gap: 14px; }
.pdp-qty-label,
.pdp-buybox form.cart .quantity label { font-size: 14px; font-weight: 600; }
.pdp-buybox form.cart .quantity,
.woocommerce div.product .pdp-buybox form.cart .quantity {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  float: none; margin: 0; height: 58px; padding: 0 8px;
  background: var(--brand-color-white);
  border: 1.5px solid rgba(var(--brand-color-border-rgb), .6);
  border-radius: var(--irb-radius-pill);
  transition: border-color .15s ease;
}
.pdp-buybox form.cart .quantity:focus-within { border-color: var(--brand-color-black); }
/* ขายทีละชิ้น (sold individually) Woo ส่ง input type=hidden → ไม่มีอะไรให้ปรับ ซ่อนแคปซูล ปุ่มเต็มแถว */
.pdp-buybox form.cart .quantity:has(input.qty[type="hidden"]) { display: none; }
.pdp-buybox form.cart .quantity input.qty,
.woocommerce div.product .pdp-buybox form.cart .quantity input.qty {
  font-family: var(--irb-font); font-size: 17px; font-weight: 600;
  color: var(--brand-color-black); background: transparent;
  border: 0; border-radius: 0; box-shadow: none;
  width: 64px; height: 100%; padding: 0; margin: 0; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.pdp-buybox form.cart .quantity.has-stepper input.qty,
.woocommerce div.product .pdp-buybox form.cart .quantity.has-stepper input.qty { width: 40px; }
.pdp-buybox form.cart .quantity input.qty:focus { outline: none; }
.pdp-buybox form.cart .quantity input.qty::-webkit-outer-spin-button,
.pdp-buybox form.cart .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.irb-qty-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: none;
  color: var(--brand-color-black); cursor: pointer;
  transition: background-color .15s ease, transform .1s ease-out;
}
.irb-qty-btn svg { width: 16px; height: 16px; max-width: none; }
.irb-qty-btn:hover:not(:disabled) { background: var(--brand-color-sand); }
.irb-qty-btn:active:not(:disabled) { transform: scale(.92); }
.irb-qty-btn:disabled { color: rgba(var(--brand-color-black-rgb), .25); cursor: default; }
.irb-qty-btn:focus-visible { outline: 2px solid var(--brand-color-black); outline-offset: 1px; }

/* 5.3 ปุ่มหลัก — Woo พิมพ์ class single_add_to_cart_button button alt เอง (template ห้ามแตะ)
   ⇒ แคปซูลดำสูงเท่าช่องจำนวน กินที่เหลือของแถว (แคบกว่า 150px ขึ้นบรรทัดใหม่เต็มแถว — จอ 360 ยังแถวเดียว) */
.woocommerce div.product .pdp-buybox form.cart button.single_add_to_cart_button,
.woocommerce div.product .pdp-buybox form.cart input.single_add_to_cart_button,
.pdp-buybox form.cart .single_add_to_cart_button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: 1 1 150px; width: auto; height: 58px; float: none;
  font-family: var(--irb-font); font-size: 18px; font-weight: 600; line-height: 1;
  padding: 0 32px;
  border: 2px solid transparent; border-radius: var(--irb-radius-pill);
  background: var(--brand-color-black); color: var(--brand-color-white);
  text-transform: none; letter-spacing: normal; text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.woocommerce div.product .pdp-buybox form.cart button.single_add_to_cart_button:hover,
.pdp-buybox form.cart .single_add_to_cart_button:hover {
  background: var(--brand-color-black); color: var(--brand-color-white);
  transform: translateY(-1px); opacity: .92;
}
.woocommerce div.product .pdp-buybox form.cart button.single_add_to_cart_button:active,
.pdp-buybox form.cart .single_add_to_cart_button:active { transform: scale(.98); }
.woocommerce div.product .pdp-buybox form.cart button.single_add_to_cart_button:disabled,
.pdp-buybox form.cart .single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ปุ่มขนาดเต็มใน buybox (ปุ่มของธีมเอง เช่น "แจ้งเตือนเมื่อวางขาย") */
.pdp-buybox .btn-lg { width: 100%; margin-bottom: 4px; }

/* 5.4 สถานะสต็อก — จุดสี + ข้อความเขียวเข้ม
   🔴 ต้องมี `.woocommerce div.product …` (0,3,1): กฎสีของ Woo `.woocommerce div.product .stock` (0,2,1)
      ชนะ `.pdp-buybox .stock` (0,2,0) → เดิมขึ้นสีเขียวขี้ม้าของ Woo ไม่ใช่สีแบรนด์ */
.pdp-buybox .stock,
.woocommerce div.product .pdp-buybox .stock {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--brand-color-hunter); margin: 0 0 8px;
}
.pdp-buybox .stock::before {
  content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-color-clover); box-shadow: 0 0 0 3px rgba(var(--brand-color-clover-rgb), .18);
}
.pdp-buybox .stock.out-of-stock,
.woocommerce div.product .pdp-buybox .stock.out-of-stock { color: var(--brand-color-gray); }
.pdp-buybox .stock.out-of-stock::before { background: var(--brand-color-gray); box-shadow: none; }

/* 5.5 ฟอร์ม "แจ้งเตือนเมื่อมีสินค้า" ของสินค้าหมด (เจ้าของ 06.10.2026 "หน้าต่างลงทะเบียนหลุด theme")
   markup = back-in-stock-notifier-for-woocommerce/default-form.php ของธีม · หน้าตา = .apdp-notify ของต้นแบบอะไหล่
   CSS ของปลั๊กอิน (bootstrap + สีเขียว !important ของ add-on) ถูกถอดที่ inc/compat-plugins.php §3 */
.pdp-bis {
  display: flex; flex-direction: column; gap: 10px; margin: 4px 0 8px; padding: 18px 20px;
  background: var(--brand-color-sand); border-radius: var(--irb-radius-card);
}
.pdp-bis-title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0; }
.pdp-bis .cwginstock-subscribe-form__form { display: flex; flex-direction: column; gap: 10px; }
.pdp-bis-row { display: flex; gap: 10px; }
.pdp-bis input.cwgstock_email,
.pdp-bis input.cwgstock_phone {
  flex: 1 1 160px; min-width: 0; width: 100%; height: 50px; margin: 0; padding: 0 18px;
  border: 1.5px solid var(--brand-color-border); border-radius: var(--irb-radius-pill);
  font-family: var(--irb-font); font-size: 15px; text-align: left;
  background: var(--brand-color-white); color: var(--brand-color-black);
}
.pdp-bis input.cwgstock_email:focus-visible,
.pdp-bis input.cwgstock_phone:focus-visible { outline: 2px solid var(--brand-color-clover); outline-offset: 2px; }
.pdp-bis .cwgstock_button { flex: 0 0 auto; height: 50px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.pdp-bis-help { font-size: 13px; line-height: 1.5; color: var(--brand-color-gray); margin: 0; }
/* ผลหลังกดส่ง: ปลั๊กอินพ่น <div class="cwginstocksuccess|cwginstockerror" style="color:green|red"> → ต้อง !important ชนะ style="" */
.pdp-bis .cwgstock_output:empty { display: none; }
.pdp-bis .cwgstock_output > div { font-size: 14px; font-weight: 600; line-height: 1.5; }
.pdp-bis .cwgstock_output .cwginstocksuccess { color: var(--brand-color-hunter) !important; }
.pdp-bis .cwgstock_output .cwginstockerror { color: var(--brand-color-black) !important; }
@media (max-width: 560px) {
  .pdp-bis-row { flex-direction: column; }
  /* เรียงแนวตั้งแล้ว flex-basis 160px จะกลายเป็น "ความสูง" ของช่องอีเมล → ล้าง basis ให้ height: 50px ทำงาน */
  .pdp-bis input.cwgstock_email { flex: 0 0 auto; }
  .pdp-bis .cwgstock_button { width: 100%; }
}

/* composite / bundle: กล่องส่วนประกอบและกล่องสรุปราคาที่ปลั๊กอิน render เอง
   แต่งแค่ระยะห่างพอให้อ่านออก — รายละเอียดรอ QA ร่วมกับปลั๊กอินใน 2.4/2.5 */
.pdp-buybox .woocommerce-variation-add-to-cart,
.pdp-buybox .wc-composite-component,
.pdp-buybox .wpc-bundled-products,
.pdp-buybox .woosb-products { margin-bottom: 16px; }

/* ------------------------------------------------------------
   6) แถบความมั่นใจ + ลิงก์ติดต่อ
   ------------------------------------------------------------ */
.pdp-trust-row {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px;
  border-top: 1px solid rgba(var(--brand-color-border-rgb), .3);
}
.pdp-trust-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--brand-color-gray); flex: 1 1 140px; }
.pdp-trust-icon { width: 26px; height: 26px; flex-shrink: 0; }
.pdp-trust-icon path, .pdp-trust-icon rect, .pdp-trust-icon circle { fill: none; stroke: var(--brand-color-hunter); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pdp-contact-link { display: inline-block; margin-top: 20px; font-size: 14px; }

/* ------------------------------------------------------------
   7) Sticky add-to-cart bar (JS: IntersectionObserver)
   markup: [data-irb-sticky-bar] + anchor [data-irb-sticky-anchor]
   ------------------------------------------------------------ */
.pdp-sticky-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--brand-color-white);
  border-bottom: 1px solid rgba(var(--brand-color-border-rgb), .3);
  box-shadow: 0 8px 24px rgba(var(--brand-color-black-rgb), .1);
  transform: translateY(-100%);
  transition: transform .25s ease;
}
.pdp-sticky-bar.is-visible { transform: translateY(0); }
.pdp-sticky-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px var(--irb-pad); }
.pdp-sticky-info { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.pdp-sticky-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdp-sticky-price { font-size: 17px; font-weight: 700; flex-shrink: 0; }
.pdp-sticky-inner .btn { flex-shrink: 0; padding: 11px 24px; }
/* แถบผู้ดูแลระบบของ WordPress ทับแถบ sticky ที่ top:0 */
body.admin-bar .pdp-sticky-bar { top: 32px; }

/* ------------------------------------------------------------
   8) จุดเด่นหลัก (key features)
   ------------------------------------------------------------ */
/* เจ้าของ 04.10.2026: "นี่คือ HL เน้นหน่อย" (ref irobot.com Key Features) — แถบพื้นอ่อนเต็มความกว้าง ไอคอน/ข้อความใหญ่ */
.pdp-keyfeat-section { padding: clamp(56px, 7vw, 96px) 0; background: rgba(var(--brand-color-sand-rgb), .6); }
.pdp-keyfeat-heading {
  text-align: center; font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; line-height: 1.2; /* ใหญ่กว่า .section-head h2 — ไฮไลต์ของหน้า */
  position: relative; padding-bottom: 22px; margin-bottom: clamp(36px, 5vw, 64px);
}
.pdp-keyfeat-heading::after {
  content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 96px; height: 3px; border-radius: 2px; background: var(--brand-color-clover);
}
.pdp-keyfeat-grid {
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 56px);
  max-width: 1200px; margin: 0 auto;
}
.pdp-keyfeat-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(16px, 2vw, 24px); }
/* (0,2,0) — `.woocommerce img { height:auto; max-width:100% }` (0,1,1) ของ Woo ชนะ .pdp-keyfeat-icon เดี่ยว (กับดักเดียวกับโลโก้ B8/B9) */
.pdp-keyfeat-item .pdp-keyfeat-icon { width: clamp(80px, 8vw, 112px); height: clamp(80px, 8vw, 112px); max-width: none; object-fit: contain; }
.pdp-keyfeat-item p { font-size: clamp(17px, 1.6vw, 22px); line-height: 1.4; color: rgba(var(--brand-color-black-rgb), .85); max-width: 19ch; text-wrap: balance; }

/* ------------------------------------------------------------
   9) วิดีโอภาพรวมสินค้า
   ------------------------------------------------------------ */
.pdp-video-frame { aspect-ratio: 16 / 9; border-radius: var(--irb-radius-card); overflow: hidden; background: var(--brand-color-black); }
.pdp-video-frame video,
.pdp-video-frame iframe { width: 100%; height: 100%; display: block; object-fit: cover; border: 0; background: var(--brand-color-black); }
.pdp-video-caption { font-size: 12px; line-height: 1.5; color: var(--brand-color-gray); max-width: 640px; margin-top: 14px; }

/* ------------------------------------------------------------
   10) รายละเอียดสินค้า (top features) + accordion "ดูเพิ่มเติม"
   markup accordion: button[data-irb-accordion][data-label-more][data-label-less]
                     + [data-irb-accordion-panel]
   ------------------------------------------------------------ */
.pdp-topfeat-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; }
.pdp-topfeat-grid[hidden] { display: none; }
.pdp-topfeat-grid li { display: flex; gap: 16px; align-items: flex-start; }
.pdp-topfeat-extra { margin-top: 28px; }
.tf-num { flex-shrink: 0; min-width: 34px; font-size: 20px; font-weight: 700; color: var(--brand-color-clover); line-height: 1.3; }
.tf-body h3 { font-size: 16px; font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.tf-body p { font-size: 14px; line-height: 1.6; color: rgba(var(--brand-color-black-rgb), .75); }
.tf-body .t-fine { margin-top: 6px; max-width: none; }

.pdp-accordion-toggle {
  margin-top: 22px; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--irb-font); font-size: 15px; font-weight: 600; color: var(--brand-color-clover);
  text-decoration: underline; text-underline-offset: 3px; padding: 4px 0;
}
.pdp-accordion-toggle svg { color: var(--brand-color-clover); transition: transform .2s ease; }
.pdp-accordion-toggle.is-open svg { transform: rotate(180deg); }
.pdp-fine-note { margin-top: 18px; max-width: none; }

/* ------------------------------------------------------------
   11) ฟีเจอร์เด่น — carousel (ซ้ำได้ N ชุดในหน้าเดียว)
   markup: [data-irb-carousel] > .pdp-stories-viewport
           > [data-irb-carousel-track] > .pdp-story-slide
   ------------------------------------------------------------ */
.pdp-stories { padding: clamp(56px, 8vw, 96px) 0; }
.pdp-stories + .pdp-stories { padding-top: 0; }
.pdp-stories-head { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.pdp-stories-head h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; line-height: 1.25; flex: 0 1 auto; min-width: 0; }
.pdp-stories-head-icon { width: 34px; height: 34px; flex-shrink: 0; }
.pdp-stories-rule { display: block; height: 3px; border-radius: 2px; background: var(--brand-color-clover); flex-shrink: 0; }
.pdp-stories-rule--short { width: 40px; }
.pdp-stories-rule--long { flex: 1 1 40px; min-width: 24px; }

.pdp-stories-viewport { position: relative; padding: 0 60px; }
.pdp-stories-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pdp-stories-track::-webkit-scrollbar { display: none; }

.pdp-story-slide {
  flex: 0 0 100%; width: 100%; scroll-snap-align: start;
  display: grid; grid-template-columns: .82fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.pdp-story-copy { display: flex; flex-direction: column; gap: 12px; }
.pdp-story-count { font-size: 13px; color: var(--brand-color-gray); }
.pdp-story-copy h3 { font-size: clamp(24px, 2.8vw, 28px); font-weight: 600; line-height: 1.3; }
.pdp-story-copy p { font-size: 15px; line-height: 1.65; color: var(--brand-color-gray); max-width: 44ch; }
.pdp-story-media { aspect-ratio: 4 / 3; border-radius: var(--irb-radius-card); align-self: center; }

.pdp-stories-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--brand-color-white); box-shadow: 0 10px 28px rgba(var(--brand-color-black-rgb), .14);
}
.pdp-stories-nav--prev { left: 0; }
.pdp-stories-nav--next { right: 0; }

.pdp-stories-progress { max-width: 320px; margin: 28px auto 0; }
.pdp-stories-progress-track { height: 4px; border-radius: 2px; background: rgba(var(--brand-color-border-rgb), .25); overflow: hidden; }
.pdp-stories-progress-fill { height: 100%; width: 0%; border-radius: 2px; background: var(--brand-color-clover); transition: width .15s ease; }

.pdp-stories-fine { margin-top: 20px; }

/* ------------------------------------------------------------
   12) สเปกสินค้า (ตาราง + accordion)
   ------------------------------------------------------------ */
.pdp-spec-table { width: 100%; max-width: 760px; border-collapse: collapse; }
.pdp-spec-table th, .pdp-spec-table td { text-align: left; padding: 16px 12px 16px 0; border-bottom: 1px solid rgba(var(--brand-color-border-rgb), .3); font-size: 15px; }
.pdp-spec-table th { color: var(--brand-color-gray); font-weight: 400; width: 42%; }
.pdp-spec-table td { font-weight: 600; }
.pdp-spec-table tbody[hidden] { display: none; }

/* ------------------------------------------------------------
   13) ในกล่องมีอะไรบ้าง
   ------------------------------------------------------------ */
.pdp-box-panel { background: var(--brand-color-sand); border-radius: var(--irb-radius-card); padding: clamp(28px, 4vw, 40px); }
.pdp-box-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; }
.pdp-box-grid li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--brand-color-black); }
.pdp-box-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-color-clover); }

/* ------------------------------------------------------------
   14) ตารางเปรียบเทียบรุ่น
   ------------------------------------------------------------ */
.pdp-compare-scroll { overflow-x: auto; margin-top: 24px; }
.pdp-compare-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; }
.pdp-compare-table th, .pdp-compare-table td { padding: 16px 20px; text-align: left; font-size: 14px; border-bottom: 1px solid rgba(var(--brand-color-border-rgb), .3); vertical-align: top; }
.pdp-compare-table thead th { font-size: 15px; font-weight: 600; }
.pdp-compare-table tbody th { font-weight: 400; color: var(--brand-color-gray); white-space: nowrap; }
.pdp-compare-table .is-highlight { background: rgba(var(--brand-color-clover-rgb), .07); border-left: 2px solid var(--brand-color-clover); border-right: 2px solid var(--brand-color-clover); }
.pdp-compare-table thead th.is-highlight { border-top: 2px solid var(--brand-color-clover); border-radius: 14px 14px 0 0; }
.pdp-compare-table tbody tr:last-child td.is-highlight { border-bottom: 2px solid var(--brand-color-clover); border-radius: 0 0 14px 14px; }
.pdp-compare-table thead th { vertical-align: bottom; }
.pdp-compare-table thead th a { color: inherit; text-decoration: none; }
.pdp-compare-table thead th a:hover { color: var(--brand-color-clover); text-decoration: underline; text-underline-offset: 3px; }
/* รูปสินค้าบนหัวตาราง (ต้นแบบ §7 · เจ้าของ 10.09.2026 "ได้เห็นภาพจริง")
   รูปพื้นขาว + multiply = พื้นกลืนกับสีคอลัมน์ (คอลัมน์ไฮไลต์เป็นมิ้นต์) เหลือแต่ตัวหุ่น
   height:auto จำเป็น — attribute height บน <img> จาก WP ทำให้ aspect-ratio ไม่ทำงาน
   selector 2 ชั้น: `.woocommerce img { max-width:100% }` ของ woocommerce-layout.css ชนะ class เดี่ยว */
.pdp-compare-table .pdp-compare-thumb {
  display: block; width: 100%; max-width: 116px; height: auto; aspect-ratio: 1 / 1;
  margin: 0 auto 10px; object-fit: contain; mix-blend-mode: multiply;
}
.pdp-compare-more { margin-top: 18px; font-size: 14px; line-height: 1.6; color: var(--brand-color-gray); text-align: center; }
.pdp-compare-cta { margin-top: 14px; display: flex; justify-content: center; }

/* ------------------------------------------------------------
   15) รีวิว — สรุปคะแนน / empty state
   🔴 ไม่มีรีวิวจริง = ต้องใช้ empty state ห้ามใส่รีวิวประดิษฐ์
   (.review-grid / .review-card อยู่ใน design-system.css)
   ------------------------------------------------------------ */
.pdp-review-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; flex-wrap: wrap; }
.pdp-review-score { font-size: 44px; font-weight: 700; line-height: 1; }
.pdp-review-summary-meta { display: flex; flex-direction: column; gap: 6px; }
.pdp-review-count { font-size: 14px; color: var(--brand-color-gray); }
.pdp-review-empty {
  background: var(--brand-color-sand); border-radius: var(--irb-radius-card);
  padding: clamp(24px, 4vw, 36px); max-width: 640px;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.pdp-review-empty p { font-size: 15px; line-height: 1.65; color: rgba(var(--brand-color-black-rgb), .78); }

/* ------------------------------------------------------------
   16) คำถามที่พบบ่อย (native <details>)
   ------------------------------------------------------------ */
.pdp-faq { max-width: 760px; border-top: 1px solid rgba(var(--brand-color-border-rgb), .3); }
.pdp-faq-item { border-bottom: 1px solid rgba(var(--brand-color-border-rgb), .3); padding: 18px 0; }
.pdp-faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 16px; font-weight: 600; color: var(--brand-color-black);
}
.pdp-faq-item summary::-webkit-details-marker { display: none; }
.pdp-faq-item summary::after {
  content: ''; width: 9px; height: 9px; flex-shrink: 0;
  border-right: 2px solid var(--brand-color-clover); border-bottom: 2px solid var(--brand-color-clover);
  transform: rotate(45deg); transition: transform .2s ease;
}
.pdp-faq-item[open] summary::after { transform: rotate(-135deg); }
.pdp-faq-item p { margin-top: 12px; font-size: 15px; line-height: 1.65; color: rgba(var(--brand-color-black-rgb), .78); max-width: 68ch; }

/* ------------------------------------------------------------
   17) สำรวจรุ่นอื่น (cross-sell) + หมายเหตุท้ายหน้า
   ------------------------------------------------------------ */
.ptile-soon { font-size: 14px; color: var(--brand-color-gray); margin: 2px 0 0; }
/* section ของ related มี class "products" (เทมเพลต Woo) → `.woocommerce .products ul::before { display:table }`
   ของ woocommerce-layout.css ไปเป็นช่องกริดแรก การ์ดใบแรกหล่นไปช่องที่ 2 (staging 02.10.2026) */
.related.products .ptile-row::before,
.related.products .ptile-row::after { content: none; display: none; }

/* ------------------------------------------------------------
   รายการรีวิวจริงจาก WooCommerce (2.4)
   markup: woocommerce/single-product-reviews.php + single-product/review.php ของธีม
   `.review-grid` / `.review-card` อยู่ในชั้น SHARED ของ design-system.css แล้ว
   ที่นี่มีเฉพาะการเชื่อมคลาสของ Woo เข้ากับกริดนั้น
   ------------------------------------------------------------ */
.review-grid.commentlist { list-style: none; margin: 24px 0 0; padding: 0; }
.review-card .comment_container { display: flex; flex-direction: column; gap: 12px; }
.review-card .description p:last-child { margin-bottom: 0; }
.review-card .meta { font-size: 13px; color: var(--brand-color-gray); }
.review-card .woocommerce-review__verified { font-style: normal; font-weight: 400; color: var(--brand-color-clover); }
/* การ์ดรีวิวไม่มีรูปโปรไฟล์ในดีไซน์ */
.review-card .avatar { display: none; }
/* ตอบกลับซ้อน (แอดมินตอบรีวิว) — ไม่ใช่การ์ดในกริด ให้ยุบเป็นย่อหน้าในใบเดิม */
.review-card .children { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(var(--brand-color-border-rgb), .35); }
.review-card .children .review-card { background: none; border-radius: 0; padding: 0; }

#reviews #review_form_wrapper { margin-top: 28px; }
#reviews .comment-reply-title { display: block; font-size: 17px; font-weight: 600; margin-bottom: 12px; }
#reviews .comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
#reviews .comment-form input[type="text"],
#reviews .comment-form input[type="email"],
#reviews .comment-form textarea,
#reviews .comment-form select {
  width: 100%; max-width: 520px;
  padding: 10px 12px;
  border: 1px solid var(--brand-color-border);
  border-radius: 10px;
  background: var(--brand-color-white);
  color: var(--brand-color-black);
  font: inherit;
}
#reviews .comment-form p { margin-bottom: 16px; }
#reviews .comment-form .required { color: var(--brand-color-clover); }
.woocommerce-verification-required { font-size: 14px; color: var(--brand-color-gray); margin-top: 20px; }
.woocommerce-verification-required a { margin-left: 6px; color: var(--brand-color-hunter); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.pdp-disclaimers { border-top: 1px solid rgba(var(--brand-color-border-rgb), .3); padding-top: 28px; }
.pdp-disclaimers ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.pdp-disclaimers li { font-size: 12px; line-height: 1.6; color: var(--brand-color-gray); }

/* ------------------------------------------------------------
   18) Desktop — จัดกึ่งกลางเฉพาะ element ของ PDP
   (.section-head จัดกึ่งกลางแล้วใน design-system.css)
   ------------------------------------------------------------ */
@media (min-width: 768px) {
  .pdp-video-frame { margin-left: auto; margin-right: auto; }
  .pdp-video-caption { margin-left: auto; margin-right: auto; text-align: center; }
  /* หัวข้อ carousel: เส้น clover สมมาตรสองข้าง → ข้อความอยู่กลาง */
  .pdp-stories-rule--short { width: auto; flex: 1 1 40px; min-width: 24px; }
  /* ต้นแบบ: กฎ @media นี้อยู่ "ก่อน" กฎหลักของ .pdp-review-empty / .pdp-faq → กฎหลักทับ align/max-width กลับ
     หน้าที่เจ้าของเห็นจริง = กล่องอยู่กลาง แต่ข้อความชิดซ้าย · FAQ กว้าง 760 (ไม่ใช่ 800) — ธีมยึดผลที่เห็นจริง */
  .pdp-review-empty { margin-left: auto; margin-right: auto; }
  .pdp-faq { max-width: 760px; margin-left: auto; margin-right: auto; }
}

/* ------------------------------------------------------------
   19) Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .pdp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .pdp-compare-scroll { margin-top: 16px; }
}
@media (max-width: 782px) {
  body.admin-bar .pdp-sticky-bar { top: 46px; }
}
@media (max-width: 700px) {
  .pdp-stories-head { gap: 12px; margin-bottom: 24px; }
  .pdp-stories-head-icon { width: 26px; height: 26px; }
  .pdp-stories-viewport { padding: 0; }
  .pdp-stories-nav { display: none; }
  /* มือถือ: โชว์ขอบสไลด์ถัดไป (peek) ให้รู้ว่าปัดต่อได้ */
  .pdp-stories-track { gap: 14px; scroll-padding-left: 0; }
  .pdp-story-slide { flex: 0 0 88%; width: 88%; grid-template-columns: 1fr; gap: 20px; }
  .pdp-story-media { order: 1; }
  .pdp-story-copy { order: 2; }
  .pdp-topfeat-grid, .pdp-topfeat-extra { grid-template-columns: 1fr; }
  .pdp-keyfeat-grid { grid-template-columns: 1fr 1fr; gap: 36px 16px; }
  .pdp-box-grid { grid-template-columns: 1fr 1fr; }
  .pdp-compare-table .pdp-compare-thumb { max-width: 76px; margin-bottom: 8px; }
  /* หัวแถวตารางเปรียบเทียบบนมือถือ (เจ้าของ 10.09.2026): ตัดบรรทัดได้ ไม่กินคอลัมน์ซ้าย 240px */
  .pdp-compare-table tbody th { white-space: normal; overflow-wrap: break-word; padding-left: 0; padding-right: 14px; max-width: 148px; }
  .pdp-compare-table thead th:first-child { padding-left: 0; }
}
@media (max-width: 560px) {
  .pdp-thumbs { gap: 8px; }
  .pdp-gallery-arrow { width: 34px; height: 34px; }
  .pdp-price .now { font-size: 26px; }
  .pdp-buybox .price { font-size: 26px; }
  /* มือถือ: แถบ sticky ย้ายไปติดขอบล่าง (ไม่ทับ header/แถบแอดมิน) */
  .pdp-sticky-bar { top: auto; bottom: 0; border-bottom: 0; border-top: 1px solid rgba(var(--brand-color-border-rgb), .3); transform: translateY(100%); }
  .pdp-sticky-bar.is-visible { transform: translateY(0); }
  body.admin-bar .pdp-sticky-bar { top: auto; }
  .pdp-sticky-name { max-width: 40vw; }
  .pdp-box-grid { grid-template-columns: 1fr; }
  .pdp-eol-banner { flex-direction: column; align-items: flex-start; }
  .pdp-eol-banner .textlink { margin-left: 0; }
  .pdp-compare-more { text-align: left; }
  .pdp-compare-cta { justify-content: stretch; }
  .pdp-compare-cta .btn { width: 100%; text-align: center; }
  .woocommerce div.product .pdp-buybox form.cart button.single_add_to_cart_button,
  .pdp-buybox form.cart .single_add_to_cart_button { padding: 0 20px; font-size: 17px; }
}
