/* ==========================================================================
   XILDA product pages — Waki Mark II + ZEN Series
   ใส่ไฟล์นี้ในธีม แล้ว enqueue ทั้งหน้าเว็บและ editor (add_editor_style)
   ทุก selector ขึ้นต้นด้วย .xz-page จึงไม่กระทบหน้าอื่น
   ========================================================================== */

.xz-page {
  --xz-navy: #123b5e;
  --xz-red: #e30613;
  --xz-text: #1e2a38;
  --xz-line: #123b5e;
  --xz-max: 1280px;
  --xz-gutter: clamp(16px, 4vw, 48px);
  --xz-callout-line: 72px;

  color: var(--xz-text);
  font-family: "Kanit", "Prompt", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.55;
}

.xz-page :where(h1, h2, h3, h4, p, ul, figure) { margin: 0; }
.xz-page :where(h2, h3, h4) { color: var(--xz-navy); font-weight: 500; line-height: 1.3; }
.xz-page img { display: block; max-width: 100%; height: auto; }
.xz-page strong { font-weight: 500; }

/* ---------- Section shell ---------- */
.xz-page .xz-section {
  max-width: var(--xz-max);
  margin-inline: auto;
  padding: clamp(32px, 4.5vw, 64px) var(--xz-gutter);
}
/* First section sits right under the product bar: less space on top */
.xz-page .xz-section:first-child { padding-top: clamp(24px, 3vw, 40px); }
.xz-page .wp-block-columns.xz-section { gap: clamp(24px, 4vw, 56px); }

/* ---------- Core block layout ----------
   The SPA shows content.rendered from the REST API, so WordPress's own block styles
   (wp-block-library, layout classes) are not on the page. Give the blocks used in
   these pages the layout they need here, so the page doesn't depend on them. */
.xz-page .wp-block-columns { display: flex; flex-wrap: nowrap; gap: clamp(24px, 4vw, 56px); }
.xz-page .wp-block-column { flex: 1 1 0; min-width: 0; }
.xz-page .wp-block-image { margin: 0; }
.xz-page .wp-block-image img { height: auto; }

/* เส้นคั่นบาง ๆ แบบในดีไซน์ */
.xz-page .xz-rule {
  border-top: 1px solid var(--xz-line);
  padding-top: 14px;
  margin-top: 14px;
}

/* ---------- Diamond list (◆) ---------- */
.xz-page ul.xz-diamond { list-style: none; padding: 0; }
.xz-page ul.xz-diamond > li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 4px;
}
.xz-page ul.xz-diamond > li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: .62em;
  width: 8px;
  height: 8px;
  background: var(--xz-navy);
  transform: rotate(45deg);
}
.xz-page ul.xz-diamond > li.xz-new::before { background: var(--xz-red); }
.xz-page ul.xz-diamond > li.xz-new > strong:first-child { color: var(--xz-red); }
.xz-page ul.xz-diamond > li > strong { color: var(--xz-navy); }

/* ---------- Dot list (•) + nested dash list (–) ---------- */
.xz-page ul.xz-dots { list-style: none; padding: 0; }
.xz-page ul.xz-dots > li { position: relative; padding-left: 14px; }
.xz-page ul.xz-dots > li::before { content: "•"; position: absolute; left: 0; }
.xz-page ul.xz-dots ul { list-style: none; padding-left: 14px; }
.xz-page ul.xz-dots ul > li { position: relative; padding-left: 14px; }
.xz-page ul.xz-dots ul > li::before { content: "–"; position: absolute; left: 0; }

/* ==========================================================================
   WAKI MARK II
   ========================================================================== */

/* Hero: ข้อความ | รูป | ข้อความ */
.xz-page .xz-waki-hero { align-items: center; }
.xz-page .xz-waki-hero__left { flex: 0 0 30%; text-align: right; }
.xz-page .xz-waki-hero__center { flex: 1 1 auto; }
.xz-page .xz-waki-hero__right { flex: 0 0 30%; }
.xz-page .xz-waki-title {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--xz-line);
}
.xz-page .xz-waki-title + .xz-rule { border-top: 0; }
.xz-page .xz-lead { color: var(--xz-navy); font-size: 18px; font-weight: 500; }
.xz-page .xz-waki-hero__center img { margin-inline: auto; }

