/* ==========================================================
   PORNMAYA PERFUME — เว็บไซต์แบรนด์
   ลุค "Frosted Atelier" — กระจกฝ้า (frosted glass) + editorial โปร่ง
   สีและฟอนต์ยึดจากโลโก้จริง + กล่องสินค้า (royal blue #1B3AC9)

   ⚠️ กฎเหล็กของไฟล์นี้: ไม่มี JavaScript · ไม่มีไฟล์นอก · ไม่มี request ออกนอกเว็บ
   ⚠️ กระจกฝ้าเป็น "ของแต่ง" ไม่ใช่ "ของที่ต้องมี" — เบราว์เซอร์ที่เบลอไม่ได้
      ต้องยังเห็นพื้นทึบ + ขอบ + เงา แล้วดูจบงานอยู่แล้ว
      (วัดจริง 30 ก.ค. 2569: refraction แบบ Apple ทำงานแค่ Chrome/Edge
       และตรวจ feature ไม่ได้เลย → เว็บนี้จึงใช้แค่ blur ตัวเดียว)
   ========================================================== */

:root {
  --accent:        #1B3AC9;
  --accent-hover:  #152C9E;
  --accent-active: #101F70;
  --accent-soft:   #EAEDFB;

  --ink:           #14183A;
  --ink-muted:     #5B628A;
  --ink-faint:     #98A0BD;

  --canvas:        #FFFFFF;
  --surface:       #F5F6FA;   /* เท่ากับพื้นหลังในรูปถ่ายสินค้า */
  --border:        #E6E9F4;

  --font-thai:  "IBM Plex Sans Thai", system-ui, -apple-system, "Tahoma", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --wrap: 1140px;
  --shadow-sm: 0 2px 8px rgba(20, 24, 60, 0.06);
  --shadow-md: 0 8px 28px rgba(20, 24, 60, 0.10);
  --shadow-lg: 0 18px 48px rgba(20, 24, 60, 0.14);

  /* โทเค็นกระจกฝ้า */
  --glass-bg:      rgba(255, 255, 255, 0.64);
  --glass-bg-hi:   rgba(255, 255, 255, 0.80);
  --glass-edge:    rgba(255, 255, 255, 0.75);
  --glass-lip:     inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --radius:   15px;
  --radius-lg: 22px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-thai);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;          /* ≥1.7 กันสระ/วรรณยุกต์ไทยชนกัน */
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;         /* กันจอมือถือเลื่อนซ้ายขวา */
}

/* ตัวกันชนเผื่อไว้ (ยังไม่เคยเจอปัญหาจริง): ภาษาไทยไม่มีเว้นวรรคระหว่างคำ
   ถ้าเบราว์เซอร์ตัวไหนไม่มีดิกชันนารีตัดคำไทย มันจะมองประโยคยาวเป็น "คำเดียว"
   แล้วดันทะลุขอบจอ · break-word จะทำงานเฉพาะตอนที่บรรทัดไม่พอจริงๆ เท่านั้น
   จึงไม่กระทบการตัดคำปกติเมื่อเบราว์เซอร์ตัดคำไทยได้เอง */
