/* ==========================================================================
   เหนือ นวดเพื่อสุขภาพ — สไตล์ฝั่งลูกค้า
   ออกแบบแบบ mobile-first ลูกค้าส่วนใหญ่จองจากมือถือ
   ========================================================================== */

:root {
  --green-900: #1d4733;
  --green-700: #2f6f4e;
  --green-500: #4c9b73;
  --green-100: #e5f1ea;
  --sand-100: #f7f4ef;
  --sand-200: #ece5da;
  --ink-900: #22201d;
  --ink-600: #5b564f;
  --ink-400: #8a847b;
  --red-600: #b3402f;
  --red-100: #fbeae7;
  --amber-100: #fdf3e0;
  --amber-700: #9a6a13;
  --blue-100: #e8f0fa;
  --blue-700: #2f5c8f;
  --white: #fff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(34, 32, 29, .09), 0 6px 18px rgba(34, 32, 29, .06);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-900);
  background: var(--sand-100);
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }

a { color: var(--green-700); }

img { max-width: 100%; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.container.narrow { max-width: 640px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--green-700); color: var(--white); padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--sand-200);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink-900); }
.brand-mark {
  background: var(--green-700); color: var(--white);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: .85rem; font-weight: 700;
}
.brand-text { font-weight: 700; font-size: 1.05rem; }

.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a { text-decoration: none; color: var(--ink-600); padding: .35rem 0; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--green-700); font-weight: 600; }
.nav-phone {
  background: var(--green-100); border-radius: 999px;
  padding: .35rem .9rem !important; color: var(--green-900) !important;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--green-900), var(--green-700));
  color: var(--white); padding: 3.5rem 0; text-align: center;
}
.hero-eyebrow { letter-spacing: .18em; font-size: .8rem; opacity: .8; margin: 0 0 .5rem; }
.hero-title { font-size: clamp(1.8rem, 6vw, 2.8rem); margin-bottom: .75rem; }
.hero-sub { opacity: .92; margin: 0 auto 2rem; max-width: 42ch; }

/* ---------- Sections ---------- */
.section { padding: 3rem 0; }
.section-alt { background: var(--sand-200); }
.section-title { font-size: 1.5rem; text-align: center; margin-bottom: 1.75rem; }
.page-title { font-size: 1.6rem; margin: 1.5rem 0 1rem; }
.lead { color: var(--ink-600); }
.muted { color: var(--ink-400); font-weight: 400; font-size: .9rem; }
.hint { color: var(--ink-600); font-size: .9rem; }
.empty-note { text-align: center; color: var(--ink-600); }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--sand-200);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.card-title { font-size: 1.15rem; margin-bottom: .35rem; }
.card-desc { color: var(--ink-600); font-size: .93rem; margin: 0 0 1rem; }

.service-grid, .option-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.shop-gallery {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.shop-gallery-photo {
  width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius);
}

.service-card-photo {
  display: block; width: calc(100% + 2.5rem); max-width: none;
  margin: -1.25rem -1.25rem .9rem; height: 160px;
  object-fit: cover; border-radius: var(--radius) var(--radius) 0 0;
}

.price-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.price-table th, .price-table td { padding: .45rem 0; text-align: left; }
.price-table thead th { color: var(--ink-400); font-weight: 600; font-size: .82rem; border-bottom: 1px solid var(--sand-200); }
.price-table tbody tr + tr td { border-top: 1px dashed var(--sand-200); }
.price-cell { text-align: right; font-weight: 600; white-space: nowrap; }
.option-price { font-weight: 700; color: var(--green-700); margin: 0; }