/* Product Coloring */
.xz-page .xz-section-title { font-size: clamp(24px, 2.2vw, 30px); margin-bottom: 24px; }
.xz-page .xz-colors .xz-color-row { align-items: center; gap: clamp(24px, 4vw, 64px); margin-bottom: 40px; }
.xz-page .xz-color-row__img { flex: 0 0 30%; }
.xz-page .xz-color-row__text h3 { font-size: 22px; margin-bottom: 6px; }
.xz-page .xz-color-row__text strong { color: var(--xz-navy); }
/* The grid sits on the group itself, or on its inner container: WordPress adds
   .wp-block-group__inner-container inside Group blocks for themes without theme.json. */
.xz-page .xz-colors,
.xz-page .xz-colors > .wp-block-group__inner-container { display: grid; grid-template-columns: 30% 1fr; column-gap: clamp(24px, 4vw, 64px); }
.xz-page .xz-colors:has(> .wp-block-group__inner-container) { display: block; }
.xz-page .xz-colors .xz-section-title { grid-column: 2; }
.xz-page .xz-colors .xz-color-row { grid-column: 1 / -1; }

/* Fan image */
.xz-page .xz-fan img { margin-inline: auto; max-width: 820px; width: 100%; }

/* Generation 3 */
.xz-page .xz-gen3 { align-items: flex-start; }
.xz-page .xz-gen3__visual { flex: 0 0 42%; text-align: center; }
.xz-page .xz-gen3-label { font-size: clamp(20px, 2vw, 28px); font-weight: 400; margin-bottom: 16px; }
.xz-page .xz-gen3-title { font-size: clamp(20px, 2vw, 26px); font-weight: 600; }
.xz-page .xz-gen3-title strong { color: var(--xz-red); font-weight: 600; }
.xz-page .xz-gen3-intro { color: var(--xz-navy); font-weight: 500; font-size: 17px; margin: 16px 0; }
.xz-page .xz-gen3__text > p { margin-bottom: 16px; }
.xz-page .xz-list-title { font-size: 16px; margin: 20px 0 6px 22px; }

/* ==========================================================================
   ZEN SERIES — Intro sections
   ========================================================================== */
.xz-page .xz-zen-intro { align-items: center; }
.xz-page .xz-zen-intro__text { flex: 0 0 52%; }
.xz-page .xz-zen-intro__visual {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr minmax(0, 260px) auto;
  align-items: center;
  gap: 20px;
}

.xz-page .xz-zen-head { display: flex; align-items: center; gap: 28px; }
.xz-page .xz-zen-title {
  font-size: clamp(48px, 5.5vw, 80px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}
.xz-page .xz-zen-type { color: var(--xz-navy); font-size: clamp(26px, 2.8vw, 40px); font-weight: 500; line-height: 1.15; }
.xz-page .xz-zen-th { color: var(--xz-navy); font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; line-height: 1.2; }
.xz-page .xz-zen-logo img { width: clamp(80px, 8vw, 110px); }

.xz-page .xz-zen-tagline {
  color: var(--xz-navy);
  font-weight: 500;
  font-size: 19px;
  text-align: center;
  margin: 28px 0 18px;
}
.xz-page .xz-zen-body { color: var(--xz-navy); font-weight: 400; margin-bottom: 32px; }

/* ไอคอน 3 คอลัมน์ (Mu = 4) */
.xz-page .xz-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 20px;
}
.xz-page .xz-icons--4 { grid-template-columns: repeat(4, 1fr); }
.xz-page .xz-icon { text-align: center; font-size: 15px; line-height: 1.35; }
.xz-page .xz-icon img { width: 96px; margin: 0 auto 10px; }
.xz-page .xz-icon__sub { font-size: 12px; }

