/* site-menu.css — ไอคอนแชท (ติดต่อแอดมิน) + เมนูโปรไฟล์ที่หัวเว็บ  (ใช้ร่วมกับ site-menu.js)
   เปลี่ยนสีปุ่ม LINE ได้ที่ตัวแปร --sm-line บรรทัดเดียว */
:root {
  --sm-line: #067a37; --sm-line-hover: #05662e;
  /* ขนาดตัวอักษรเมนู: มือถือ = 15 / 12 / 14px (เท่าเดิม) แล้วค่อย ๆ โตตามจอ สูงสุดบนจอใหญ่ */
  --sm-fs-title: clamp(.9375rem, .85rem + .3vw, 1.1875rem);
  --sm-fs-sub:   clamp(.75rem, .68rem + .25vw, .9375rem);
  --sm-fs-row:   clamp(.875rem, .8rem + .3vw, 1.0625rem);
}

/* ซ่อนปุ่ม "ทักไลน์" เดิม (ยังอยู่ใน DOM เพื่อให้ app.js ใส่ลิงก์จาก Settings ให้เหมือนเดิม) */
.sm-on .top .line-btn { display: none; }

.sm-actions { display: flex; align-items: center; gap: var(--s2, .5rem); flex: none; }
.sm-wrap { position: relative; }

.sm-ic {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; height: 44px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--line-2, #cfcfd3); border-radius: 999px; background: #fff; color: var(--ink, #0b0b0c);
  font: inherit; font-size: var(--fs-sm, .8125rem); font-weight: 600; cursor: pointer;
  transition: background-color .18s, border-color .18s, transform .18s;
}
.sm-ic:hover { border-color: var(--ink, #0b0b0c); }
.sm-ic:active { transform: scale(.96); }
.sm-ic[aria-expanded="true"] { background: var(--soft, #f4f4f5); border-color: var(--ink, #0b0b0c); }
.sm-ic svg { width: var(--ico-md, 22px); height: var(--ico-md, 22px); flex: none; }
.sm-ic .sm-chev { width: 18px; height: 18px; color: var(--ink-3, #6c6c72); transition: transform .18s; }
.sm-ic[aria-expanded="true"] .sm-chev { transform: rotate(180deg); }
.sm-ic .sm-lbl { display: none; }
.sm-av { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; background: #dbe6fb; color: #2b4a8b;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8125rem; }
@media (min-width: 900px) {
  .sm-ic .sm-lbl { display: inline; } .sm-chat { padding: 0 14px 0 12px; }
  :root { --sm-fs-title: var(--fs-md); --sm-fs-sub: var(--fs-xs); --sm-fs-row: var(--fs-base); }
  .sm-menu { width: 300px; padding: 6px 14px 12px; }
  .sm-row, .sm-btn { min-height: 48px; }
}

.sm-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  width: min(248px, calc(100vw - 2rem)); max-height: calc(100dvh - 5.5rem); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 4px 12px 10px;
  background: #fff; border: 1px solid var(--line-2, #cfcfd3); border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .18); transform-origin: top right; animation: sm-pop .16s ease both;
}
.sm-menu[hidden] { display: none; }
@keyframes sm-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.sm-mh { padding: 8px 2px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line, #e6e6e8); }
.sm-mh b { display: block; font-size: var(--sm-fs-title); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-mh span { font-size: var(--sm-fs-sub); color: var(--ink-2, #4d4d52); }
.sm-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 2px; box-sizing: border-box;
  border: 0; background: none; color: var(--ink, #0b0b0c); font: inherit; font-size: var(--sm-fs-row); font-weight: 500;
  text-decoration: none; text-align: left; cursor: pointer; border-radius: 12px;
}
.sm-row:hover, .sm-row:focus-visible { background: var(--soft, #f4f4f5); }
.sm-row svg { width: 20px; height: 20px; flex: none; }
.sm-row .sm-end { margin-left: auto; display: flex; color: var(--ink-3, #6c6c72); }
.sm-row .sm-end svg { width: 16px; height: 16px; }
.sm-sep { border-top: 1px solid var(--line, #e6e6e8); margin-top: 4px; padding-top: 4px; }
.sm-red { color: var(--red-ink, #a8231b); }

.sm-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 8px;
  padding: 0 16px; box-sizing: border-box; border: 0; border-radius: 999px; font: inherit; font-weight: 600; font-size: var(--sm-fs-row);
  text-decoration: none; cursor: pointer; transition: background-color .18s, transform .18s;
}
.sm-btn:active { transform: scale(.97); }
.sm-btn:disabled { opacity: .6; pointer-events: none; }
.sm-line { background: var(--sm-line); color: #fff; }
.sm-line:hover { background: var(--sm-line-hover); }
.sm-danger { background: var(--red-ink, #a8231b); color: #fff; }
.sm-ghost { background: none; color: var(--ink-2, #4d4d52); font-weight: 500; }
.sm-ghost:hover { background: var(--soft, #f4f4f5); }
.sm-btn svg { width: 20px; height: 20px; flex: none; }

.sm-scrim { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); overflow-y: auto; background: rgba(11, 11, 12, .4); animation: sm-fade .16s ease both; }
@keyframes sm-fade { from { opacity: 0; } to { opacity: 1; } }
.sm-dlg { position: relative; width: min(360px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 28px 22px 16px; background: #fff; border-radius: 24px; text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, .22); animation: sm-pop .18s ease both; }
.sm-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--ink-2, #4d4d52); cursor: pointer; }
.sm-x:hover { background: var(--soft, #f4f4f5); }
.sm-x svg { width: 20px; height: 20px; }
.sm-ico { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--green-tint, #e6f4ea); color: var(--green-ink, #1b7339); }
.sm-ico.red { background: var(--red-tint, #fdeceb); color: var(--red-ink, #a8231b); }
.sm-ico svg { width: 26px; height: 26px; }
.sm-dlg h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.sm-dlg p { margin: 8px 0 12px; font-size: clamp(.875rem, .84rem + .2vw, .975rem); line-height: 1.6; color: var(--ink-2, #4d4d52); }
.sm-hours { margin: 0 0 6px; padding: 8px 10px; border-radius: 10px; background: var(--soft, #f4f4f5); font-size: clamp(.8125rem, .79rem + .15vw, .9rem); color: var(--ink-3, #6c6c72); }
@media (max-width: 359px) { .sm-ic { min-width: 44px; padding: 0 8px; } .sm-actions { gap: 4px; } .sm-dlg { padding: 24px 16px 12px; } }
@media (prefers-reduced-motion: reduce) { .sm-menu, .sm-scrim, .sm-dlg { animation: none; } }