.cta-box { text-align: center; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .7rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; text-align: center; transition: background .15s, opacity .15s;
}
.btn-lg { padding: .9rem 2rem; font-size: 1.05rem; }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-900); }
.btn-ghost { background: transparent; border-color: var(--sand-200); color: var(--ink-600); }
.btn-ghost:hover { background: var(--sand-200); }
.btn-danger { background: var(--red-600); color: var(--white); }
.btn-danger-ghost { background: transparent; border-color: var(--red-600); color: var(--red-600); }
.btn-danger-ghost:hover { background: var(--red-100); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- หน้ารวมลิงก์ร้าน (links.php) ---------- */
/* ตั้งใจให้เหมือนแอปมือถือเต็มจอ ความกว้างจำกัดแม้เปิดบนแท็บเล็ต/จอใหญ่ */
.linkpage-body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center;
  background: linear-gradient(180deg, var(--green-900), var(--ink-900)) fixed;
  background-size: cover; background-position: center;
  position: relative;
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.linkpage-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, rgba(29,71,51,.75), rgba(34,32,29,.88));
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
}
.linkpage {
  position: relative; z-index: 1;
  width: 100%; max-width: 26rem;
  margin: 0 auto; padding: 2.5rem 1.25rem 3rem;
  text-align: center; color: var(--white);
}
.linkpage-avatar {
  width: 6.5rem; height: 6.5rem; border-radius: 50%; object-fit: cover;
  margin: 0 auto 1rem; display: block; border: 3px solid var(--white); box-shadow: var(--shadow);
}
.linkpage-name { margin: 0 0 .35rem; color: var(--white); }
.linkpage-address { color: var(--sand-100); opacity: .85; font-size: .88rem; margin: 0 0 1.75rem; }
.linkpage-list { display: flex; flex-direction: column; gap: .85rem; }
.linkpage-btn {
  display: flex; align-items: center; gap: .85rem; width: 100%;
  padding: .95rem 1.25rem; border-radius: 999px;
  background: var(--white); border: 1px solid var(--sand-200); color: var(--ink-900);
  font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .1s, background .15s;
}
.linkpage-btn:hover { background: var(--sand-100); }
.linkpage-btn:active { transform: scale(.98); }
.linkpage-btn-primary { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.linkpage-btn-primary:hover { background: var(--green-900); }
.linkpage-icon {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(34, 32, 29, .08);
}
.linkpage-btn-primary .linkpage-icon { background: rgba(255, 255, 255, .18); }
.linkpage-icon svg { width: 1.15rem; height: 1.15rem; }
.linkpage-label { flex: 1; text-align: center; padding-right: 2rem; }
.linkpage-back { margin-top: 2rem; }
.linkpage-back a { color: var(--sand-100); opacity: .75; font-size: .85rem; text-decoration: none; }
.linkpage-back a:hover { opacity: 1; text-decoration: underline; }

:focus-visible { outline: 3px solid var(--green-500); outline-offset: 2px; }

/* ---------- ขั้นตอนการจอง ---------- */
.booking-page { padding-bottom: 3rem; }

.steps {
  display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.5rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.step {
  display: flex; align-items: center; gap: .45rem; white-space: nowrap;
  color: var(--ink-400); font-size: .9rem; padding: .4rem .7rem;
  border-radius: 999px; background: var(--white); border: 1px solid var(--sand-200);
}
.step span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sand-200); color: var(--ink-600); font-size: .78rem; font-weight: 700;
}
.step.is-active { color: var(--green-900); border-color: var(--green-500); }
.step.is-active span { background: var(--green-700); color: var(--white); }
.step.is-done span { background: var(--green-500); color: var(--white); }

.panel {
  background: var(--white); border: 1px solid var(--sand-200);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.panel-title { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.panel-title:first-child { margin-top: 0; }
.panel-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
  margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--sand-200);
  flex-wrap: wrap;
}

/* ---------- ตัวเลือกแบบการ์ด ---------- */
.choice-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.choice { position: relative; display: block; cursor: pointer; }
.choice input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.choice-body {
  display: flex; flex-direction: column; gap: .2rem;
  border: 2px solid var(--sand-200); border-radius: var(--radius-sm);
  padding: .85rem 1rem; height: 100%; background: var(--white);
  transition: border-color .15s, background .15s;
}
.choice:hover .choice-body { border-color: var(--green-500); }
.choice input:checked + .choice-body {
  border-color: var(--green-700); background: var(--green-100);
}
.choice input:focus-visible + .choice-body { outline: 3px solid var(--green-500); outline-offset: 2px; }
.choice-thumb {
  display: block; width: 100%; height: 90px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: .5rem;
}
.choice-title { font-weight: 600; }
.choice-desc { font-size: .85rem; color: var(--ink-600); }
.choice-price { font-weight: 700; color: var(--green-700); }
.duration-choice[hidden] { display: none; }