/* Badge + tagbox */
.xz-page .xz-zen-badge { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.xz-page .xz-badge img { width: 140px; }
.xz-page .xz-tagbox { text-align: center; min-width: 220px; }
.xz-page .xz-tagbox__title {
  color: var(--xz-navy);
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--xz-line);
}
.xz-page .xz-tagbox__text {
  color: var(--xz-navy);
  padding: 4px 0 6px;
  border-bottom: 2px solid var(--xz-line);
}
.xz-page .xz-zen-product img { margin-inline: auto; max-height: 640px; width: auto; }
.xz-page .xz-zen-label { color: var(--xz-navy); font-weight: 600; text-align: center; line-height: 1.2; }

/* Lifestyle banner เต็มจอ */
.xz-page .xz-lifestyle img { width: 100%; }

/* ==========================================================================
   ZEN SERIES — Spec callouts with pointer lines
   ========================================================================== */
.xz-page .xz-spec-head { text-align: center; margin-bottom: 32px; }
.xz-page .xz-spec-title { font-size: clamp(32px, 3vw, 42px); font-weight: 700; line-height: 1.1; }
.xz-page .xz-spec-th { color: var(--xz-navy); font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; line-height: 1.2; }
.xz-page .xz-spec-head .xz-tagbox { display: inline-block; margin-top: 12px; }

.xz-page .xz-spec-grid {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 22%) 1fr;
  gap: 0;
  align-items: stretch;
}
.xz-page .xz-spec-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.xz-page .xz-spec-col--left { padding-right: var(--xz-callout-line); }
.xz-page .xz-spec-col--right { padding-left: var(--xz-callout-line); }
.xz-page .xz-spec-center { display: flex; align-items: center; justify-content: center; }
.xz-page .xz-spec-center img { margin-inline: auto; }

.xz-page .xz-callout { position: relative; }
.xz-page .xz-callout h4 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }

/* เส้น + จุดข้าวหลามตัด ที่ชี้เข้าหาสินค้า */
.xz-page .xz-callout::before,
.xz-page .xz-callout::after {
  content: "";
  position: absolute;
  top: 2.6em;
  pointer-events: none;
}
.xz-page .xz-callout::before {           /* เส้น */
  width: var(--xz-callout-line);
  border-top: 1px solid var(--xz-line);
}
.xz-page .xz-callout::after {            /* ◆ */
  width: 8px;
  height: 8px;
  margin-top: -4px;
  background: var(--xz-navy);
  transform: rotate(45deg);
}
.xz-page .xz-spec-col--left .xz-callout::before { left: 100%; }
.xz-page .xz-spec-col--left .xz-callout::after { left: calc(100% + var(--xz-callout-line) - 4px); }
.xz-page .xz-spec-col--right .xz-callout::before { right: 100%; }
.xz-page .xz-spec-col--right .xz-callout::after { right: calc(100% + var(--xz-callout-line) - 4px); }

/* กลุ่มที่เนื้อหายาว ให้เส้นอยู่กลางบล็อก */
.xz-page .xz-callout.xz-line-mid::before,
.xz-page .xz-callout.xz-line-mid::after { top: 50%; }

