/* =====================================================================
   RST SHOP — หน้าร้าน
   ภาษาภาพดึงจากโลโก้ RST: ตัวเอียง 12°, เนื้อส้ม, ขอบดำ, เงาแข็งไม่ฟุ้ง (แบบสติกเกอร์รถแข่ง)
   ความโดดเด่นอยู่ที่ hero กับปุ่มหลัก ที่เหลือเรียบและเงียบ
   ===================================================================== */
:root {
  --paper: #F2F3F5;        /* พื้นคอนกรีตพิทเลน */
  --white: #FFFFFF;
  --ink: #1E1F22;          /* ดำยาง */
  --orange: #F47B20;       /* ส้มจากโลโก้ — ใช้เป็นพื้น/แถบ คู่กับตัวหนังสือดำ */
  --orange-ink: #B35309;   /* ส้มเข้ม สำหรับตัวหนังสือบนพื้นสว่าง (คอนทราสต์ 5:1) */
  --steel: #62676F;        /* ตัวหนังสือรอง */
  --line: #D5D8DC;
  --on-ink-muted: #A7ACB3;

  --display: 'Chakra Petch', 'IBM Plex Sans Thai', sans-serif;
  --text: 'IBM Plex Sans Thai', 'Chakra Petch', sans-serif;
  --slant: -12deg;         /* องศาเอียงของโลโก้ */
  --max: 1240px;
  --gut: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-padding-top: 88px; }