body, p, li, h1, h2, h3, h4, dt, dd, summary, .lead, .shop-note {
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 0 0 10px 0; z-index: 200;
}
.skip-link:focus { left: 0; text-decoration: none; color: #fff; }

/* ---------- ตัวอักษรละตินสไตล์แบรนด์ (serif เฉพาะละติน ห้ามครอบไทย) ---------- */
.serif {
  font-family: var(--font-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 16px; font-weight: 600; }
h1 { font-size: clamp(28px, 4.4vw, 44px); letter-spacing: -0.01em; }
h2 { font-size: clamp(23px, 3vw, 32px); letter-spacing: -0.01em; }
h3 { font-size: 19px; }

p { margin: 0 0 16px; }
.lead { font-size: 18px; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; }

/* ==========================================================
   กระจกฝ้า — คลาสกลาง
   ทึบพอให้อ่านออกเสมอ แม้เบราว์เซอร์จะไม่เบลอให้
   ========================================================== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-md), var(--glass-lip);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

/* พื้นไล่สีสำหรับวางกระจก — ถ้าไม่มีสีข้างหลัง กระจกฝ้าจะมองไม่เห็น */
.aura {
  position: relative;
  background:
    radial-gradient(58% 68% at 12% 6%,  rgba(27, 58, 201, 0.22), transparent 62%),
    radial-gradient(52% 60% at 92% 14%, rgba(126, 58, 201, 0.18), transparent 60%),
    radial-gradient(70% 70% at 70% 96%, rgba(201, 58, 138, 0.13), transparent 64%),
    linear-gradient(168deg, #F2F4FE 0%, #F7F5FC 52%, #FDF6FA 100%);
}

/* ---------- หัวเว็บ ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(230, 233, 244, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  backdrop-filter: blur(18px) saturate(165%);
}

/* เบราว์เซอร์ที่เบลอไม่ได้ → ทึบขึ้นเพื่อให้เมนูอ่านออกแน่นอน */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { background: rgba(255, 255, 255, 0.97); }
  .glass { background: rgba(255, 255, 255, 0.93); }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  flex-wrap: wrap;
}

.brand img { height: 34px; width: auto; }

.nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: var(--ink);
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;            /* เป้าแตะบนมือถือ */
  padding: 12px 26px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(27, 58, 201, 0.24);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn:active { background: var(--accent-active); transform: translateY(1px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent);
  border-color: rgba(27, 58, 201, 0.35);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 68px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 28px; }

/* ขวดน้ำหอมนั่งในกรอบกระจก */
.hero-figure {
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--glass-bg-hi);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-lg), var(--glass-lip);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.hero-figure img {
  border-radius: 14px;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

/* ---------- ชิปความน่าเชื่อถือ ---------- */
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  padding: 0;
  list-style: none;
}

.trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink);
  background: var(--glass-bg-hi);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-sm), var(--glass-lip);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.trust svg { width: 16px; height: 16px; flex: none; color: var(--accent); }

/* ---------- หัวหน้าใน (page hero แบบเตี้ย) ---------- */
.page-head {
  padding: 60px 0 52px;
  border-bottom: 1px solid var(--border);
}
.page-head p:last-child { margin-bottom: 0; }
.page-head .lead { max-width: 660px; }

/* ---------- ส่วนเนื้อหา ---------- */
section { padding: 66px 0; }
section.tint { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 660px; margin-bottom: 38px; }
.section-head p:last-child { margin-bottom: 0; }

/* ---------- กริดสินค้า ---------- */
.grid {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.card-media { background: var(--surface); }
.card-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }

.card-body { padding: 16px 18px 20px; }
.card-body h3 {
  font-family: var(--font-serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 6px;
}
.card-body p { margin: 0; font-size: 14px; color: var(--ink-muted); line-height: 1.65; }

/* ---------- กล่องข้อมูล 3 ช่อง ---------- */
.cols {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
  border-radius: var(--radius);
  padding: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-md), var(--glass-lip);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.panel h3 { margin-bottom: 10px; }
.panel p:last-child { margin-bottom: 0; }

/* บนพื้นทึบ (ไม่มีสีข้างหลังให้เบลอ) ใช้การ์ดขาวธรรมดา */
.panel-plain {
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.panel-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 14px;
}

/* ---------- แถวช่องทางซื้อ (แบบชิป) ---------- */
.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.channel:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- แถวช่องทางซื้อ (แบบรายการเต็มความกว้าง — ใช้บนมือถือ) ---------- */
.shop-list { display: grid; gap: 12px; }

.shop-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.shop-row:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.shop-row .shop-name { font-weight: 500; }
.shop-row .shop-note { display: block; font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; }
.shop-row .chev { margin-left: auto; color: var(--ink-faint); flex: none; }
.shop-row:hover .chev { color: var(--accent); }

/* ---------- แถบแจ้งข้อมูล ---------- */
.note {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(27, 58, 201, 0.16);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 26px;
}
.note svg { width: 19px; height: 19px; flex: none; color: var(--accent); margin-top: 3px; }
.note p { margin: 0; }

/* ---------- บล็อกติดต่อเน้นอีเมล ---------- */
.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}

