/* บริษัท บี.ที.อาร์.เครื่องเขียน จำกัด — สไตล์ชีตหลัก
   แนวคิด: แบบพิมพ์และบิลเล่มที่มีสำเนาหลายสี (ขาว ชมพู เหลือง เขียว ฟ้า)
   หมึกสีน้ำเงินม่วงแบบกระดาษคาร์บอน และตรายางสีแดง */

:root {
  --white: #ffffff;
  --copy-pink: #fde3e8;     /* สำเนาสีชมพู */
  --copy-yellow: #fff4c4;   /* สำเนาสีเหลือง */
  --copy-green: #dff3e4;    /* สำเนาสีเขียว */
  --copy-blue: #e2ecfb;     /* สำเนาสีฟ้า */
  --ink: #2a2772;           /* หมึกคาร์บอน */
  --ink-deep: #1b1950;
  --muted: #53517c;
  --rule: #b7b5df;          /* เส้นตารางแบบพิมพ์ */
  --stamp: #cf2e2e;         /* ตรายางสีแดง */

  --display: "Trirong", "Noto Serif Thai", "Noto Sans Thai Looped", "Leelawadee UI", Tahoma, serif;
  --body: "Noto Sans Thai Looped", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;

  --s--1: 0.86rem;
  --s-0: 1rem;
  --s-1: 1.2rem;
  --s-2: 1.5rem;
  --s-3: 1.9rem;
  --s-4: 2.35rem;
  --s-5: 2.9rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wrap: 72rem;
}

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

html { font-size: 106.25%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--white); color: var(--ink-deep);
  font-family: var(--body); font-size: var(--s-0); line-height: 1.85;
}

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

a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--stamp); }
a[href^="mailto:"] { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.45; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(var(--s-3), 4vw, var(--s-5)); line-height: 1.4; }
h2 { font-size: clamp(var(--s-2), 2.9vw, var(--s-4)); }
h3 { font-size: var(--s-1); font-weight: 600; }

