/* =========================================
   KRUNIKI — FINAL POLISH (SAFE)
   file: assets/css2/fixes/98_final_polish.css
   ========================================= */

/* 1) Smooth rendering */
html{ scroll-behavior:smooth; }
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 2) Motion tokens */
:root{
  --ease-lux: cubic-bezier(.2,.8,.2,1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 520ms;

  --gold-main: #c9a86a;
  --gold-soft: #bfa36a;

  --line-gold: rgba(201,168,106,.14);
  --line-soft: rgba(255,255,255,.06);

  --shadow-soft: 0 18px 50px rgba(0,0,0,.55);
  --shadow-lux:  0 30px 90px rgba(0,0,0,.62);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition-duration:0ms !important; animation-duration:0ms !important; }
}

/* 3) Links: เอาเส้นใต้เฉพาะที่ต้องการ (ไม่ยิงทั้งเว็บ) */
.siteHeader a,
.navLinks a,
.mobileMenu a,
.card a{ text-decoration:none; }

/* 4) Nav hover gold (Desktop) */
.navLinks a{
  transition: color var(--dur-med) var(--ease-lux), opacity var(--dur-med) var(--ease-lux);
}
.navLinks a:hover{ color: var(--gold-main); }

/* 5) Mobile menu polish (แทน navDrawer) */
.mobileMenu a{
  transition: color var(--dur-med) var(--ease-lux), opacity var(--dur-med) var(--ease-lux);
}
.mobileMenu a:hover{ color: var(--gold-main); }

/* 6) Card hover polish */
.page--index2 .card,
.page--index2 .cardLink{
  position: relative;
  transition:
    transform var(--dur-med) var(--ease-lux),
    box-shadow var(--dur-med) var(--ease-lux),
    border-color var(--dur-med) var(--ease-lux);
}
.page--index2 .card::after,
.page--index2 .cardLink::after{
  content:"";
  position:absolute; inset:0;
  border-radius: inherit;
  pointer-events:none;
  opacity:0;
  transition: opacity var(--dur-med) var(--ease-lux);
  box-shadow: 0 0 0 1px var(--line-gold);
}
.page--index2 .card:hover,
.page--index2 .cardLink:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.page--index2 .card:hover::after,
.page--index2 .cardLink:hover::after{ opacity:1; }

/* 7) Hero text: คุมเฉพาะบล็อก ไม่ใช้ * */
.servicesHeroTitle{ margin: 0 auto 26px; line-height: 1.22; }
.heroQuote{ margin: 0 auto 22px; line-height: 1.9; }
.services-sub{
  margin: 18px auto 22px;
  line-height: 1.9;
  max-width: 720px;
  text-align: center;
}
.services-signature{
  margin: 22px auto 30px;
  text-align: center;
}

/* 8) Wrap (มีผลเฉพาะเมื่อมี .wrap จริง) */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
@media (max-width:768px){
  .wrap{ padding-left:14px; padding-right:14px; }
}

/* 9) HR / divider */
hr, .divider{
  border:none;
  height:1px;
  background: linear-gradient(90deg, transparent, var(--line-soft), transparent);
  margin: 26px 0;
}

/* 10) Social icon hover */
.iconbtn{
  transition: transform var(--dur-fast) var(--ease-lux), box-shadow var(--dur-med) var(--ease-lux);
}
.iconbtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}

/* 11) Gold text utilities */
.goldMain{ color: var(--gold-main) !important; }
.goldSub{  color: var(--gold-soft) !important; }

/* =========================================
   98_final_polish.css  (SAFE OVERRIDES)
   ========================================= */

/* 1) Header: gold for icons / pills near brand */
.siteHeader .iconbtn{
  border: 1px solid rgba(201,168,106,.35);
  background: rgba(0,0,0,.22);
  box-shadow: 0 0 0 1px rgba(201,168,106,.10);
}

.siteHeader .iconbtn:hover{
  border-color: rgba(201,168,106,.70);
  box-shadow: 0 0 0 1px rgba(201,168,106,.22), 0 12px 24px rgba(0,0,0,.35);
  transform: translateY(-1px);
}

/* ไอคอนข้างในให้เป็นทอง (รองรับ svg / icon font) */
.siteHeader .iconbtn svg,
.siteHeader .iconbtn i{
  color: var(--gold);
  fill: var(--gold);
}