/* ---------- ฟอร์ม ---------- */
.field { display: block; margin-bottom: 1.15rem; }
.field-label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.req { color: var(--red-600); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; padding: .7rem .85rem;
  border: 1px solid var(--sand-200); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink-900);
}
.field input:focus, .field textarea:focus { border-color: var(--green-500); }
.field textarea { resize: vertical; }
.field-error { display: block; color: var(--red-600); font-size: .87rem; margin-top: .3rem; }
.field.has-error input, .field.has-error textarea { border-color: var(--red-600); }

/* ---------- ช่วงเวลา ---------- */
.slot-grid {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  min-height: 48px;
}
.slot {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .65rem .3rem; border-radius: var(--radius-sm);
  border: 2px solid var(--sand-200); background: var(--white); color: var(--ink-900);
}
.slot:hover { border-color: var(--green-500); }
.slot[aria-pressed="true"] { background: var(--green-700); border-color: var(--green-700); color: var(--white); }
.slot-end { display: block; font-size: .76rem; font-weight: 400; opacity: .75; }

/* ---------- สรุป ---------- */
.summary {
  display: grid; grid-template-columns: minmax(110px, auto) 1fr;
  gap: .5rem 1rem; margin: 0 0 1.25rem;
  background: var(--sand-100); border-radius: var(--radius); padding: 1.15rem;
}
.summary dt { color: var(--ink-600); font-size: .92rem; }
.summary dd { margin: 0; font-weight: 600; }
.summary .total { color: var(--green-700); font-size: 1.2rem; }

.chip {
  display: inline-block; background: var(--green-100); color: var(--green-900);
  border-radius: 999px; padding: .15rem .7rem; font-size: .85rem;
  margin: 0 .3rem .3rem 0; font-weight: 500;
}

/* ---------- แจ้งเตือน ---------- */
.alert {
  border-radius: var(--radius-sm); padding: .9rem 1.1rem;
  margin: 1rem 0; border: 1px solid transparent;
}
.alert-error   { background: var(--red-100);   border-color: #eec6bf; color: var(--red-600); }
.alert-success { background: var(--green-100); border-color: #bcdcc9; color: var(--green-900); }
.alert-info    { background: var(--blue-100);  border-color: #c6d8ec; color: var(--blue-700); }
.alert-warning { background: var(--amber-100); border-color: #ecd9ac; color: var(--amber-700); }

/* ---------- หน้ารายละเอียดการจอง ---------- */
.booking-code { color: var(--ink-600); font-size: .95rem; margin-bottom: .25rem; }

.status-badge {
  display: inline-block; border-radius: 999px; padding: .3rem 1rem;
  font-weight: 700; font-size: .9rem; margin: 0 0 1.25rem;
}
.status-pending    { background: var(--amber-100); color: var(--amber-700); }
.status-confirmed  { background: var(--green-100); color: var(--green-900); }
.status-travelling { background: var(--blue-100);  color: var(--blue-700); }
.status-arrived    { background: var(--blue-100);  color: var(--blue-700); }
.status-in_service { background: #ece2f7; color: #5c3d8a; }
.status-completed  { background: var(--sand-200); color: var(--ink-600); }
.status-cancelled  { background: var(--red-100); color: var(--red-600); }
.status-no_show    { background: var(--red-100); color: var(--red-600); }

.detail-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }

.success-page { text-align: center; }
.success-mark {
  width: 68px; height: 68px; margin: 1rem auto; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 700;
}
.success-page .summary { text-align: left; }

.cancel-form { margin-top: 1.5rem; }

/* ---------- เนื้อหาแบบบทความ ---------- */
.prose h2 { font-size: 1.15rem; margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-900); color: #d9e6de; margin-top: 3rem; padding: 2.5rem 0 1.5rem;
}
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.footer-title { font-size: 1rem; color: var(--white); margin-bottom: .75rem; }
.footer-line { margin: .2rem 0; font-size: .92rem; }
.site-footer a { color: #b9d6c6; }
.copyright {
  text-align: center; font-size: .85rem; opacity: .7;
  margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12);
}

@media (max-width: 480px) {
  .panel { padding: 1.15rem; }
  .panel-actions .btn { flex: 1 1 auto; }
  .summary { grid-template-columns: 1fr; gap: .15rem .5rem; }
  .summary dd { margin-bottom: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