body {
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, output { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: var(--white); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- ปุ่ม ---------- */
.btn {
  --shadow: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1;
  padding: 14px 26px;
  border-radius: 3px;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background-color .15s;
}
/* ปุ่มหลัก: ส้ม ขอบดำ เงาแข็ง แบบสติกเกอร์ของโลโก้ — กดแล้วยุบลงไปในเงา */
.btn-go {
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}
.btn-go:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
.btn-go:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn-go:focus-visible { outline-color: var(--ink); }
.btn-go:disabled { background: var(--line); color: var(--steel); box-shadow: none; transform: none; cursor: not-allowed; }
.btn-line {
  border: 1.5px solid var(--ink); color: var(--ink); background: var(--white);
  font-weight: 600; font-size: 14.5px; padding: 10px 16px;
}
.btn-line:hover { background: var(--ink); color: var(--white); }
.block { width: 100%; }
.grow { flex: 1; }

/* ---------- แถบบน ---------- */
.bar {
  position: sticky; top: 0; z-index: 60;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: var(--max); margin: 0 auto; padding: 10px var(--gut);
  display: grid; grid-template-columns: auto 1fr minmax(180px, 280px) auto;
  align-items: center; gap: 28px;
}
.bar-logo img { height: 40px; width: auto; }
.bar-cats { display: flex; gap: 22px; }
.bar-cats a {
  position: relative;
  font-family: var(--display); font-weight: 600; font-size: 15.5px;
  text-decoration: none; padding: 8px 0; white-space: nowrap;
}
.bar-cats a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px;
  background: var(--orange); transform: skewX(var(--slant)) scaleX(0); transform-origin: left;
  transition: transform .2s;
}
.bar-cats a:hover::after, .bar-cats a[aria-current="true"]::after { transform: skewX(var(--slant)) scaleX(1); }
.bar-cats a.about { color: var(--steel); }

.search {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 3px; background: var(--paper);
  padding: 0 12px; height: 42px;
  transition: border-color .15s, background-color .15s;
}
.search:focus-within { border-color: var(--ink); background: var(--white); }
.search svg { width: 18px; height: 18px; color: var(--steel); flex-shrink: 0; }
.search input { border: 0; background: none; outline: none; width: 100%; font-size: 15px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.bar-acts { display: flex; align-items: center; gap: 10px; }
.cart-btn {
  position: relative; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--white);
}
.cart-btn:hover { background: var(--paper); }
.cart-count {
  position: absolute; top: -8px; right: -8px;
  min-width: 22px; height: 22px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 11px;
  font-family: var(--display); font-weight: 700; font-size: 12px; line-height: 1;
}
.cart-count[hidden] { display: none; }
.cart-count.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* เมนูบัญชี */
.acct { position: relative; }
.acct summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 3px; background: var(--white);
  padding: 0 12px; height: 44px; max-width: 200px;
  font-family: var(--display); font-weight: 600; font-size: 14.5px;
}
.acct summary::-webkit-details-marker { display: none; }
.acct summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct summary svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform .15s; }
.acct[open] summary { border-color: var(--ink); }
.acct[open] summary svg { transform: rotate(180deg); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  min-width: 230px; background: var(--white);
  border: 1.5px solid var(--ink); border-radius: 3px;
  padding: 6px;
}
.acct-menu .pts { padding: 10px 12px; font-size: 14px; color: var(--steel); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-menu .pts b { font-family: var(--display); color: var(--orange-ink); font-size: 16px; }
.acct-menu a, .acct-menu button {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 2px; text-decoration: none; font-size: 15px;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--paper); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: var(--white); overflow: hidden; }
.hero-in {
  position: relative; max-width: var(--max); margin: 0 auto;
  /* แถบแบนเนอร์กะทัดรัด ให้สินค้าโผล่ขึ้นมาในจอแรก */
  padding: clamp(28px, 3.6vw, 44px) var(--gut) clamp(30px, 3.8vw, 46px);
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.hero h1 {
  font-family: var(--display); font-style: italic; font-weight: 700;
  font-size: clamp(32px, 4.4vw, 54px); line-height: 1.1; letter-spacing: -0.01em;
  /* เงาแข็งสีส้มแบบโลโก้ */
  text-shadow: 0.055em 0.055em 0 var(--orange);
}
/* สองท่อนเรียงบรรทัดเดียวบนจอกว้าง จอแคบค่อยตัดขึ้นบรรทัดใหม่ */
.hero h1 span { display: inline-block; margin-right: .28em; animation: slide-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero h1 span + span { animation-delay: .09s; }
@keyframes slide-in { from { opacity: 0; transform: translate(-48px, 10px); } }
.hero p { margin-top: 12px; max-width: 40em; font-size: 16px; line-height: 1.7; color: #C9CDD2; }
.hero-row { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.hero .btn-go { --shadow: var(--paper); font-size: 16px; padding: 13px 26px; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 14.5px; color: var(--on-ink-muted); }
.facts b { font-family: var(--display); font-weight: 700; color: var(--white); }

/* แถบลายรถแข่งสองเส้น เอียงเท่าโลโก้ */
.livery { position: absolute; inset: -20% 6% -20% auto; display: flex; gap: 14px; z-index: 1; }
.livery i { display: block; height: 100%; background: var(--orange); transform: skewX(var(--slant)); }
.livery i:first-child { width: 64px; }
.livery i:last-child { width: 20px; }

/* ---------- รายการสินค้า ---------- */
.shop { max-width: var(--max); margin: 0 auto; padding: 56px var(--gut) 96px; outline: none; }
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; }
.shop-head h2 { font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.1; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* แท็บหมวด: สี่เหลี่ยมด้านขนานเอียงตามโลโก้ */
.tabs { display: flex; gap: 8px; padding-left: 6px; }
.tab {
  transform: skewX(var(--slant));
  border: 1.5px solid var(--line); background: var(--white);
  padding: 8px 16px; border-radius: 2px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.tab > span { display: inline-flex; gap: 7px; align-items: baseline; transform: skewX(12deg); font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; }
.tab small { font-size: 12.5px; color: var(--steel); font-weight: 500; }
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.tab[aria-selected="true"] small { color: var(--on-ink-muted); }

.sort select {
  appearance: none; -webkit-appearance: none;
  border: 1.5px solid var(--line); border-radius: 3px; background: var(--white);
  height: 40px; padding: 0 36px 0 12px; font-size: 14.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E1F22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.sort select:hover { border-color: var(--ink); }

.result-note { min-height: 24px; margin: 14px 0 18px; font-size: 14.5px; color: var(--steel); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 28px 20px; }

/* การ์ดสินค้า: ตัดมุมขวาบนเฉียงตามองศาโลโก้ แทนเงาฟุ้ง */
.tile {
  --cut: 22px;
  position: relative; display: flex; flex-direction: column;
  background: var(--white); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.tile::after {                       /* ขีดส้มเล็กๆ ที่มุมเฉียง โผล่เมื่อชี้/โฟกัส */
  content: ''; position: absolute; top: 0; right: 0; width: calc(var(--cut) + 12px); height: calc(var(--cut) + 12px);
  background: linear-gradient(225deg, var(--orange) 0 45%, transparent 45%);
  opacity: 0; transition: opacity .15s;
}
.tile:hover::after, .tile:focus-visible::after, .tile:focus-within::after { opacity: 1; }
.tile:focus-visible { outline-offset: -3px; }

.tile-img { position: relative; aspect-ratio: 1 / 1; background: var(--white); display: grid; place-items: center; overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: contain; }
.img-count {
  position: absolute; left: 10px; bottom: 10px;
  background: var(--ink); color: var(--white); border-radius: 2px;
  font-size: 12.5px; padding: 2px 8px;
}

/* ไม่มีรูป: ใช้ชื่อหมวดเป็นตัวหนังสือโครงร่างเอียง ให้ดูตั้งใจ ไม่ใช่ช่องว่าง */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    repeating-linear-gradient(102deg, transparent 0 22px, rgba(30, 31, 34, .035) 22px 23px),
    #F7F8F9;
}
.ph span {
  font-family: var(--display); font-style: italic; font-weight: 700;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px #B9BEC4;
}

.tile.soldout .tile-img > :not(.flag) { opacity: .4; }
.flag {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--slant));
  background: var(--ink); color: var(--white); padding: 6px 16px;
  font-family: var(--display); font-weight: 700; font-size: 16px;
}
/* รอการขาย: ป้ายส้มขอบดำแบบสติกเกอร์ ให้ต่างจาก "สินค้าหมด" ที่เป็นป้ายดำ */
.flag.soon { background: var(--orange); color: var(--ink); border: 2px solid var(--ink); }
.tile.soldout .tile-img:has(.flag.soon) > :not(.flag) { opacity: .75; }

.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; border-top: 1px solid var(--line); }
.tile-name {
  font-size: 15.5px; font-weight: 500; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 23px; line-height: 1.2; }
.low { font-size: 13px; color: var(--orange-ink); font-weight: 500; }
.btn-add {
  margin-top: 12px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--white);
  padding: 10px 12px; font-family: var(--display); font-weight: 600; font-size: 15px;
  transition: background-color .15s;
}
.btn-add:hover { background: var(--orange); }
.btn-add:disabled { border-color: var(--line); color: var(--steel); background: var(--paper); cursor: not-allowed; }

.empty { grid-column: 1 / -1; padding: 56px 20px; text-align: center; color: var(--steel); }
.empty strong { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

/* ---------- ปุ่มปิด ---------- */
.x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 3px; }
.x:hover { background: var(--paper); }

/* ---------- รายละเอียดสินค้า ---------- */
.pd-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(30, 31, 34, .72);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.pd-overlay.open { display: flex; }
.pd {
  position: relative; width: 940px; max-width: 100%; max-height: 92vh; overflow-y: auto;
  display: grid; grid-template-columns: 1.08fr 1fr;
  background: var(--white); border-radius: 3px;
  animation: pd-in .22s ease-out;
}
@keyframes pd-in { from { opacity: 0; transform: translateY(12px); } }
.pd .x { position: absolute; top: 10px; right: 10px; z-index: 3; background: var(--white); }
.pd-media { padding: 18px; background: var(--paper); }
.pd-main { position: relative; aspect-ratio: 1 / 1; background: var(--white); display: grid; place-items: center; overflow: hidden; }
.pd-main img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s ease-out; }
.pd-main.zoomable { cursor: zoom-in; }
/* แว่นขยายตอนชี้เมาส์ (จอที่มีเมาส์เท่านั้น) — จุดขยายเลื่อนตามตำแหน่งเมาส์ */
.pd-main.lens img { transform: scale(2.6); transition: none; }
.pd-open {
  position: absolute; right: 10px; bottom: 10px;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 3px;
}
.pd-open:hover { background: var(--orange); }
.pd-open svg { width: 20px; height: 20px; }
.pd-zoom-tip { margin-top: 8px; font-size: 13px; color: var(--steel); min-height: 20px; }
.pd-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-thumb { width: 64px; height: 64px; background: var(--white); border: 2px solid transparent; padding: 0; overflow: hidden; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb[aria-current="true"] { border-color: var(--ink); }
.pd-info { display: flex; flex-direction: column; padding: 34px 30px 30px; }
.pd-cat { font-size: 14px; color: var(--steel); }
.pd-info h2 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.25; margin: 4px 44px 12px 0; }
.pd-price { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 36px; line-height: 1.1; }
.pd-stock { margin-top: 6px; font-size: 14.5px; color: var(--steel); }
.pd-stock.low { color: var(--orange-ink); font-weight: 500; }
.pd-desc { margin: 20px 0 26px; font-size: 15.5px; line-height: 1.85; white-space: pre-line; flex: 1; max-width: 38em; }
.pd-buy { display: flex; gap: 12px; align-items: stretch; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 3px; }
.stepper button { width: 42px; height: 48px; font-size: 20px; }
.stepper button:hover { background: var(--paper); }
.stepper output { min-width: 34px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 17px; }

/* ---------- ดูรูปขยายเต็มจอ ---------- */
.zv { position: fixed; inset: 0; z-index: 150; background: #111214; color: var(--white); }
.zv[hidden] { display: none; }
.zv-stage {
  position: absolute; inset: 0; overflow: hidden;
  /* flex (ไม่ใช่ grid) เพื่อให้ max-height: 100% ของรูปคิดจากความสูงจอจริง รูปจะพอดีจอตอน 100% */
  display: flex; align-items: center; justify-content: center;
  touch-action: none;           /* หยิก/ลากจัดการเอง ไม่ให้เบราว์เซอร์ซูมทั้งหน้า */
  cursor: zoom-in; user-select: none; -webkit-user-select: none;
}
.zv-stage.zoomed { cursor: grab; }
.zv-stage.dragging { cursor: grabbing; }
.zv-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transform-origin: center; will-change: transform;
  background: var(--white);
}
.zv-stage.anim img { transition: transform .22s ease-out; }
.zv-btn {
  display: grid; place-items: center; width: 46px; height: 46px;
  background: rgba(30, 31, 34, .78); color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, .28); border-radius: 3px;
  font-size: 22px; line-height: 1;
}
.zv-btn:hover { background: var(--orange); color: var(--ink); border-color: var(--ink); }
.zv-btn:disabled { opacity: .3; pointer-events: none; }
.zv-close { position: absolute; top: 14px; right: 14px; }
.zv-prev, .zv-next { position: absolute; top: 50%; transform: translateY(-50%); }
.zv-prev { left: 14px; }
.zv-next { right: 14px; }
.zv-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  font-size: 14px;
}
.zv-zoom { display: flex; align-items: center; gap: 8px; }
.zv-zoom .zv-btn { width: 40px; height: 40px; }
.zv-zoom output { min-width: 52px; text-align: center; font-family: var(--display); font-weight: 700; }