/* =========================================
   HERO: goldline (mini) not overlapping h1
   ========================================= */

.page--index2 .heroText .goldline{
  display: inline-block;          /* กัน margin พฤติกรรมแปลก */
  margin: 0 0 10px;               /* ช่องไฟล่างก่อน h1 */
  padding: 0;                     /* กัน padding แปลกจากไฟล์อื่น */
  line-height: 1.25;              /* ป้องกันชน */
  font-size: 14px;                /* mini คุมขนาด */
  letter-spacing: .03em;
  color: var(--gold);
  position: relative;             /* กันโดน absolute จากที่อื่น */
  top: auto;
}

.page--index2 .heroText h1{
  margin-top: 0;                  /* กัน margin collapse แปลก ๆ */
  line-height: 1.15;
  padding-top: 0;
}

/* =========================================
   HERO: Quote card spacing + prevent overflow
   ========================================= */

.page--index2 .quoteCard{
  padding: 22px 22px;             /* เพิ่มพื้นที่หายใจใน card */
  box-sizing: border-box;
  overflow: hidden;               /* กันตัวอักษรล้นขอบ */
}

/* กล่องหัวข้อบนของ quote */
.page--index2 .quoteCard .quoteTop{
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* หัวข้อ A gentle space */
.page--index2 .quoteCard .leftTitle{
  margin: 0 0 4px;
  line-height: 1.2;
  letter-spacing: .02em;
}

/* บรรทัด to return to yourself. (ที่เป็น inline style) */
.page--index2 .quoteCard .quoteTop > div:last-child{
  line-height: 1.35;
}

/* ตัว quote หลัก */
.page--index2 .quoteCard .quote{
  margin: 0;                      /* กัน margin ดันชนขอบ */
  line-height: 1.75;
  max-width: 100%;
  overflow-wrap: anywhere;         /* กันคำยาว ๆ ดันออกนอก card */
}

/* =========================================
   Footer final fix
   ========================================= */

footer{
  text-align: center;          /* อยู่กึ่งกลาง */
  padding: 28px 16px 32px;
  color: rgba(245,246,248,.92);  /* copyright สีขาว */
  font-size: 13px;
  letter-spacing: .02em;
}

/* คำว่า Heart Stillness Healing เป็นสีทอง */
footer .gold{
  color: var(--gold);
  font-weight: 500;
}


/* ===============================
   CONTACT CARD – 2 COLUMN LAYOUT
   =============================== */

.contactGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;   /* ซ้าย 1 / ขวา 1 */
  gap: 28px;
  align-items: stretch;
}

/* กล่องซ้าย: เนื้อหา */
.contactGrid .note{
  padding: 28px 28px;
  line-height: 1.8;
}

/* กล่องขวา: ปุ่ม LINE */
.contactGrid .lineCta{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;

  padding: 28px 28px;
  border-radius: 22px;
  background: rgba(18,20,24,.55);
  border: 1px solid rgba(201,168,106,.25);
}

/* หัวข้อ LINE */
.lineCtaTitle{
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* ปุ่มให้ใหญ่ขึ้น */
.contactGrid .lineCta .btn{
  padding: 14px 26px;
  font-size: 16px;
  border-radius: 999px;
  width: fit-content;
}

/* ปุ่มทอง (LINE OA) */
.contactGrid .lineCta .btn.primary{
  background: linear-gradient(180deg, #d6b87c, #a8874f);
  color: #111;
  box-shadow: 0 10px 28px rgba(201,168,106,.45);
}

/* ปุ่มรอง (LINE Shop) */
.contactGrid .lineCta .btn:not(.primary){
  border: 1px solid rgba(201,168,106,.45);
  color: var(--gold);
}

/* Mobile: กลับเป็น 1 คอลัมน์ */
@media (max-width: 768px){
  .contactGrid{
    grid-template-columns: 1fr;
  }
}

/* ===============================
   GOLD BUTTON – LINE CTA
   =============================== */

/* ปุ่ม LINE OA และ LINE SHOP ให้เป็นทองเหมือนกัน */

.contactGrid .lineCta .btn{
  padding: 16px 28px;
  font-size: 16px;
  border-radius: 999px;
  width: fit-content;

  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%);
  color: #1a1a1a;
  font-weight: 500;

  border: none;
  box-shadow:
    0 8px 22px rgba(201,168,106,.45),
    inset 0 1px 0 rgba(255,255,255,.35);

  transition: all .25s ease;
}

/* Hover effect */
.contactGrid .lineCta .btn:hover{
  transform: translateY(-1px);
  box-shadow:
    0 12px 30px rgba(201,168,106,.55),
    inset 0 1px 0 rgba(255,255,255,.45);
}

/* ให้ปุ่มสองอันหน้าตาเหมือนกัน */
.contactGrid .lineCta .btn.primary{
  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%);
  color: #1a1a1a;
}