p { margin: 0 0 1em; max-width: 40em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
.nw { white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6em 1em; z-index: 60; }
.skip:focus { left: 0; }

/* เส้นคู่ใต้หัวข้อแบบหัวแบบพิมพ์ */
.rule2 { display: block; width: 5.5rem; height: 7px; border-block: 2px solid var(--ink); margin-top: 0.8rem; }

/* ---------- ส่วนหัว ---------- */
.site-head { background: var(--white); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 30; }
.site-head__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand svg { width: 2.5rem; height: 2.5rem; flex: none; }
.brand__name { display: block; font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
.brand__legal { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.3; }

.nav ul { list-style: none; display: flex; gap: 0; }
.nav a {
  display: block; padding: 0.5em 0.8em;
  color: var(--ink-deep); text-decoration: none; font-weight: 500; font-size: 0.93rem;
  border: 1.5px solid transparent;
}
.nav a:hover { border-color: var(--rule); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.nav-toggle {
  display: none; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--white); color: var(--ink); border: 2px solid var(--ink); padding: 0.3em 1em;
}
@media (max-width: 64rem) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 2px solid var(--ink); padding: 0.5rem var(--gutter) 1rem; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 0.75em 0.8em; border: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 30rem) { .brand__legal { display: none; } .brand__name { font-size: 1.12rem; } }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-block; font-family: var(--body); font-weight: 600; font-size: 1rem; line-height: 1.4;
  padding: 0.75em 1.4em; border-radius: 2px; cursor: pointer; text-decoration: none;
  background: var(--ink); color: #fff; border: 2px solid var(--ink);
}
.btn:hover { background: var(--ink-deep); border-color: var(--ink-deep); color: #fff; }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

/* ---------- ตรายาง ---------- */
.stamp {
  display: inline-block; color: var(--stamp); border: 3px double var(--stamp); border-radius: 8px;
  padding: 0.45em 0.9em; font-family: var(--display); font-weight: 700; font-size: 1.02rem; line-height: 1.45; text-align: center;
  transform: rotate(-7deg); opacity: 0.9; background: rgba(255,255,255,.55);
}

/* ---------- แบนเนอร์หน้าแรก: บิลเล่มพร้อมสำเนา ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(2rem, 5vw, 3.6rem) 0 clamp(2.6rem, 6vw, 4.6rem); }
.hero__media, .formpaper {
  background:
    repeating-linear-gradient(transparent 0, transparent 1.9rem, rgba(42,39,114,.16) 1.9rem, rgba(42,39,114,.16) calc(1.9rem + 1px)),
    var(--copy-blue);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__credit { position: absolute; z-index: 3; right: 0.9rem; bottom: 0.5rem; font-size: 0.72rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.hero__credit a { color: inherit; }

.bill { position: relative; z-index: 1; width: min(100% - 1.4rem, 50rem); }
.bill::before, .bill::after { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--ink); }
.bill::before { background: var(--copy-yellow); transform: translate(1.3rem, 1.3rem); }
.bill::after { background: var(--copy-pink); transform: translate(0.65rem, 0.65rem); }
.bill__sheet { position: relative; z-index: 1; background: var(--white); border: 1.5px solid var(--ink); box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.bill__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.2rem 1.5rem;
  padding: 0.8rem clamp(1rem, 3vw, 1.8rem); border-bottom: 1.5px dashed var(--ink);
  font-size: var(--s--1); color: var(--muted);
}
.bill__head strong { font-family: var(--display); font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.bill__body { padding: clamp(1.2rem, 3.2vw, 2.2rem) clamp(1rem, 3vw, 1.8rem); position: relative; }
.bill__lead { font-size: 1.1rem; line-height: 1.8; color: var(--muted); margin-top: 1rem; }
.bill .stamp { position: absolute; right: clamp(0.8rem, 3vw, 1.8rem); bottom: clamp(1rem, 3vw, 2rem); }
@media (max-width: 44rem) { .bill .stamp { position: static; margin-top: 1.4rem; } }

.bill__table { width: 100%; border-collapse: collapse; margin-top: 1.4rem; font-size: 1rem; }
.bill__table th, .bill__table td { border: 1.5px solid var(--ink); padding: 0.45em 0.8em; text-align: left; vertical-align: top; }
.bill__table thead th { font-family: var(--display); font-weight: 700; color: var(--ink); background: var(--copy-blue); }
.bill__table td:first-child, .bill__table th:first-child { width: 4.2rem; text-align: center; }
.bill__table a { font-weight: 600; text-decoration: none; display: block; }
.bill__table a:hover { text-decoration: underline; }

@media (max-width: 34rem) { .bill h1 { font-size: 1.6rem; text-wrap: pretty; } .bill__lead { font-size: 1.02rem; } }

/* ---------- แบนเนอร์หน้าใน ---------- */
.page-head { position: relative; overflow: hidden; }
.page-head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-head__body { position: relative; z-index: 1; padding: clamp(2.4rem, 6vw, 4.2rem) 0 clamp(3rem, 7vw, 4.8rem); }
.page-head .bill { width: min(100% - 1.4rem, 42rem); }
.page-head .bill__body p { font-size: var(--s-1); line-height: 1.75; margin-top: 1rem; color: var(--muted); }
.page-head__credit { position: absolute; z-index: 3; right: 0.9rem; bottom: 0.5rem; font-size: 0.72rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.page-head__credit a { color: inherit; }

/* ---------- ส่วนเนื้อหา: แต่ละแถบคือสำเนาคนละสี คั่นด้วยรอยปรุ ---------- */
.band { padding: clamp(3rem, 7vw, 5.2rem) 0; border-top: 2px dashed var(--ink); }
.band--first { border-top: 2px solid var(--ink); }
.band--pink { background: var(--copy-pink); }
.band--yellow { background: var(--copy-yellow); }
.band--green { background: var(--copy-green); }
.band--blue { background: var(--copy-blue); }

.band__head { margin-bottom: clamp(1.8rem, 4vw, 2.8rem); max-width: 44rem; }
.band__head p { margin-top: 1rem; color: var(--muted); font-size: var(--s-1); line-height: 1.75; }

.split { display: grid; gap: clamp(1.8rem, 5vw, 4rem); grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; }
.split--top { align-items: start; }
.split--flip { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
@media (max-width: 54rem) { .split, .split--flip { grid-template-columns: 1fr; } }

/* ---------- ภาพถ่าย ---------- */
.photo { margin: 0; }
.photo__frame { aspect-ratio: 4 / 3; overflow: hidden; border: 1.5px solid var(--ink); }
.photo--tall .photo__frame { aspect-ratio: 4 / 5; }
.photo--wide .photo__frame { aspect-ratio: 3 / 2; }
.photo__frame img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { font-size: 0.74rem; color: var(--muted); margin-top: 0.4rem; }
.photo figcaption a { color: inherit; }
img.is-missing { visibility: hidden; }

/* ---------- กลุ่มสินค้า ---------- */
.goods { list-style: none; display: grid; gap: 1.3rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.goods li { grid-column: span 2; background: var(--white); border: 1.5px solid var(--ink); }
.goods li:nth-child(4) { grid-column: 2 / span 2; }
@media (max-width: 60rem) { .goods { grid-template-columns: repeat(2, minmax(0, 1fr)); } .goods li, .goods li:nth-child(4) { grid-column: auto; } }
@media (max-width: 34rem) { .goods { grid-template-columns: 1fr; } }
.goods .photo__frame { border: 0; border-bottom: 1.5px solid var(--ink); }
.goods .photo figcaption { padding: 0 1rem; }
.goods h3 { padding: 0.6rem 1rem 0; font-size: var(--s-2); font-weight: 700; }
.goods p { padding: 0.3rem 1rem 0; color: var(--muted); font-size: 0.97rem; }
.goods .more { display: inline-block; margin: 0.6rem 1rem 1.1rem; font-weight: 600; }

/* ---------- ตารางแบบพิมพ์ ---------- */
.form-table { width: 100%; border-collapse: collapse; background: var(--white); }
.form-table caption { caption-side: top; text-align: left; font-family: var(--display); font-weight: 700; font-size: var(--s-1); color: var(--ink); padding-bottom: 0.6rem; }
.form-table th, .form-table td { border: 1.5px solid var(--ink); padding: 0.6em 0.9em; text-align: left; vertical-align: top; }
.form-table thead th { font-family: var(--display); font-weight: 700; color: var(--ink); background: var(--copy-blue); }
.form-table tbody th { font-weight: 600; white-space: nowrap; }
.tables { display: grid; gap: clamp(1.8rem, 4vw, 3rem); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 56rem) { .tables { grid-template-columns: 1fr; } }
@media (max-width: 30rem) { .form-table th, .form-table td { padding: 0.5em 0.55em; font-size: 0.93rem; } .form-table tbody th { white-space: normal; } }

/* ---------- ช่องทางซื้อ ---------- */
.ways { list-style: none; display: grid; gap: 1.3rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 54rem) { .ways { grid-template-columns: 1fr; } }
.ways li { background: var(--white); border: 1.5px solid var(--ink); padding: 1.2rem 1.3rem 1.4rem; }
.ways p { margin-top: 0.4rem; color: var(--muted); }

/* ---------- ขั้นตอนสั่งซื้อ ---------- */
.steps { list-style: none; counter-reset: st; display: grid; gap: 1.3rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps li { counter-increment: st; background: var(--white); border: 1.5px solid var(--ink); padding: 1.1rem 1.2rem 1.3rem; }
.steps li::before {
  content: counter(st); display: grid; place-items: center; width: 2.3rem; height: 2.3rem;
  border: 1.5px solid var(--ink); font-family: var(--display); font-weight: 700; font-size: var(--s-1); color: var(--ink); line-height: 1; margin-bottom: 0.7rem;
}
.steps p { margin-top: 0.35rem; color: var(--muted); font-size: 0.97rem; line-height: 1.75; }
@media (max-width: 60rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 32rem) { .steps { grid-template-columns: 1fr; } }
.note { margin-top: 1.8rem; font-size: 0.95rem; color: var(--muted); }

/* ---------- รายการหัวข้อ-คำอธิบาย ---------- */
.deflist { margin: 0; }
.deflist div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0.4rem 2rem; padding: 1.2rem 0; border-top: 1.5px solid var(--rule); }
.deflist div:last-child { border-bottom: 1.5px solid var(--rule); }
.deflist dt { font-family: var(--display); font-weight: 700; font-size: var(--s-1); line-height: 1.5; color: var(--ink); }
.deflist dd { margin: 0; color: var(--muted); max-width: 40em; }
@media (max-width: 46rem) { .deflist div { grid-template-columns: 1fr; } }

.ticks { list-style: none; margin-top: 0.7rem; }
.ticks li { position: relative; padding-left: 1.8rem; margin-top: 0.4rem; max-width: 38em; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 0.95rem; height: 0.95rem; border: 1.5px solid var(--ink); background: var(--white); }
.ticks li::after { content: ""; position: absolute; left: 0.22rem; top: 0.52em; width: 0.5rem; height: 0.28rem; border-left: 2px solid var(--stamp); border-bottom: 2px solid var(--stamp); transform: rotate(-45deg); }

/* ---------- รายละเอียดสินค้า (หน้าสินค้าและบริการ) ---------- */
.item { padding: clamp(2.2rem, 5vw, 3.4rem) 0; border-top: 1.5px solid var(--rule); }
.item:first-of-type { border-top: 0; padding-top: 0; }
.item:last-of-type { padding-bottom: 0; }
.item h3 { font-size: clamp(var(--s-2), 2.4vw, var(--s-3)); font-weight: 700; }
.item h4 { font-family: var(--body); font-weight: 600; font-size: 1.02rem; margin: 1.3rem 0 0; }
.item p { margin-top: 0.8rem; }
.item:nth-of-type(even) .split > .photo { order: -1; }
@media (max-width: 54rem) { .item .split > .photo { order: -1; } }

/* ---------- คำถามที่พบบ่อย ---------- */
.faq { max-width: 50rem; border: 1.5px solid var(--ink); background: var(--white); }
.faq details + details { border-top: 1.5px solid var(--ink); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  font-family: var(--display); font-weight: 600; font-size: 1.12rem; line-height: 1.5; color: var(--ink);
  padding: 0.9rem 3.2rem 0.9rem 1.2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  font-family: var(--body); font-size: 1.7rem; font-weight: 500; color: var(--stamp); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 1.2rem 1.1rem; color: var(--muted); }

/* ---------- ช่องติดต่อท้ายหน้า ---------- */
.cta { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(1.8rem, 5vw, 4rem); align-items: center; }
@media (max-width: 56rem) { .cta { grid-template-columns: 1fr; } }
.contact-table { width: 100%; border-collapse: collapse; background: var(--white); }
.contact-table th, .contact-table td { border: 1.5px solid var(--ink); padding: 0.65em 0.9em; text-align: left; vertical-align: top; }
.contact-table th { width: 8.5rem; font-weight: 500; color: var(--muted); background: var(--white); }
.contact-table td { font-weight: 600; overflow-wrap: anywhere; }
.contact-table a { text-decoration: none; }
.contact-table a:hover { text-decoration: underline; }
@media (max-width: 26rem) { .contact-table th { width: 6rem; } }

/* ---------- ตารางข้อมูลบริษัท ---------- */
.spec { width: 100%; border-collapse: collapse; background: var(--white); }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 0.8em 1.1em; border: 1.5px solid var(--ink); }
.spec th { width: 13rem; font-weight: 500; color: var(--muted); }
.spec td { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .spec th, .spec td { display: block; width: auto; }
  .spec th { border-bottom: 0; padding-bottom: 0.1em; }
  .spec td { border-top: 0; padding-top: 0; }
  .spec tr + tr th { border-top: 0; }
}

/* ---------- หน้าเนื้อหายาว (นโยบาย) ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--s-2); margin-top: 2.6rem; }
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose p, .prose ul { margin-top: 0.9rem; }
.prose ul { padding-left: 1.4rem; }
.prose li { margin-top: 0.35rem; max-width: 38em; }
.prose .meta { color: var(--muted); font-size: 0.95rem; margin-top: 0; }

/* ---------- หน้าติดต่อ ---------- */
.form { background: var(--white); border: 1.5px solid var(--ink); padding: clamp(1.2rem, 3vw, 2rem); }
.form h2 { font-size: var(--s-2); }
.form > p { color: var(--muted); margin-top: 0.6rem; font-size: 0.95rem; }
.field { margin-top: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink-deep); background: #fff;
  padding: 0.6em 0.8em; border: 1.5px solid var(--ink); border-radius: 0;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--copy-yellow); outline-offset: 0; box-shadow: 0 0 0 1.5px var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 34rem) { .field-row { grid-template-columns: 1fr; } }
.form .btn { margin-top: 1.4rem; }
.form__hint { font-size: var(--s--1); color: var(--muted); margin-top: 0.8rem; }

.map { background: var(--white); border: 1.5px solid var(--ink); }
.map iframe { display: block; width: 100%; height: clamp(18rem, 45vw, 26rem); border: 0; }
.map p { padding: 0.8rem 1.2rem; font-size: 0.95rem; max-width: none; border-top: 1.5px solid var(--ink); }

/* ---------- ส่วนท้าย ---------- */
.site-foot { background: var(--ink-deep); color: #dcdbf3; padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; font-size: 0.95rem; }
.site-foot a { color: #fff; }
.site-foot__grid { display: grid; gap: 2rem 3rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.2fr); }
@media (max-width: 54rem) { .site-foot__grid { grid-template-columns: 1fr; } }
.site-foot h2 { font-size: var(--s-1); color: #fff; margin-bottom: 0.7rem; }
.site-foot ul { list-style: none; }
.site-foot li { margin-top: 0.3rem; }
.site-foot address { font-style: normal; overflow-wrap: anywhere; }
.site-foot__base {
  margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px dashed rgba(255,255,255,.4);
  display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; justify-content: space-between;
  font-size: var(--s--1); color: #b4b2dc;
}
.site-foot__base p { max-width: none; margin: 0; }

/* ---------- การเคลื่อนไหว: ประทับตรายางครั้งเดียวตอนเปิดหน้าแรก ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .stamp { animation: press 0.4s 0.5s cubic-bezier(.3,1.5,.5,1) both; }
  @keyframes press { from { opacity: 0; transform: rotate(-7deg) scale(1.7); } to { opacity: 0.9; transform: rotate(-7deg) scale(1); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .site-head { position: static; }
  .nav, .nav-toggle, .btn-row, .map { display: none; }
}