/* ---------- ตะกร้า ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(30, 31, 34, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: 420px; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--white);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  visibility: hidden;
}
body.cart-open .drawer { transform: none; visibility: visible; }
body.cart-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 24px; }
.drawer-items { flex: 1; overflow-y: auto; padding: 4px 22px; }
.line-item { display: grid; grid-template-columns: 68px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line-item .thumb { width: 68px; height: 68px; background: var(--paper); overflow: hidden; display: grid; place-items: center; }
.line-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-item .thumb .ph span { font-size: 15px; -webkit-text-stroke-width: 1px; }
.line-item h4 { font-size: 15px; font-weight: 500; line-height: 1.4; }
.line-item .unit { font-size: 13.5px; color: var(--steel); }
.line-item .sum { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 17px; text-align: right; }
.line-item .row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.line-item .stepper button { width: 32px; height: 32px; font-size: 16px; }
.line-item .stepper output { min-width: 26px; font-size: 15px; }
.remove { font-size: 13.5px; color: var(--steel); text-decoration: underline; text-underline-offset: 3px; }
.remove:hover { color: var(--ink); }
.drawer-foot { padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.ship-note { font-size: 14px; color: var(--steel); }
.ship-note b { color: var(--ink); }
.ship-bar { height: 6px; background: var(--paper); margin: 8px 0 16px; overflow: hidden; }
.ship-bar i { display: block; height: 100%; background: var(--orange); transform-origin: left; transition: transform .3s; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.total strong { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 26px; }
.drawer .empty { padding: 64px 10px; }

/* ---------- ท้ายเว็บ ---------- */
.foot { background: var(--ink); color: var(--on-ink-muted); }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 40px var(--gut); display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.foot img { height: 34px; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot a { text-decoration: none; font-size: 14.5px; }
.foot a:hover { color: var(--white); }
.foot small { margin-left: auto; font-size: 13px; }

/* ---------- แจ้งเตือน ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px);
  background: var(--ink); color: var(--white);
  border-left: 6px solid var(--orange);
  padding: 13px 20px; border-radius: 3px; font-size: 15px;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-left-color: #E5484D; }

.fly-item {
  position: fixed; z-index: 400; pointer-events: none;
  width: 56px; height: 56px; background: var(--white); border: 2px solid var(--ink);
  overflow: hidden; display: grid; place-items: center;
  transition: all .7s cubic-bezier(.3, .7, .4, 1);
}
.fly-item img { width: 100%; height: 100%; object-fit: cover; }
.fly-item .ph span { font-size: 12px; -webkit-text-stroke-width: 1px; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1140px) {
  .bar-cats a.about { display: none; }   /* ยังมีลิงก์นี้ที่ท้ายเว็บ */
  .bar-in { gap: 22px; }
}
@media (max-width: 940px) {
  .bar-in { grid-template-columns: auto 1fr auto; gap: 10px 14px; padding: 8px 16px 10px; }
  .bar-logo img { height: 34px; }
  .bar-cats { grid-column: 1 / -1; grid-row: 3; overflow-x: auto; gap: 20px; scrollbar-width: none; }
  .bar-cats::-webkit-scrollbar { display: none; }
  .bar-cats a { flex-shrink: 0; }
  .search { grid-column: 1 / -1; grid-row: 2; height: 40px; }
  .bar-acts { grid-column: 3; grid-row: 1; }
  .acct summary { max-width: 130px; }
  html { scroll-padding-top: 150px; }
  /* แถบลายรถแข่งต้องไม่ทับตัวหนังสือ: ย่อเป็นเส้นบางชิดขอบขวาตั้งแต่จอแท็บเล็ต */
  .hero-copy { max-width: 86%; }
  .livery { inset: auto -8px -10% auto; height: 70%; gap: 8px; }
  .livery i:first-child { width: 30px; }
  .livery i:last-child { width: 10px; }
}
@media (max-width: 720px) {
  :root { --gut: 16px; }
  .bar-cats { display: none; }            /* แท็บหมวดด้านล่างทำหน้าที่แทน แถบบนจะได้ไม่กินจอ */
  html { scroll-padding-top: 112px; }
  .hero p { font-size: 16px; }
  .shop { padding-top: 36px; }
  .tools { width: 100%; }
  .tabs { overflow-x: auto; flex: 1 1 100%; padding: 2px 6px 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .tile { --cut: 16px; }
  .tile-body { padding: 10px 12px 12px; }
  .tile-name { font-size: 14.5px; }
  .price { font-size: 19px; }
  .tile-meta { flex-direction: column; align-items: flex-start; gap: 0; }
  .btn-add { font-size: 14px; padding: 9px 8px; }
  .pd { grid-template-columns: 1fr; max-height: 94vh; }
  .pd-overlay { padding: 10px; align-items: flex-end; }
  .pd-info { padding: 20px 18px 22px; }
  .pd-info h2 { font-size: 23px; }
  .pd-price { font-size: 30px; }
  .pd-buy { position: sticky; bottom: 0; background: var(--white); padding-top: 10px; }
  .foot small { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== หมวดย่อย (ใต้แท็บหมวดหลัก) ===== */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.subtab { border: 1.5px solid var(--line, #d9d9d9); background: var(--white, #fff); color: inherit; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.subtab small { color: var(--steel, #767676); margin-left: 4px; }
.subtab:hover { border-color: var(--ink, #1e1f22); }
.subtab[aria-selected="true"] { background: var(--ink, #1e1f22); border-color: var(--ink, #1e1f22); color: var(--white, #fff); }
.subtab[aria-selected="true"] small { color: inherit; opacity: .75; }
@media (max-width: 640px) {
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { flex-shrink: 0; }
}