/* MU: อุปกรณ์เสริมวางข้างตัวเครื่อง */
.xz-page .xz-spec--mu .xz-spec-grid { grid-template-columns: 1fr minmax(260px, 34%) 1fr; }
.xz-page .xz-mu-center { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 16px; }
.xz-page .xz-mu-acc { display: flex; flex-direction: column; gap: 18px; }
.xz-page .xz-mu-acc figure { text-align: center; }
.xz-page .xz-mu-acc img { width: 64px; margin-inline: auto; }
.xz-page .xz-mu-acc figcaption { font-size: 11px; margin-top: 4px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .xz-page { --xz-callout-line: 40px; }
  .xz-page .xz-zen-intro__visual { grid-template-columns: 1fr 1fr; }
  .xz-page .xz-zen-badge { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
  .xz-page .xz-zen-label { display: none; }
}

@media (max-width: 781px) {
  /* core columns ซ้อนเองที่ 781px — ปรับลำดับ/จัดชิดให้อ่านง่าย */
  .xz-page .wp-block-columns { flex-direction: column; }
  .xz-page .wp-block-column { flex-basis: auto !important; width: 100%; }

  .xz-page .xz-waki-hero__left { text-align: left; order: 2; }
  .xz-page .xz-waki-hero__center { order: 1; }
  .xz-page .xz-waki-hero__right { order: 3; }

  .xz-page .xz-colors,
  .xz-page .xz-colors > .wp-block-group__inner-container { display: block; }
  .xz-page .xz-color-row__img img { max-width: 260px; }

  .xz-page .xz-zen-intro__visual { order: -1; }
  .xz-page .xz-zen-head { gap: 16px; }
  .xz-page .xz-zen-tagline { text-align: left; }
  .xz-page .xz-icons,
  .xz-page .xz-icons--4 { grid-template-columns: repeat(2, 1fr); }
  .xz-page .xz-icon img { width: 80px; }

  /* Spec: รูปขึ้นก่อน แล้วรายละเอียดเรียงลงมา ไม่มีเส้นชี้ */
  .xz-page .xz-spec-grid,
  .xz-page .xz-spec--mu .xz-spec-grid { display: flex; flex-direction: column; gap: 28px; }
  .xz-page .xz-spec-center { order: -1; }
  .xz-page .xz-spec-center img { max-height: 420px; width: auto; }
  .xz-page .xz-spec-col--left,
  .xz-page .xz-spec-col--right { padding: 0; gap: 24px; }
  .xz-page .xz-callout::before,
  .xz-page .xz-callout::after { display: none; }
  .xz-page .xz-callout {
    border-left: 2px solid var(--xz-navy);
    padding-left: 14px;
  }
}


/* ==========================================================================
   Home Spotlight with a light banner (ZEN Series)
   ใส่ "xz-spotlight-light" ในช่อง Additional CSS class(es) ของ Spotlight block
   - รูปเต็มความกว้างทุกขนาดจอ (ไม่มีขอบขาวด้านข้าง)
   - ตัวอักษรและปุ่มสีเข้มให้อ่านได้บนพื้นสีอ่อน
   ========================================================================== */
.spotlight.xz-spotlight-light {
  background: #e1d3c6 !important;
  color: #000 !important;
}
.spotlight.xz-spotlight-light .home-product .product-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Crop from the top (empty wall), never from the bottom where the products stand */
  object-position: 70% 100%;
}
/* Very wide screens: cover would crop too much of the top and cut the hair dryer.
   Show the whole picture instead and fade its right edge into the background colour
   (the left edge of the banner is already the same colour). */
