/* =========================================================
   Suriya9 — main stylesheet
   แปลงจาก Figma (node 264:907 "Home") ให้ตรงดีไซน์
   ========================================================= */

/* ---------- Fonts ---------- */
/* Sao Chingcha — ฟอนต์ display สำหรับหัวข้อใหญ่ */
@font-face {
  font-family: "Sao Chingcha";
  src: url("../fonts/SaoChingcha-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sao Chingcha";
  src: url("../fonts/SaoChingcha-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sao Chingcha";
  src: url("../fonts/SaoChingcha-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Sukhumvit Set — ฟอนต์ body/UI */
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-Thin.woff2?v=2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-Light.woff2?v=2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-Text.woff2?v=2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-Medium.woff2?v=2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-SemiBold.woff2?v=2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("../fonts/SukhumvitSet-Bold.woff2?v=2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --font-display: "Sao Chingcha", "Sukhumvit Set", sans-serif;
  --font-body: "Sukhumvit Set", -apple-system, "Segoe UI", sans-serif;

  --gold:        #cea934;
  --gold-text:   #bd9a4b;
  --gold-deep:   #94641e;
  --gold-soft:   #a67c1e;
  --ink:         #2e2e2e;
  --white:       #ffffff;
  --glass-bg:    rgba(149, 149, 149, 0.2);
  --glass-border:#ffffff;

  --pad-x: 64px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px; /* header สูง 83px → กดลิงก์ไปส่วนอื่น (#anchor) เว้นด้านบน 90px ทั้งเว็บ */
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* ===== Scroll-reveal อนิเมชั่น (ใช้ทุกหน้า) ===== */
.has-reveal .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.has-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .has-reveal .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* เต็มความกว้างจอ — เนื้อหาแต่ละ section จัดกึ่งกลางเอง */
.s9-page {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: var(--white);
}

/* =========================================================
   HEADER  (Figma node 264:1750)
   ========================================================= */
.s9-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 90;
  display: flex;
  align-items: center;
  padding: 24px var(--pad-x) 0;
  transition: padding 0.25s ease;
}
/* ย่อ padding ลงเล็กน้อยเมื่อเลื่อน (ผ่าน JS ใส่ .is-scrolled) */
.s9-header.is-scrolled { padding-top: 12px; padding-bottom: 12px; }

.s9-header__inner {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* กล่องโลโก้ทรงกระจกฝ้า */
.s9-logo {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  height: 83px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.s9-logo img {
  width: 56px;
  height: 63px;
  object-fit: contain;
  object-position: bottom;
  opacity: 0.8;
}

/* แถบเมนูทรงกระจกฝ้า */
.s9-nav {
  flex: 1 0 0;
  min-width: 0;
  height: 83px;
  display: flex;
  align-items: center;
  padding: 10px 54px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.s9-nav__row {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}
.s9-nav__menu {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  line-height: 26.25px;
  text-align: center;
  white-space: nowrap;
}
.s9-nav__menu a {
  color: var(--ink);
  transition: color 0.2s ease;
}
.s9-nav__menu a:hover { color: var(--gold-deep); }
/* หน้าปัจจุบัน — รองรับทั้ง fallback (.is-active) และเมนู WordPress จริง (current-*) */
.s9-nav__menu > li > a.is-active,
.s9-nav__menu > li.current-menu-item > a,
.s9-nav__menu > li.current_page_item > a,
.s9-nav__menu > li.current-menu-parent > a,
.s9-nav__menu > li.current-menu-ancestor > a,
.s9-nav__menu > li.current_page_parent > a,
.s9-nav__menu > li.current_page_ancestor > a {
  color: var(--gold-deep);
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.5);
}

/* ===== Dropdown เมนู (hover) ===== */
.s9-nav__menu { height: 100%; }
.s9-nav__menu > li {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
/* ลูกศรบอกว่ามีเมนูย่อย */
.s9-nav__menu > li.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  opacity: 0.75;
}
/* กล่องเมนูย่อยเปิด → ลูกศรหมุนกลับหัวชี้ขึ้น */
.s9-nav__menu > li.menu-item-has-children:hover > a::after {
  transform: translateY(2px) rotate(-135deg);
}
/* ปุ่มพับ/กางเมนูย่อย — ใช้เฉพาะในลิ้นชักมือถือ (main.js สร้าง) */
.s9-sub-toggle { display: none; }
/* กล่อง dropdown */
.s9-nav__menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0; /* ขอบซ้ายของกล่อง = จุดเริ่มของชื่อเมนู */
  transform: translateY(10px);
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 6px;
  background: var(--white);
  border: 1px solid rgba(206, 169, 52, 0.3);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
}
/* สะพาน hover กันเมนูปิดตอนเลื่อนเมาส์ลง */
.s9-nav__menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}
.s9-nav__menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(2px);
}
.s9-nav__menu .sub-menu li { width: 100%; }
.s9-nav__menu .sub-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}
.s9-nav__menu .sub-menu a:hover,
.s9-nav__menu .sub-menu > li.menu-item-has-children:hover > a {
  background: #f7f0e1;
  color: var(--gold-deep);
}

/* ===== เมนูชั้นที่ 3 (สินค้า › หีบศพ › หมวด) — กางออกด้านขวาของกล่องแรก ===== */
.s9-nav__menu .sub-menu > li { position: relative; }
.s9-nav__menu .sub-menu > li.menu-item-has-children > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.s9-nav__menu .sub-menu > li.menu-item-has-children > a::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #b8923a;
  border-bottom: 1.5px solid #b8923a;
  transform: rotate(-45deg);
}
.s9-nav__menu .sub-menu .sub-menu {
  top: -7px;
  left: 100%;
  min-width: 190px;
  margin-left: 10px;
  transform: translateX(6px);
}
.s9-nav__menu .sub-menu .sub-menu::before {
  top: 0;
  bottom: 0;
  left: -12px;
  right: auto;
  width: 12px;
  height: auto;
}
.s9-nav__menu .sub-menu > li:hover > .sub-menu,
.s9-nav__menu .sub-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

/* ===== Animation ของ header ===== */
@media (prefers-reduced-motion: no-preference) {
  /* (3) เปิดหน้า: โลโก้ + แถบเมนูค่อย ๆ เลื่อนลงมา 1 ครั้ง
     จบแล้วไม่เหลือ transform ค้าง (fill: backwards) — ลิ้นชักเมนูมือถือที่เป็น position:fixed จึงไม่ถูกขัง */
  .s9-header__inner { animation: s9-header-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s backwards; }

  /* (4) เมนูย่อย: รายการไล่ขึ้นทีละบรรทัดตอนกล่องเปิด — เฉพาะจอใหญ่ (ลิ้นชักมือถือกางตลอด) */
  @media (min-width: 1200px) {
    .s9-nav__menu .sub-menu > li {
      opacity: 0;
      transform: translateY(6px);
      transition: opacity 0.15s ease, transform 0.15s ease;
    }
    .s9-nav__menu li:hover > .sub-menu > li,
    .s9-nav__menu li:focus-within > .sub-menu > li {
      opacity: 1;
      transform: none;
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(1), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(1) { transition-delay: 0.04s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(2), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(2) { transition-delay: 0.08s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(3), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(3) { transition-delay: 0.12s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(4), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(4) { transition-delay: 0.16s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(5), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(5) { transition-delay: 0.2s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(6), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(6) { transition-delay: 0.24s; }
    .s9-nav__menu li:hover > .sub-menu > li:nth-child(n+7), .s9-nav__menu li:focus-within > .sub-menu > li:nth-child(n+7) { transition-delay: 0.28s; }
  }
}
@keyframes s9-header-in {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: none; }
}

/* ปุ่มติดต่อเรา */
.s9-btn-contact {
  flex-shrink: 0;
  width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  background: var(--white);
  border: 1px solid var(--gold);
  border-radius: 100px;
  filter: drop-shadow(0 10px 12px rgba(166, 124, 30, 0.4));
  color: var(--gold-text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.16px;
  line-height: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.s9-btn-contact:hover { transform: translateY(-1px); }

/* =========================================================
   ปุ่ม reusable
   ========================================================= */
.s9-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.16px;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
  filter: drop-shadow(0 10px 12px rgba(166, 124, 30, 0.4));
  transition: transform 0.2s ease, filter 0.2s ease;
}
.s9-btn:hover { transform: translateY(-1px); }

.s9-btn--gold {
  background-image: linear-gradient(93.55deg, #a67c1e 1.52%, #d4af37 99.43%);
  color: #fffdf6;
}
.s9-btn--outline {
  width: 190px;
  background: var(--white);
  border-color: var(--gold);
  color: var(--gold-text);
}

/* =========================================================
   HERO  (Figma nodes 264:911 / 264:912 / 473:2969)
   ========================================================= */
.s9-hero {
  position: relative;
  width: 100%;
  height: 720px;
  background-image: url("../images/home/funeral-hero-background.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.s9-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
  to bottom,
  #d9d9d900 20%,
  #e8e8e840 50%,
  #e8e8e855 80%,
  #e8e8e850 90%,
  #ffffff 100%
);
  z-index: 0;
  pointer-events: none;
}

/* บล็อกเนื้อหา hero — เริ่มที่ y=246 ตาม Figma */
.s9-hero__content {
  position: absolute;
  top: 246px;
  left: 0;
  width: 100%;
  height: 232px;
}

.s9-hero__text {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 593px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.s9-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 70px;
  line-height: 84px;
  color: #5c3a21;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  -webkit-text-stroke: 1.5px #ffffff90;
}
.s9-hero__subtitle {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 24px;
  line-height: 1.35;
  color: #333333;
  text-shadow: 0 4px 16px #fff0da;
  -webkit-text-stroke: .5px #fff;
}

.s9-hero__actions {
  position: absolute;
  top: 192px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* =========================================================
   ปุ่มลอยติดต่อ (sticky/fixed)  (Figma node 348:2818)
   ========================================================= */
.s9-floating {
  position: fixed;
  right: 24px;
  bottom: 40px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.s9-floating a {
  display: block;
  width: 90px;
  height: 90px;
  transition: transform 0.2s ease;
}
.s9-floating a:hover { transform: scale(1.06); }
.s9-floating img { width: 90px; height: 90px; }

/* =========================================================
   QUOTE / แนะนำบริการ  (Figma node 331:1074 + bg 2010:2516)
   ========================================================= */
.s9-quote {
  position: relative;
  padding: 40px 0 56px;
  overflow: hidden;
  background: var(--white);
}
/* เฟดขาวไล่จางด้านล่าง — กลบขอบกรอบพื้นหลังลายดอกไม้ */
.s9-quote::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--white) 85%);
  z-index: 0;
  pointer-events: none;
}
/* พื้นหลังลายดอกไม้ทอง (flatten จาก Figma) — ยืดเต็มความกว้างจอ */
.s9-quote__bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  min-width: 1440px;
  height: auto;
  max-width: none;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.s9-quote__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
}
.s9-quote__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.2;
  color: #8c0e0f;
  text-align: center;
  white-space: nowrap;
}
.s9-quote__row {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  width: 958px;
  max-width: 100%;
}
.s9-quote__photo {
  flex-shrink: 0;
  width: 424px;
  height: 335px;
  border: 4px solid var(--white);
  border-radius: 0 100px 0 100px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  background: #d9d9d9;
}
.s9-quote__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.s9-quote__content {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 9px;
}
.s9-quote__lead {
  margin: 0;
  font-family: var(--font-body);
  font-size: 24px;
  letter-spacing: 0.24px;
  color: #333333;
  font-weight: 500;
}
.s9-quote__lead strong {
  color: #8c0e0f;
  font-weight: 600;
}
.s9-quote__desc {
  margin: 0;
  max-width: 476px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.18px;
  color: #333333;
}
.s9-quote__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.s9-quote__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.18px;
  color: #333333;
}
/* ไอคอนลายดอก (crop จากสไปรต์ Figma) */
.s9-emblem {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.s9-emblem img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* =========================================================
   ส่วนที่ใช้ซ้ำ: หัวข้อ section + เส้นคั่นลายทอง
   ========================================================= */
.s9-section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.s9-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.15;
  color: #8c0e0f;
}
.s9-section-sub {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.6;
  color: #545454;
}

/* เส้นคั่นลายทอง (Figma node 264:1056) */
.s9-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 0 var(--pad-x);
}
.s9-divider__line {
  flex: 1 0 0;
  min-width: 0;
  height: 1.5px;
  background: linear-gradient(to right, #bd9a4b, #d1ab35);
}
.s9-divider__orn {
  flex-shrink: 0;
  width: 150px;
  height: 73px;
  object-fit: contain;
  transform: rotate(180deg);
}

/* =========================================================
   PROMOTION  (Figma node 264:1055)
   ========================================================= */
.s9-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 24px 0 12px;
  background: var(--white);
  overflow: hidden;
}
/* พื้นหลังลายดอกไม้ทอง (ด้านขวา) — Figma node 264:1049 */
.s9-promo__bg {
  position: absolute;
  top: 10%;
  right: 0px;
  max-width: none;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.s9-promo > .s9-divider,
.s9-promo > .s9-promo__body {
  position: relative;
  z-index: 1;
}
.s9-promo__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
.s9-promo__cards {
  display: flex;
  align-items: center;
  gap: 24px;
}
.s9-promo__card {
  flex-shrink: 0;
  width: 410px;
  height: 565px;
  border: 4px solid var(--white);
  border-radius: 20px;
  overflow: hidden;
  background: #f3f3f3;
}
.s9-promo__card--tall { height: 600px; }
.s9-promo__card img {
  width: 100%;
  height: 100%;
}

/* จุดสไลด์ (Figma node 331:1181) */
.s9-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.s9-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9c48f;
  display: block;
}
.s9-dots span.is-active { background: var(--gold); }

/* =========================================================
   PACKAGES / แพ็กเกจการจัดงานศพ  (Figma nodes 331:1272 + 331:1279 + 331:1201)
   ========================================================= */
.s9-packages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 32px 0 36px;
  background: var(--white);
}
.s9-packages__grid {
  display: flex;
  gap: 24px;
  padding: 0 var(--pad-x);
}
.s9-pkg-card {
  position: relative;
  flex-shrink: 0;
  width: 421.33px;
  height: 423px;
  overflow: hidden;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.16));
}
.s9-pkg-card--start   { border-radius: 100px 0 0 8px; }
.s9-pkg-card--premium { border-radius: 0 0 100px 0; }