.contact-email {
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 600;
  overflow-wrap: anywhere;   /* อีเมลตัวใหญ่ต้องตัดได้เสมอ ห้ามทะลุขอบการ์ด */
}

/* ตารางข้อมูลนิติบุคคล
   🐛 บั๊กเดิม (เจอ 30 ก.ค. 2569 · มีทั้งบน prod): ล็อกคอลัมน์ป้ายชื่อไว้ 170px ตายตัว
      แต่การ์ดนี้อยู่ใน .cols ที่แตกเป็น 2 คอลัมน์ตอนจอ ~620px → การ์ดกว้างแค่ ~290px
      เหลือที่ให้คอลัมน์ค่าแค่ ~44px → ชื่อบริษัท/ที่อยู่แตกทีละคำ
      และ "admin@pornmaya.com" ตัดไม่ได้จึง "ทะลุขอบการ์ด" ออกมา
      media query เดิมดูที่ความกว้าง "จอ" (≤560px) ซึ่งไม่ช่วย เพราะปัญหาอยู่ที่ความกว้าง "การ์ด"
   ✅ แก้: ใช้ container query วัดความกว้างการ์ดเอง + ให้อีเมล/URL ตัดได้เสมอ */
dl.facts {
  margin: 0;
  container-type: inline-size;
}
dl.facts div {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr);
  gap: 10px 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
dl.facts div:last-child { border-bottom: 0; }
dl.facts dt { color: var(--ink-muted); font-size: 14px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }  /* อีเมล/URL ยาวๆ ต้องตัดได้ ห้ามทะลุขอบ */

/* การ์ดแคบ → วางป้ายชื่อไว้บรรทัดบน ค่าไว้บรรทัดล่าง (ไม่สนว่าจอกว้างเท่าไหร่) */
@container (max-width: 430px) {
  dl.facts div { grid-template-columns: 1fr; gap: 2px; padding: 11px 0; }
}

/* ---------- คำถามที่พบบ่อย (ไม่ใช้ JS — details/summary ของเบราว์เซอร์) ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }

.faq details {
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 17px 22px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  font-size: 21px;
  color: var(--accent);
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq-body { padding: 16px 22px 20px; color: var(--ink-muted); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- เนื้อหายาว (นโยบาย) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 42px; font-size: 22px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }

/* ---------- ท้ายเว็บ ---------- */
.site-footer {
  background: var(--ink);
  color: #C7CBE0;
  padding: 56px 0 30px;
  font-size: 14.5px;
  line-height: 1.8;
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  gap: 34px;
  grid-template-columns: 1.6fr 1fr 1fr;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-brand-name {
  font-family: var(--font-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  font-size: 17px;
  margin-bottom: 14px;
}

.footer-grid h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }

.footer-legal {
  padding-top: 22px;
  font-size: 13.5px;
  color: #98A0BD;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

/* ---------- จอเล็ก ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-figure { order: -1; }          /* มือถือ: เห็นขวดก่อน แล้วค่อยอ่าน */
}

/* มือถือ: เมนู 5 อันใส่บรรทัดเดียวไม่พอ ถ้าปล่อยให้ตกบรรทัดจะเหลือ "ติดต่อเรา" โดดอันเดียว
   → วางโลโก้บรรทัดบน เมนูบรรทัดล่างเลื่อนซ้ายขวาได้ (ซ่อนแถบเลื่อนไว้) */
@media (max-width: 620px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    gap: 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

@media (max-width: 560px) {
  .site-header .wrap { min-height: 0; padding-block: 13px; }
  .nav a { font-size: 14px; }
  section { padding: 48px 0; }
  .hero { padding: 40px 0 44px; }
  h1 { font-size: 28px; }
  .lead { font-size: 16.5px; }
  .panel { padding: 22px; }
  .contact-card { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  dl.facts div { grid-template-columns: 1fr; gap: 2px; padding: 11px 0; }
}

/* ---------- เคารพการตั้งค่าผู้ใช้ ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .shop-row:hover, .btn:active { transform: none; }
}

@media print {
  .site-header, .skip-link { position: static; }
  .glass, .panel, .hero-figure, .trust li {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #fff; box-shadow: none;
  }
}