@media (min-width: 1800px) {
  .spotlight.xz-spotlight-light .home-product .product-bg img {
    width: auto;
    max-width: 100%;
    object-fit: contain;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
            mask-image: linear-gradient(to right, #000 88%, transparent);
  }
}
.spotlight.xz-spotlight-light .product-action a.buy-button {
  background-color: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
}
.spotlight.xz-spotlight-light .product-action a.buy-button:hover { background-color: #262626 !important; }
.spotlight.xz-spotlight-light .product-action a.learn-button {
  background-color: transparent !important;
  border-color: #000 !important;
  color: #000 !important;
}
.spotlight.xz-spotlight-light .product-action a.learn-button:hover { background-color: rgba(0, 0, 0, .08) !important; }

/* Product pages built with .xz-page: the SPA adds 68px above the content
   (.product-content-container); the first .xz-section already has its own top space. */
.product-content-container:has(> .xz-page:first-child) { padding-top: 0; }

/* Product pages: Product/Detail.vue slides the whole content in with GSAP and leaves it at
   transform: translateY(100px). A transform moves the content but not the space it takes,
   so the last 100px drew over the "related products" section below. Reserve that space. */
#product-content .xz-page { padding-bottom: 100px; }

/* ==========================================================================
   ZEN SERIES — About (logo + text), sub navigation, spec tweaks
   ========================================================================== */
.xz-page .xz-zen-about { align-items: center; }
.xz-page .xz-zen-about__logo { flex: 0 0 26%; }
.xz-page .xz-zen-about__logo img { max-width: 280px; width: 100%; margin-inline: auto; }
.xz-page .xz-zen-about__text { color: var(--xz-navy); }
.xz-page .xz-zen-about__names {
  display: inline-block;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  padding: 10px 0;
  border-top: 1px solid var(--xz-line);
  border-bottom: 1px solid var(--xz-line);
}
.xz-page .xz-zen-about__type { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; margin: 18px 0; }
.xz-page .xz-zen-about__quote { font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; margin-bottom: 18px; }
.xz-page .xz-zen-about__text p { margin-bottom: 14px; }

/* Hair Clipper | Hair Dryer links (put xz-subnav--clipper or --dryer on the paragraph)
   Category pages have a fixed black title bar (.product-top-bar, 68px under the 80px header)
   that covered the top of the content. Show the links inside that bar instead, like the
   Overview / Product detail / Warranty links on product pages, and start the content below it. */
.xz-page .xz-subnav {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  z-index: 1021;
  height: 68px;
  margin: 0;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 40px);
  pointer-events: none; /* let clicks through to the bar title, except on the links */
}
.xz-page .xz-subnav a {
  pointer-events: auto;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.xz-page .xz-subnav a:hover { color: #fff; }
.xz-page .xz-subnav--clipper a:nth-child(1),
.xz-page .xz-subnav--dryer a:nth-child(2) { color: #fff; border-bottom-color: #fff; }
.product-content-container:has(> .xz-page .xz-subnav) { padding-top: 68px; }

@media (max-width: 767.98px) {
  .xz-page .xz-subnav { top: 50px; height: 50px; justify-content: flex-end; gap: 16px; }
  .xz-page .xz-subnav a { font-size: 12px; }
  .product-content-container:has(> .xz-page .xz-subnav) { padding-top: 50px; }
}

/* Spec: keep the product picture a sensible height, sections separated by a thin line */
.xz-page .xz-spec-center img { max-height: 620px; width: auto; }
.xz-page .xz-spec + .xz-spec { border-top: 1px solid #e3e6ea; }
.xz-page .xz-spec--mu .xz-mu-center { gap: 16px; }
.xz-page .xz-mu-product img { max-height: 560px; width: auto; margin-inline: auto; }
.xz-page .xz-mu-acc { gap: 18px; justify-content: center; }

@media (max-width: 781px) {
  .xz-page .xz-zen-about__logo img { max-width: 160px; }
  .xz-page .xz-spec--mu .xz-mu-center { display: grid; grid-template-columns: 72px 1fr; }
  .xz-page .xz-spec-center .xz-mu-center .wp-block-column { width: auto; }
}

/* ==========================================================================
   ZEN SERIES — product overview (PDF pages 3–6) on the product pages
   ========================================================================== */
/* WordPress wraps Group content in .wp-block-group__inner-container (themes without
   theme.json). Let the grid/flex of these groups reach their real children. */
.xz-page :is(.xz-zen-head, .xz-icons, .xz-zen-badge) > .wp-block-group__inner-container { display: contents; }

.xz-page .xz-zen-head { justify-content: center; }
.xz-page .xz-zen-head__text { text-align: right; }
.xz-page .xz-zen-logo { margin: 0; }
.xz-page .xz-icon p { margin: 0; color: var(--xz-navy); }
.xz-page .xz-icon .xz-icon__sub { font-size: 12px; }
.xz-page .xz-icon .wp-block-image { margin: 0; }
.xz-page .xz-zen-product img { max-height: 620px; width: auto; margin-inline: auto; }
.xz-page .xz-zen-name {
  color: var(--xz-navy);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
}
.xz-page .xz-zen-intro + .xz-spec { border-top: 1px solid #e3e6ea; }

@media (max-width: 781px) {
  .xz-page .xz-zen-head__text { text-align: left; }
  .xz-page .xz-zen-head { justify-content: flex-start; }
  .xz-page .xz-zen-product img { max-height: 360px; }
  .xz-page .xz-zen-badge { flex-direction: row; justify-content: center; }
  .xz-page .xz-badge img { width: 96px; }
}
/* MU is wider than the clippers: give the picture more room */
.xz-page .xz-zen-intro--mu .xz-zen-intro__visual { grid-template-columns: auto minmax(0, 360px) auto; }
.xz-page .xz-zen-intro--mu .xz-tagbox { min-width: 260px; }