/* เส้นทองไล่เฉดด้านล่าง — เหมือนกันทั้ง 3 ใบ */
.s9-pkg-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(to right, #a67c1e, #d4af37);
  z-index: 1;
  pointer-events: none;
}
/* กรอบเส้นด้านใน (margin frame) */
.s9-pkg-card::before {
  content: "";
  position: absolute;
  inset: 10px 10px 16px 10px;
  background: linear-gradient(to bottom, #ffffff, rgb(255 255 255 / 0%) 250px), linear-gradient(to top, #ffffff85, rgba(255, 255, 255, 0));
  border-radius: 0;
  z-index: 1;
  pointer-events: none;
}
.s9-pkg-card--start::before   { border-radius: 88px 0 0 0; }
.s9-pkg-card--premium::before { border-radius: 0 0 88px 0; }

.s9-pkg-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* white wash เพื่อให้อ่านข้อความได้ (2 gradient ซ้อน ตาม Figma) */
.s9-pkg-card__wash {
  background: linear-gradient(to bottom, #ffffff00, rgb(255 255 255 / 10%) 264px), linear-gradient(to top, #ffffff, rgb(255 255 255 / 0%));
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.s9-pkg-card__body {
  position: absolute;
  top: 117px;
  left: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  padding: 0 8px;
  text-align: center;
}
.s9-pkg-card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.s9-pkg-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  color: #71490e;
}
.s9-pkg-card__desc {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: #545454;
}
.s9-pkg-card__price {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  color: #8c0e0f;
}
.s9-packages__action {
  display: flex;
  justify-content: center;
}

/* =========================================================
   PRODUCTS / โลงศพคุณภาพ  (Figma node 331:1408)
   ========================================================= */
.s9-products {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 28%, #faf4ec 52%, #f6eee1 78%, #f4ebdd 100%);
  padding: 24px 0 24px;
  overflow: hidden;
  border-bottom: 1.5px solid rgba(206, 169, 52, 0.4);
}
.s9-products__bottom-divider { width: 100%; margin-top: 40px; }
.s9-products__inner {
  position: relative;
  max-width: 1294px;
  margin: 0 auto;
  padding: 0 12px;
}
/* ลายมุม (crop จากสไปรต์ 4096 — คมชัด) วางอิงขอบ section ที่ x=64 */
.s9-products__corner {
  position: absolute;
  top: 170px;
  width: 112px;
  height: auto;
  z-index: 1;
  pointer-events: none;
}
.s9-products__corner--tl { left: 64px; }
.s9-products__corner--tr { right: 64px; }

.s9-products .s9-section-head { margin: 65px 0; }

.s9-cat { margin-top: 8px; }
.s9-cat + .s9-cat { margin-top: 40px; }
.s9-cat__label {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  color: #8c0e0f;
}
.s9-cat__labelrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.s9-cat__labelrow .s9-cat__label { margin: 0; }

.s9-cat__row {
  display: flex;
  align-items: flex-start;
  gap: 46px;
  margin-bottom: 36px;
}
.s9-cat__intro {
  flex-shrink: 0;
  width: 209px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 40px;
}
.s9-cat__intro p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  color: #000000;
}
.s9-cat__intro .s9-brand { color: var(--gold-text); }
.s9-cat__intro .s9-btn { align-self: flex-start; }

.s9-coffin-grid {
  display: flex;
  gap: 21px;
}
.s9-coffin {
  width: 242px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.s9-coffin__box {
  width: 242px;
  height: 233px;
  border: 2px solid #ffd066;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* รูปโลงศพ — จัดกลางกล่อง (ตาม export จริง) */
.s9-coffin__box img {
  max-width: 220px;
  max-height: 200px;
  object-fit: contain;
}
/* caption — ใต้กล่อง */
.s9-coffin__name {
  text-align: center;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.3;
  color: #000000;
}

/* =========================================================
   ABOUT / เกี่ยวกับเรา  (Figma section)
   ========================================================= */
.s9-about {
  position: relative;
  overflow: hidden;
  margin-top: 56px;
  padding: 0 0 24px;
  background: var(--white);
}
.s9-about__rose {
  position: absolute;
  top: 40px;
  height: 530px;
  width: auto;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.s9-about__rose--l { left: 0; }
.s9-about__rose--r { right: 0; }

.s9-about__inner {
  position: relative;
  z-index: 1;
  max-width: 1312px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.s9-about .s9-section-head { padding-top:20px ;margin-bottom: 64px; }
.s9-about__row {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}
.s9-about__photo {
  flex-shrink: 0;
  width: 460px;
  height: 460px;
  border: 4px solid var(--white);
  border-radius: 0 100px 8px 100px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}
.s9-about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 100% 5%; }
.s9-about__text {
  flex: 1;
  padding-top: 48px;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
}
.s9-about__text .s9-brand { color: #8c0e0f; font-weight: 600; }
.s9-about__text p { margin: 0; color: #001524; font-weight: 500; }
.s9-about__text p + p { margin-top: 16px; }
.s9-about__divider { margin-top: 40px; }

/* =========================================================
   PORTFOLIO / ผลงานของเรา  (Figma section)
   ========================================================= */
.s9-works {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  background: linear-gradient(to bottom, #ffffff, #fffefb 60%, #fff9ed);
}
.s9-works__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  padding: 0 var(--pad-x);
  margin-bottom: 40px;
}
.s9-works__head,
.s9-works__gallery,
.s9-works__action { position: relative; z-index: 1; }
/* แถบดอกไม้ประดับ — อยู่ล่างสุดของ section */
.s9-works__flowers {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 0;
}
.s9-works__rows {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0;
}
.s9-marquee { overflow: hidden; }
.s9-marquee__track {
  display: flex;
  gap: 20px;
  width: max-content;
}
.s9-marquee--left  .s9-marquee__track { animation: s9-marquee-left 60s linear infinite; }
.s9-marquee--right .s9-marquee__track { animation: s9-marquee-right 60s linear infinite; }
.s9-marquee:hover .s9-marquee__track { animation-play-state: paused; }
.s9-marquee__item {
  flex-shrink: 0;
  width: 222px;
  height: 167px;
  border-radius: 10px;
  overflow: hidden;
}
.s9-marquee__item img { width: 100%; height: 100%; object-fit: cover; }
@keyframes s9-marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes s9-marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
.s9-works__action { display: flex; justify-content: center; margin-top: 40px; padding-bottom: 40px; }

/* =========================================================
   FOOTER  (ดีไซน์ใหม่: พื้นดำ + เส้นทองบน + แถบทองไล่เฉดล่างสุด)
   ========================================================= */
.s9-footer {
  position: relative;
  z-index: 1;
  background: #000;
  border-top: 2px solid #c8921c;
  padding: 44px var(--pad-x) 0;
}
.s9-footer__inner {
  max-width: 1312px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.s9-footer__top { display: flex; gap: 40px; align-items: flex-start; }

/* แบรนด์ (ซ้าย) */
.s9-footer__brand {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.s9-footer__logo { display: flex; align-items: center; gap: 14px; }
.s9-footer__logo img { width: 72px; height: 80px; object-fit: contain; }
.s9-footer__logo span {
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.2px;
}
.s9-footer__desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.6;
}
.s9-footer__social { display: flex; align-items: center; gap: 22px; }
.s9-footer__social-label {
  margin-right: 6px;
  color: #e19c00;
  font-family: var(--font-display);
  font-size: 18px;
}
.s9-footer__social a { opacity: 0.75; transition: opacity 0.2s ease; }
.s9-footer__social a:hover { opacity: 1; }
.s9-footer__social img { width: 22px; height: 22px; }

/* คอลัมน์เมนู 4 ช่องเท่ากัน (ช่องสุดท้าย = เว็บไซต์ต่อ ไม่มีหัวข้อ) */
.s9-footer__menus {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 24px;
  padding-left: 48px;
}
.s9-footer__col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.s9-footer__col-title {
  margin: 0;
  color: #e19c00;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
}
.s9-footer__col-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.5;
}
.s9-footer__col-list a { color: inherit; transition: color 0.2s ease; }
.s9-footer__col-list a:hover { color: #e19c00; }
.s9-footer__contact-item { display: flex; align-items: flex-start; gap: 12px; }
.s9-footer__contact-item img { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; } /* ชิดบรรทัดแรก เมื่อที่อยู่ยาว 2 บรรทัด */

/* เส้นคั่นบาง + แถบทองล่างสุด */
.s9-footer__line { height: 1px; background: rgba(255, 255, 255, 0.12); }
.s9-footer__bar {
  height: 18px;
  margin: 18px calc(-1 * var(--pad-x)) 0;
  background: linear-gradient(90deg, #d6981c 0%, #f2c037 25%, #ffe87a 50%, #f2c037 75%, #d6981c 100%);
}

/* ลิงก์ครอบทั้งการ์ด (การ์ดสินค้า → หน้า single) */
.s9-cardlink { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.s9-coffin:has(> .s9-cardlink),
.dn-card:has(> .s9-cardlink) { position: relative; }
.s9-coffin:has(> .s9-cardlink):hover .s9-coffin__box,
.cf-card:has(> .s9-cardlink):hover { box-shadow: 0 8px 22px rgba(166, 124, 30, .28); }