/* FORCE GOLD BUTTONS (LINE OA + LINE SHOP) */
#contact .lineCta a.btn{
  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%) !important;
  color: #1a1a1a !important;
  border: none !important;

  padding: 16px 28px !important;
  font-size: 16px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;

  box-shadow:
    0 12px 30px rgba(201,168,106,.55) !important,
    inset 0 1px 0 rgba(255,255,255,.45) !important;
}

/* hover */
#contact .lineCta a.btn:hover{
  transform: translateY(-1px) !important;
  box-shadow:
    0 16px 40px rgba(201,168,106,.65) !important,
    inset 0 1px 0 rgba(255,255,255,.55) !important;
}

/* กันกรณี .primary ถูกตั้งให้คนละสี */
#contact .lineCta a.btn.primary{
  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%) !important;
  color: #1a1a1a !important;
}

/* FORCE GOLD HERO PRIMARY BUTTON */
.ctaRow a.btn.primary{
  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%) !important;
  color: #1a1a1a !important;
  border: none !important;

  padding: 14px 26px;
  font-size: 15px;
  border-radius: 999px;
  font-weight: 600;

  box-shadow:
    0 10px 26px rgba(201,168,106,.55),
    inset 0 1px 0 rgba(255,255,255,.45);
}

/* hover effect */
.ctaRow a.btn.primary:hover{
  transform: translateY(-1px);
  box-shadow:
    0 14px 36px rgba(201,168,106,.65),
    inset 0 1px 0 rgba(255,255,255,.55);
}

/* FORCE BRAND DOT TO GOLD */
.siteHeader .brand .dot{
  background: linear-gradient(180deg, #e0c58a 0%, #b89455 100%) !important;
  box-shadow:
    0 0 0 1px rgba(201,168,106,.45),
    0 0 10px rgba(201,168,106,.65);
}

/* ===== Touch devices: reduce heavy effects ===== */
@media (hover: none) and (pointer: coarse){
  /* ตัด hover lift ที่ทำให้คำนวณเงาหนัก ๆ */
  .card:hover,
  .cardLink:hover,
  .btn:hover{
    transform: none !important;
    box-shadow: none !important;
  }

  .card::after,
  .cardLink::after{
    display: none !important;
  }

  /* ลด transition ให้เบาลง */
  *{
    transition-duration: 0ms !important;
  }
}

@media (max-width: 1024px){
  html{ scroll-behavior: auto !important; }
}

@media (max-width: 1024px){
  body{
    text-rendering: auto !important;
  }
}

/* =========================================
   SYSTEM LOCK: Badge should never stretch
   ========================================= */

/* ล็อคพฤติกรรม badge ทุกแบบ: ไม่ให้กว้างเต็ม */
.badge{
  width: auto !important;
  max-width: max-content !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
}

/* เฉพาะ best seller ใน packages */
#packages .bestSellerCard{
  position: relative;
}

#packages .bestSellerCard .badge.bestSeller{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;

  padding: 7px 12px;
  border-radius: 999px;

  font-size: 12px;
  line-height: 1;
  letter-spacing: .04em;
  font-weight: 700;

  background: rgba(201,168,106,.16);
  border: 1px solid rgba(201,168,106,.55);
  color: rgba(245,246,248,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* กันหัวข้อโดนทับบน desktop */
#packages .bestSellerCard h3{
  padding-top: 30px;
}

/* มือถือ: badge ลงมาอยู่ใน flow (กันทับข้อความบน SE/6S) */
@media (max-width: 390px){
  #packages .bestSellerCard .badge.bestSeller{
    position: static !important;
    margin: 0 0 10px 0;
  }
  #packages .bestSellerCard h3{
    padding-top: 0;
  }
}

/* =========================================
   SYSTEM LOCK: CTA Row should never overlap
   ========================================= */

/* ใช้ได้ทั้ง shop.html / product pages */
.ctaRow{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.ctaRow .btn,
.ctaRow a.btn,
.ctaRow .btnPrimary,
.ctaRow .btnGhost{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  white-space: normal;
  line-height: 1.15;

  min-height: 44px;      /* tap target iOS */
  padding: 12px 14px;
}

/* Small phones: stack vertically 100% */
@media (max-width: 390px){
  .ctaRow{
    flex-direction: column;
    align-items: stretch;
  }

  .ctaRow .btn,
  .ctaRow a.btn,
  .ctaRow .btnPrimary,
  .ctaRow .btnGhost{
    width: 100%;
  }
}

/* =========================================
   LOCK FIX: shop.html product cards
   - fix narrow cards + CTA overlap on small iPhones (incl. iPhone 6/6S)
   - MUST be at the very end of 98_final_polish.css
   ========================================= */

@media (max-width: 420px){

  /* 1) reclaim width (side padding is eating space) */
  body .section .container,
  body main .container{
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* 2) force product grid to 1 column full width */
  body .productGrid{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
  }

  /* 3) force each card to full width (kill hidden max-width/margins) */
  body .productGrid > .pCard{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 4) prevent content from pushing layout */
  body .productGrid .pBody{
    min-width: 0 !important;
  }

  /* 5) CTA button: never overflow, never overlap */
  body .productGrid .pBtn{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

    white-space: normal !important;       /* allow wrap */
    overflow-wrap: anywhere !important;   /* break long strings */
    word-break: break-word !important;

    text-align: center !important;
    line-height: 1.25 !important;
    padding: 12px 12px !important;
    min-height: 44px !important;          /* tap target */
  }
}

/* ================================
   SITE FOOTER – STANDARD (KRUNIKI)
   ================================ */
.siteFooter{
  width: 100%;
  padding: 28px 16px 36px;
  text-align: center;

  font-size: 14px;
  letter-spacing: 0.3px;

  color: rgba(255,255,255,0.65);
  background: transparent;

  display: flex;
  justify-content: center;
  align-items: center;
}

/* gold text */
.siteFooter .gold{
  color: var(--gold);
  font-weight: 500;
}

/* =========================================
   FOOTER — FORCE CENTER (DESKTOP FIX)
   file: asset/css2/98_final_polish.css
========================================= */

footer.siteFooter{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  text-align: center;
  padding: 26px 16px;
  margin-top: 40px;

  color: rgba(255,255,255,.75);
  font-size: 14px;
  line-height: 1.3;
}

/* ถ้า container เดิมมี max-width ให้จัดกลางอยู่แล้ว แต่กันพลาด */
footer.siteFooter .container{
  width: 100%;
  display: flex;
  justify-content: center;
}

/* กัน “โดน section/ctaBox ดูด” ถ้าใครเผลอวาง footer ไว้ใน section */
.section footer,
.closingCtaSection footer{
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
}

/* =========================================
   SHOP EBOOK: CTA -> FOOTER POSITION FIX
   file: asset/css2/98_final_polish.css
========================================= */

/* A) ลดพื้นที่ท้าย CTA เพื่อไม่ให้ footer หล่นลงไป */
body.page--shop-ebook .closingCtaSection{
  padding-bottom: 16px !important;  /* ดัน footer ขึ้น */
  margin-bottom: 0 !important;
  min-height: auto !important;
  height: auto !important;
}

/* กัน element สุดท้ายของ CTA สร้างช่องว่างล่าง */
body.page--shop-ebook .closingCtaSection *:last-child{
  margin-bottom: 0 !important;
}

/* B) บังคับ footer ให้อยู่ "กึ่งกลาง" และกระชับเหมือน shop.html */
body.page--shop-ebook footer.siteFooter{
  width: 100%;
  margin: 10px 0 0 !important;     /* ดันขึ้นมาใกล้ CTA */
  padding: 18px 16px !important;
  display: flex;                   /* เห็นในรูปว่ามันเป็น flex อยู่แล้ว */
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* กันกรณีมี container ใน footer (บางหน้าใช้) */
body.page--shop-ebook footer.siteFooter > *{
  margin: 0 !important;
}

