@import url('base.css');

/* =================================================================
   M.E.Tools storefront — public site styles (DeWalt industrial)
   ================================================================= */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

.dot {
  width: 10px; height: 10px; background: var(--tape-green); border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(46,133,64,.3); display: inline-block;
  animation: me-pulse 1.6s ease-in-out infinite;
}
@keyframes me-pulse { 50% { box-shadow: 0 0 0 6px rgba(46,133,64,.15); } }

.me-overline {
  font-family: var(--font-display-en); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; font-weight: 400; color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 10px;
}
.me-overline-bar { display: inline-block; width: 28px; height: 4px; background: var(--dw-yellow); }

/* ---------- buttons ---------- */
.me-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display-th), var(--font-display-en);
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em;
  padding: 12px 22px; border: 3px solid var(--ink); background: var(--dw-yellow);
  color: var(--ink); cursor: pointer; box-shadow: 4px 4px 0 0 var(--ink);
  transition: all 120ms cubic-bezier(.2,.8,.2,1); border-radius: 0; font-size: 14px;
  line-height: 1; text-decoration: none;
}
.me-btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 0 var(--ink); background: var(--dw-yellow); }
.me-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 0 var(--ink); }
.me-btn[disabled] { opacity: .45; pointer-events: none; box-shadow: 2px 2px 0 0 var(--ink); }
.me-btn-dark { background: var(--ink); color: var(--paper); }
.me-btn-dark:hover { background: var(--ink-soft); }
.me-btn-ghost { background: transparent; box-shadow: none; }
.me-btn-ghost:hover { background: var(--dw-yellow); box-shadow: none; transform: none; }
.me-btn-sm { padding: 8px 14px; font-size: 12px; box-shadow: 3px 3px 0 0 var(--ink); border-width: 2px; }
.me-btn-block { width: 100%; }
.me-btn svg { stroke: currentColor; }

/* ---------- header ---------- */
.me-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--dw-yellow); }
.me-header-inner { max-width: 1280px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 28px; }
.me-header-brand { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.me-header-mark { font-family: var(--font-wordmark); font-weight: 900; font-size: 22px; letter-spacing: -.01em; line-height: 1; }
.me-header-loc { font-family: var(--font-display-en); font-size: 10px; letter-spacing: .18em; color: var(--dw-yellow); text-transform: uppercase; }
.me-header-nav { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; }
.me-header-nav a { color: var(--paper); text-decoration: none; font-family: var(--font-body); font-weight: 600; font-size: 14px; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.me-header-nav a:hover { color: var(--dw-yellow); background: transparent; }
.me-header-nav a.on { color: var(--dw-yellow); border-bottom-color: var(--dw-yellow); }
.me-cart-link { position: relative; color: var(--paper); display: inline-flex; }
.me-cart-link:hover { color: var(--dw-yellow); background: transparent; }
.me-cart-badge {
  position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--price-red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-body);
}

/* ---------- section heads ---------- */
.me-section-head { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.me-section-head.light { color: var(--paper); }
.me-section-h {
  font-family: var(--font-display-th); font-weight: 900; font-style: italic;
  font-size: clamp(32px,4.4vw,52px); line-height: .98; text-transform: uppercase; margin: 0; letter-spacing: -.005em;
}
.me-hl { background: var(--dw-yellow); padding: 0 10px 4px; box-shadow: 0 6px 0 0 var(--ink); display: inline-block; color: var(--ink); margin-bottom: 6px; }
.me-hl-text { color: var(--dw-yellow); }
.me-section-sub { font-family: var(--font-body); font-size: 17px; color: var(--fg-2); max-width: 56ch; line-height: 1.55; }

/* ---------- hero w/ search (premium animated yellow) ---------- */
.me-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 85% 12%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 42%),
    radial-gradient(90% 90% at 12% 95%, rgba(232,168,0,.55) 0%, rgba(232,168,0,0) 50%),
    linear-gradient(135deg, var(--dw-yellow-soft) 0%, var(--dw-yellow) 48%, var(--dw-yellow-deep) 100%);
}
.me-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(11,11,11,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(11,11,11,.05) 1px, transparent 1px);
  background-size: 38px 38px; mask-image: linear-gradient(180deg, #000, transparent 80%);
}
.me-hero::after {
  content: ""; position: absolute; top: -60%; left: -40%; width: 45%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: rotate(16deg); pointer-events: none; animation: hero-sheen 6.5s ease-in-out infinite;
}
@keyframes hero-sheen { 0% { left: -45%; } 55%, 100% { left: 130%; } }
.me-hero-grid { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 52px 28px 0; display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: end; min-height: 440px; }
.me-hero-stripes, .me-hero-bar { position: relative; z-index: 2; }
.me-caret { display: inline-block; width: 3px; height: .92em; margin-left: 4px; background: var(--ink); vertical-align: -2px; animation: me-blink 1s steps(1) infinite; }
@keyframes me-blink { 50% { opacity: 0; } }
.me-hero-copy { padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.me-hero-h { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: clamp(44px,6.5vw,88px); line-height: .92; letter-spacing: -.01em; color: var(--ink); text-transform: uppercase; margin: 0; }
.me-hero-h .en { font-family: var(--font-display-en); font-weight: 400; font-style: italic; }
/* บรรทัดข้อความพิมพ์อัตโนมัติ: กันหน้าจอ "สั่น" — จองความสูงตามวลีที่ยาวที่สุด (คำนวณใน JS) */
.me-hero-h .me-type-line { display: block; }
.me-hero-sub { font-family: var(--font-body); font-size: 18px; color: var(--ink); font-weight: 500; max-width: 48ch; line-height: 1.55; margin: 0; }
.me-hero-sub strong { font-weight: 800; }
.me-hero-mascot { height: 440px; background-size: contain; background-repeat: no-repeat; background-position: bottom right; }
.me-hero-stripes { height: 14px; background: var(--hazard-stripes-tight); }
.me-hero-bar { background: var(--ink); color: var(--paper); padding: 14px 28px; font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; text-align: center; }

/* search bar */
.me-search {
  background: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 rgba(0,0,0,.25);
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 12px; margin-top: 6px; max-width: 640px;
}
.me-search input, .me-search select {
  font-family: var(--font-body); font-size: 15px; border: none; padding: 12px 14px; background: #fff; color: var(--ink); border-radius: 0;
}
.me-search input:focus, .me-search select:focus { outline: 3px solid var(--dw-yellow); outline-offset: -3px; }

/* ---------- categories strip ---------- */
.me-cats { padding: 72px 0 8px; }
/* ---------- ดาวรีวิว (rating) ---------- */
.me-stars { letter-spacing: 1px; font-size: 15px; line-height: 1; }
.me-star { color: var(--concrete-300, #BFBDB8); }
.me-star.on { color: #F5A623; }
.me-rate-count { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); margin-left: 6px; }
.me-rate-none { font-family: var(--font-body); font-size: 12px; color: var(--fg-3); }
.card-rate { margin: 2px 0 4px; }
.pd-rate { margin: 2px 0 8px; }
.me-rate-widget { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.me-star-btn { background: none; border: none; cursor: pointer; font-size: 30px; line-height: 1; padding: 0 2px; color: var(--concrete-300, #BFBDB8); transition: color 80ms, transform 80ms; }
.me-star-btn.on { color: #F5A623; }
.me-star-btn.hover { color: #FFCC4D; }
.me-star-btn:hover { transform: scale(1.15); }
.me-rate-hint { font-family: var(--font-body); font-size: 13px; color: var(--fg-2); margin-left: 8px; }
.pd-rate-give { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; padding: 12px 14px; background: var(--dw-yellow-pale, #FFF1C4); border: 2px solid var(--dw-yellow-deep, #E8A800); border-radius: 8px; }
.pd-rate-give-label { font-family: var(--font-body); font-weight: 700; }
.order-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 8px; }
.order-rate-label { font-family: var(--font-body); font-size: 13px; color: var(--fg-2); }
.order-rate .me-star-btn { font-size: 24px; }

/* ---------- รีวิวในหน้าสินค้า ---------- */
.pd-reviews { margin-top: 40px; border-top: 3px solid var(--ink); padding-top: 22px; }
.pd-rev-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pd-rev-avg { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 40px; line-height: 1; }
.pd-rev-cnt { font-family: var(--font-body); color: var(--fg-2); }
.pd-rev-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.rv-empty { font-family: var(--font-body); color: var(--fg-3); padding: 14px 0; }
.rv-item { border: 2px solid var(--border-3); border-radius: 8px; padding: 12px 14px; background: #fff; }
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rv-name { font-family: var(--font-body); font-weight: 700; }
.rv-comment { font-family: var(--font-body); margin: 6px 0; color: var(--fg-1); white-space: pre-wrap; }
.rv-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.rv-img { width: 84px; height: 84px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border-3); }
.rv-date { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.rv-form { border: 2px dashed var(--dw-yellow-deep, #E8A800); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--dw-yellow-pale, #FFF1C4); }
.rv-form-title { font-family: var(--font-body); font-weight: 700; font-size: 16px; }
.rv-pick { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rv-pick-hint { font-family: var(--font-body); font-size: 13px; color: var(--fg-2); margin-left: 8px; }
.rv-input { font-family: var(--font-body); font-size: 15px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 6px; width: 100%; }
.rv-photos { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rv-preview { display: flex; gap: 8px; flex-wrap: wrap; }

/* breadcrumb หมวดหมู่ */
.cat-crumb { font-family: var(--font-body); font-size: 14px; color: var(--fg-2); margin: 4px 0 14px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.cat-crumb a { color: var(--fg-2); text-decoration: none; }
.cat-crumb a:hover { color: var(--ink); background: var(--dw-yellow); }
.cat-crumb .crumb-cur { color: var(--ink); font-weight: 700; }
.cat-crumb .crumb-sep { color: var(--fg-3); }

/* category grid — สไตล์ช่องหมวด (iToolmart-like): ไอคอนกลาง + ชื่อใต้ภาพ */
.me-cats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 28px; }
.me-cat {
  background: var(--concrete-100, #ECEAE4); border: 2px solid transparent; border-radius: 10px;
  padding: 16px 8px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  min-height: 132px;
  transition: transform 140ms var(--ease-snap), background 140ms, border-color 140ms, box-shadow 140ms;
}
.me-cat:hover { background: var(--dw-yellow); border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 8px 16px -7px rgba(0,0,0,.35); }
.me-cat-ic { color: var(--ink); display: flex; align-items: center; justify-content: center; height: 54px; }
.me-cat-ic svg { stroke: var(--ink); width: 48px; height: 48px; }
.me-cat-img { width: 58px; height: 58px; object-fit: contain; display: block; }
.me-cat-name { font-family: var(--font-body); font-weight: 700; font-size: 14px; line-height: 1.25; }
.me-cat-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* ---------- how it works ---------- */
.me-how { padding: 72px 0; }
.me-how-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 32px; }
.me-step { background: var(--paper); border-left: 6px solid var(--dw-yellow); padding: 8px 0 8px 22px; display: flex; flex-direction: column; gap: 8px; }
.me-step-n { font-family: var(--font-display-en); font-style: italic; font-size: 44px; color: var(--dw-yellow); -webkit-text-stroke: 2px var(--ink); line-height: 1; }
.me-step-h { font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 22px; text-transform: uppercase; margin: 0; }
.me-step-b { font-family: var(--font-body); font-size: 15px; color: var(--fg-2); margin: 0; }

/* ---------- value props ---------- */
.me-vp { max-width: 1280px; margin: 0 auto; padding: 24px 28px 80px; display: flex; flex-direction: column; gap: 32px; }
.me-vp-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.me-vp-card { background: #fff; border: 3px solid var(--ink); padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 4px 4px 0 0 var(--ink); }
.me-vp-top { display: flex; align-items: center; justify-content: space-between; }
.me-vp-num { font-family: var(--font-display-en); font-style: italic; font-size: 40px; font-weight: 400; line-height: 1; color: var(--dw-yellow); -webkit-text-stroke: 2px var(--ink); }
.me-vp-top svg { stroke: var(--ink); }
.me-vp-h { font-family: var(--font-display-th); font-weight: 900; font-style: italic; font-size: 26px; line-height: 1; text-transform: uppercase; margin: 0; }
.me-vp-body { font-family: var(--font-body); font-size: 15px; line-height: 1.55; margin: 0; flex: 1; }

/* ---------- brands ---------- */
.me-brands { background: var(--ink); color: var(--paper); padding: 64px 28px; }
.me-brands-inner { max-width: 1280px; margin: 0 auto; }
.me-brands .me-section-h, .me-brands .me-section-head { color: var(--paper); }
.me-brands .me-overline { color: var(--dw-yellow); }
/* แถวแบรนด์: เลื่อนเองได้ (มือ) + เลื่อนอัตโนมัติลื่นๆ (rAF) — หยุดเมื่อแตะ/ชี้ */
.me-brands-strip { margin-top: 32px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 8px; }
.me-brands-strip::-webkit-scrollbar { display: none; }
.me-brands-track { display: flex; width: max-content; }
.me-brands-track.me-brands-static { width: auto; justify-content: center; flex-wrap: wrap; gap: 12px; }
.me-brands-track .me-brand-card { flex: 0 0 clamp(124px, 38vw, 150px); margin-right: 12px; }
.me-brands-track.me-brands-static .me-brand-card { margin-right: 0; flex: 1 1 clamp(140px, 30vw, 260px); }
.me-brand-card { background: var(--ink-soft); border: 2px solid var(--concrete-700); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; text-align: center; position: relative; text-decoration: none; color: var(--paper); cursor: pointer; transition: all 140ms cubic-bezier(.2,.8,.2,1); }
.me-brand-card:hover { transform: translateY(-3px); border-color: var(--dw-yellow); background: var(--ink); }
.me-brand-card.is-primary:hover { background: var(--dw-yellow-deep); }

/* ---------- FAQ accordion ---------- */
.me-faq { padding: 72px 0; }
.me-faq-list { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.faq-item { border: 3px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 0 var(--ink); }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; background: #fff; border: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 16px; text-align: left; color: var(--ink); }
.faq-q:hover { background: var(--dw-yellow-pale); }
.faq-ic { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 22px; line-height: 1; width: 28px; height: 28px; display: grid; place-items: center; background: var(--dw-yellow); border: 2px solid var(--ink); flex: 0 0 auto; transition: transform 160ms; }
.faq-item.open .faq-ic { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; padding: 0 20px; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--fg-1); transition: max-height 240ms ease, padding 240ms ease; }
.faq-item.open .faq-a { max-height: 360px; padding: 0 20px 18px; }

/* ---------- header profile avatar + dropdown ---------- */
.me-profile { position: relative; flex: 0 0 auto; margin-left: 2px; }
.me-avatar { width: 38px; height: 38px; border-radius: 999px; overflow: hidden; background: var(--dw-yellow); border: 2px solid var(--dw-yellow); padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-avatar-ph { font-family: var(--font-display-th), var(--font-body); font-weight: 900; font-size: 19px; line-height: 1; text-transform: uppercase; color: var(--ink); }
.me-avatar.lg { width: 64px; height: 64px; border-width: 3px; }
.me-avatar.lg .me-avatar-ph { font-size: 32px; }
.me-profile-menu { position: absolute; top: calc(100% + 10px); right: 0; width: min(280px, calc(100vw - 24px)); background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 8px 8px 0 0 rgba(0,0,0,.35); z-index: 300; }
.me-profile-head { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--ink); color: var(--paper); }
.me-avatar-edit { position: relative; cursor: pointer; flex: 0 0 auto; }
.me-avatar-cam { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; background: var(--dw-yellow); border: 2px solid var(--ink); border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.me-profile-id { min-width: 0; flex: 1; }
.me-profile-name { font-family: var(--font-body); font-weight: 800; font-size: 16px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-profile-row { font-family: var(--font-body); font-size: 12.5px; color: var(--concrete-300); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-profile-links { display: flex; flex-direction: column; padding: 6px; }
.me-profile-links a, .me-profile-links button { font-family: var(--font-body); font-weight: 600; font-size: 14px; text-align: left; color: var(--ink); text-decoration: none; background: none; border: none; padding: 11px 12px; cursor: pointer; border-radius: 4px; }
.me-profile-links a:hover, .me-profile-links button:hover { background: var(--dw-yellow-pale, #fff1c4); }
.me-profile-links button { color: var(--price-red); border-top: 1px solid var(--concrete-200, #e7e5e0); margin-top: 4px; }

/* ---------- header login button visible on dark ---------- */
.me-header .me-acct .me-btn-ghost { color: var(--paper); border-color: var(--paper); box-shadow: 3px 3px 0 0 rgba(255,255,255,.18); }
.me-header .me-acct .me-btn-ghost:hover { background: var(--dw-yellow); color: var(--ink); border-color: var(--dw-yellow); }

/* ---------- promo banner (below hero) ---------- */
.me-promo { padding: 28px 0 0; }
.me-promo-card { background: linear-gradient(120deg, var(--ink), var(--ink-soft)); border: 3px solid var(--ink); box-shadow: 8px 8px 0 0 var(--dw-yellow); display: grid; grid-template-columns: 260px 1fr; overflow: hidden; }
.me-promo-img { background-size: contain; background-position: center; min-height: 190px; }
.me-promo-body { padding: 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.me-promo-tag { font-family: var(--font-display-en); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dw-yellow); }
.me-promo-title { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: clamp(24px,3vw,38px); text-transform: uppercase; color: #fff; margin: 0; line-height: 1; }
.me-promo-text { font-family: var(--font-body); color: var(--concrete-200); margin: 0; line-height: 1.55; }
.me-promo-date { font-family: var(--font-body); color: #fff; font-weight: 700; margin: 0; }
.me-promo-cond { font-family: var(--font-body); color: var(--concrete-200); font-size: 12px; margin: 2px 0 0; opacity: .8; }
.me-promo-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
/* multi-image swipeable slider (เลื่อนซ้าย-ขวา) */
.me-promo-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; min-height: 190px; }
.me-promo-slider::-webkit-scrollbar { display: none; }
.me-promo-slide { flex: 0 0 100%; scroll-snap-align: center; background-size: contain; background-position: center; min-height: 190px; }
@media (max-width: 720px) {
  .me-promo-card { grid-template-columns: 1fr; }
  .me-promo-slide, .me-promo-slider, .me-promo-img { min-height: 220px; }
}

/* ---------- flash sale (below brands) ---------- */
.me-flash { background: var(--ink); padding: 56px 0; }
.me-flash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.me-countdown { display: flex; gap: 10px; }
.cd-box { background: var(--dw-yellow); border: 2px solid #000; box-shadow: 3px 3px 0 0 rgba(0,0,0,.45); padding: 8px 12px; min-width: 60px; text-align: center; display: flex; flex-direction: column; }
.cd-n { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 26px; line-height: 1; color: var(--ink); }
.cd-l { font-family: var(--font-body); font-size: 11px; color: var(--ink); }
.cd-end { color: #fff; font-family: var(--font-body); font-weight: 700; }
.card.flash { position: relative; background: #fff; animation: flash-glow 2.6s ease-in-out infinite; }
.card.flash::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; padding: 3px;
  background: conic-gradient(from var(--ga), #ff4136, var(--dw-yellow), #fff, var(--dw-yellow-deep), #ff4136);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; animation: card-run 2.2s linear infinite; }
@keyframes flash-glow { 50% { box-shadow: 0 12px 34px -8px rgba(232,168,0,.75); transform: translateY(-3px); } }
.flash-badge { position: absolute; top: -10px; left: -10px; z-index: 7; background: var(--price-red); color: #fff; font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 16px; padding: 6px 12px; border: 2px solid var(--ink); box-shadow: 3px 3px 0 0 var(--ink); transform: rotate(-6deg); }
.price-was { font-family: var(--font-body); font-size: 13px; color: var(--fg-3); text-decoration: line-through; }

/* ---------- order cancel / refund ---------- */
.order-actions { margin-top: 12px; border-top: 2px solid var(--border-3); padding-top: 12px; }
.order-cancelled { margin-top: 12px; background: #fdecea; border: 2px solid var(--price-red); color: var(--price-red); padding: 10px 14px; font-family: var(--font-body); font-weight: 700; font-size: 13px; }
.order-msg { margin-top: 12px; background: var(--dw-yellow-pale); border: 2px solid var(--dw-yellow-deep); border-left: 6px solid var(--dw-yellow-deep); padding: 10px 14px; font-family: var(--font-body); font-size: 14px; color: var(--ink); }
.qr-status[hidden] { display: none; }
.me-brand-card.is-primary { background: var(--dw-yellow); border-color: var(--dw-yellow); color: var(--ink); }
.me-brand-name { font-family: var(--font-display-en); font-style: italic; font-size: 22px; line-height: 1; }
.me-brand-tag { font-family: var(--font-body); font-size: 11px; color: var(--concrete-300); }
.me-brand-card.is-primary .me-brand-tag { color: var(--ink); font-weight: 600; }
.me-brand-stamp { position: absolute; top: -10px; right: -8px; background: var(--ink); color: var(--dw-yellow); font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 10px; padding: 3px 8px; transform: rotate(4deg); }

/* ---------- product tiles (the "photo") ---------- */
.tile { position: relative; aspect-ratio: 4/3; background: var(--dw-yellow); border-bottom: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-lg { aspect-ratio: 1/1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); }
.tile-grid { position: absolute; inset: 0; background: linear-gradient(var(--ink) 1px,transparent 1px) 0 0/26px 26px, linear-gradient(90deg,var(--ink) 1px,transparent 1px) 0 0/26px 26px; opacity: .07; }
.tile-icon { color: var(--ink); z-index: 1; }
.tile-icon svg { stroke: var(--ink); stroke-width: 1.4; }
.tile-img { position: absolute; inset: 0; z-index: 1; background-size: cover; background-position: center; background-repeat: no-repeat; }
.tile-ph { background-size: contain; background-position: bottom right; }
.tile.has-img { background: var(--concrete-100); }
/* product detail gallery */
.pd-gallery { display: flex; flex-direction: column; gap: 12px; }
.pd-main { aspect-ratio: 1/1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); background-size: contain; background-position: center; background-color: var(--concrete-100); }
.pd-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-thumb { width: 64px; height: 64px; border: 2px solid var(--ink); background-size: contain; background-position: center; cursor: pointer; padding: 0; opacity: .6; transition: opacity 120ms; }
.pd-thumb.on, .pd-thumb:hover { opacity: 1; outline: 3px solid var(--dw-yellow); outline-offset: -2px; }

/* ===== product media viewer (gallery / 360 spin / exploded parts) ===== */
.pd-viewer { display: flex; flex-direction: column; gap: 12px; }
.pdv-tabs { display: flex; gap: 0; border: 3px solid var(--ink); flex-wrap: wrap; }
.pdv-tab { flex: 1 1 auto; font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 14px; padding: 10px 12px; background: #fff; border: none; border-right: 3px solid var(--ink); cursor: pointer; color: var(--ink); white-space: nowrap; }
.pdv-tab:last-child { border-right: none; }
.pdv-tab.on { background: var(--ink); color: var(--dw-yellow); }
.pdv-tab:hover:not(.on) { background: var(--dw-yellow); }
.pdv-panels { position: relative; }
.pdv-panel[hidden] { display: none; }

/* photos */
.pd-main { position: relative; cursor: zoom-in; }
.pd-zoom-hint { position: absolute; bottom: 8px; right: 8px; font-family: var(--font-mono); font-size: 11px; background: var(--ink); color: var(--dw-yellow); padding: 3px 8px; pointer-events: none; opacity: 0; transition: opacity 120ms; }
.pd-main:hover .pd-zoom-hint, .pd-main:focus .pd-zoom-hint { opacity: 1; }

/* 3D model viewer */
.pd-3d { display: flex; flex-direction: column; gap: 12px; }
.pd-3d-stage { position: relative; aspect-ratio: 1/1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); background: var(--concrete-100); overflow: hidden; }
.pd-3d-frame, .pd-3d-mv { display: block; width: 100%; height: 100%; border: 0; background: var(--concrete-100); }
.pd-3d-mv { --poster-color: transparent; }
.pd-3d-badge { position: absolute; top: 8px; left: 8px; z-index: 2; font-family: var(--font-display-en); font-style: italic; font-weight: 800; font-size: 13px; background: var(--workboot-blue); color: #fff; padding: 3px 9px; letter-spacing: .04em; pointer-events: none; }
.pd-3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; flex-direction: column; font-family: var(--font-mono); font-size: 12px; color: var(--ink); text-align: center; padding: 16px; }
.pd-3d-spinner { width: 30px; height: 30px; border: 3px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: pd3dspin .8s linear infinite; }
@keyframes pd3dspin { to { transform: rotate(360deg); } }
.pd-3d-cap { font-family: var(--font-mono); font-size: 11px; color: var(--concrete-600, #555); background: var(--concrete-100); border-left: 3px solid var(--ink); padding: 8px 10px; }

/* 360 spin */
.pd-spin { display: flex; flex-direction: column; gap: 12px; }
.pd-spin-stage { position: relative; aspect-ratio: 1/1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); background-size: contain; background-position: center; background-color: var(--concrete-100); cursor: grab; touch-action: pan-y; user-select: none; }
.pd-spin-stage.grabbing { cursor: grabbing; }
.pd-spin-badge { position: absolute; top: 8px; left: 8px; font-family: var(--font-display-en); font-style: italic; font-weight: 800; font-size: 13px; background: var(--workboot-blue); color: #fff; padding: 3px 9px; letter-spacing: .04em; }
.pd-spin-grab { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; background: var(--ink); color: var(--dw-yellow); padding: 3px 10px; pointer-events: none; }
.pd-spin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-spin-play { font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 13px; padding: 8px 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 0 var(--ink); cursor: pointer; color: var(--ink); white-space: nowrap; }
.pd-spin-play:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 0 var(--ink); }
.pd-spin-play.on { background: var(--ink); color: var(--dw-yellow); }
.pd-spin-range { flex: 1; min-width: 120px; accent-color: var(--ink); height: 6px; cursor: pointer; }

/* exploded parts */
.pd-parts { display: flex; flex-direction: column; gap: 12px; }
.pd-parts-stage { position: relative; aspect-ratio: 1/1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); background-size: contain; background-position: center; background-color: var(--concrete-100); }
.pd-parts-stage[data-noimg] { background-image: repeating-linear-gradient(45deg, var(--concrete-100) 0, var(--concrete-100) 12px, var(--concrete-300) 12px, var(--concrete-300) 24px); }
.pd-hot { position: absolute; transform: translate(-50%,-50%); width: 30px; height: 30px; border-radius: 999px; border: 3px solid var(--ink); background: var(--dw-yellow); color: var(--ink); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; box-shadow: 2px 2px 0 0 var(--ink); z-index: 2; }
.pd-hot::before { content: ""; position: absolute; inset: -6px; border-radius: 999px; border: 2px solid var(--dw-yellow); opacity: .9; animation: pd-hot-pulse 1.6s ease-out infinite; }
.pd-hot-num { font-family: var(--font-display-en); font-style: italic; font-weight: 800; font-size: 14px; line-height: 1; }
.pd-hot:hover { background: var(--ink); color: var(--dw-yellow); }
.pd-hot.open { background: var(--price-red); color: #fff; }
.pd-hot.open::before { animation: none; }
@keyframes pd-hot-pulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pd-hot::before { animation: none; } }
.pd-parts-cap { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--fg-1); background: var(--paper); border-left: 6px solid var(--dw-yellow); padding: 8px 12px; }
.pd-part-callout { position: absolute; z-index: 5; width: 180px; transform: translate(12px,-50%) scale(.92); opacity: 0; transition: opacity 140ms ease, transform 140ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.pd-part-callout.show { opacity: 1; transform: translate(12px,-50%) scale(1); pointer-events: auto; }
.pd-part-callout.flip { transform: translate(-100%,-50%) scale(.92); margin-left: -12px; }
.pd-part-callout.flip.show { transform: translate(-100%,-50%) scale(1); margin-left: -12px; }
.pd-part-img { width: 100%; aspect-ratio: 4/3; border: 3px solid var(--ink); background-size: contain; background-position: center; background-color: #fff; }
.pd-part-img--ph { display: flex; align-items: center; justify-content: center; font-family: var(--font-display-th); font-style: italic; font-weight: 800; color: var(--fg-3); background: repeating-linear-gradient(45deg, #fff 0, #fff 8px, var(--concrete-100) 8px, var(--concrete-100) 16px); }
.pd-part-meta { background: var(--ink); color: #fff; border: 3px solid var(--ink); border-top: none; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.pd-part-label { font-family: var(--font-display-th); font-style: italic; font-weight: 800; font-size: 15px; color: var(--dw-yellow); }
.pd-part-sku { font-family: var(--font-mono); font-size: 11px; color: #fff; opacity: .85; }
.pd-part-note { font-family: var(--font-body); font-size: 12px; line-height: 1.45; color: #fff; opacity: .9; }
.pd-part-close { align-self: flex-start; margin-top: 2px; font-family: var(--font-body); font-weight: 700; font-size: 11px; padding: 4px 10px; background: #fff; color: var(--ink); border: 2px solid #fff; cursor: pointer; }
.pd-part-close:hover { background: var(--dw-yellow); }

/* full-screen lightbox */
.pd-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(11,11,11,.92); display: flex; align-items: center; justify-content: center; padding: 40px; }
.pd-lb-img { width: min(86vw, 86vh); height: min(86vw, 86vh); background-size: contain; background-position: center; background-repeat: no-repeat; }
.pd-lb-close { position: absolute; top: 18px; right: 18px; width: 46px; height: 46px; font-size: 22px; line-height: 1; background: var(--ink); color: var(--dw-yellow); border: 3px solid var(--dw-yellow); cursor: pointer; }
.pd-lb-close:hover { background: var(--dw-yellow); color: var(--ink); }
.pd-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 32px; line-height: 1; background: var(--ink); color: var(--dw-yellow); border: 3px solid var(--dw-yellow); cursor: pointer; }
.pd-lb-nav:hover { background: var(--dw-yellow); color: var(--ink); }
.pd-lb-nav.prev { left: 18px; }
.pd-lb-nav.next { right: 18px; }
.pd-lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 13px; background: var(--ink); color: var(--dw-yellow); padding: 5px 12px; }

.tile-brand { position: absolute; top: 8px; left: 8px; z-index: 2; font-family: var(--font-display-en); font-style: italic; font-size: 13px; background: var(--ink); color: var(--dw-yellow); padding: 2px 8px; letter-spacing: .03em; }
.tile-badge { position: absolute; top: 8px; right: 8px; z-index: 2; font-family: var(--font-body); font-weight: 800; font-size: 10px; padding: 3px 8px; text-transform: uppercase; letter-spacing: .04em; border: 2px solid var(--ink); }
.tile-badge.rent { background: var(--workboot-blue); color: #fff; }
.tile-badge.sale { background: var(--price-red); color: #fff; }
.tile-badge.both { background: var(--dw-yellow); color: var(--ink); }
.tile-badge.out { background: var(--concrete-300); color: var(--ink); }
/* ป้าย "ใหม่" (มุมซ้ายล่าง) + แถบไอคอนวัสดุ/เซฟตี้ (ขวาล่าง) */
.tile-new { position: absolute; bottom: 8px; left: 8px; z-index: 2; font-family: var(--font-body); font-weight: 800; font-size: 10px; padding: 3px 8px; background: #1f9d4d; color: #fff; border: 2px solid var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.tile-mats { position: absolute; bottom: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; align-items: center; }
.tile-mat-ic { background: rgba(255,255,255,.92); border: 1.5px solid var(--ink); border-radius: 4px; padding: 1px 5px; font-size: 12px; line-height: 1.4; letter-spacing: 1px; }
.tile-safety { background: var(--dw-yellow); border: 1.5px solid var(--ink); border-radius: 4px; padding: 1px 4px; font-size: 12px; line-height: 1.4; }

/* ---------- shop layout ---------- */
.shop { padding: 32px 0 80px; }
.shop-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.shop-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
/* ปุ่มเปิด/ปิดตัวกรอง + สถานะซ่อนตัวกรอง */
.filter-toggle { font-family: var(--font-body); font-weight: 700; font-size: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); padding: 0 16px; border-radius: 6px; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.filter-toggle:hover, .filter-toggle.on { background: var(--dw-yellow); }
.shop-grid.filters-collapsed { grid-template-columns: 1fr; }
.shop-grid.filters-collapsed .filters { display: none; }
.shop-cats { margin: 0 0 20px; }
.filters { background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.filters h3 { font-family: var(--font-display-th); font-style: italic; text-transform: uppercase; font-size: 18px; margin: 0; }
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group .lbl { font-family: var(--font-display-en); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.check { display: flex; align-items: center; gap: 9px; font-family: var(--font-body); font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.filter-count { color: var(--fg-3); font-size: 12px; margin-left: 2px; }
.price-range-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.price-inp { width: 90px; padding: 7px 8px; border: 2px solid var(--ink); font-family: var(--font-body); font-size: 14px; background: #fff; flex: 1; }
.price-inp:focus { outline: 3px solid var(--dw-yellow); outline-offset: -2px; }
.search-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-row .inp { flex: 1; min-width: 200px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.result-count { font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); }

/* คอลัมน์ปรับอัตโนมัติตามความกว้างจอ: จอยิ่งกว้างยิ่งหลายคอลัมน์เอง */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 var(--ink); display: flex; flex-direction: column; transition: all 120ms cubic-bezier(.2,.8,.2,1); }
.card:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 0 var(--ink); }

/* running-light premium border for featured cards */
@property --ga { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
[data-featured] .card { position: relative; }
[data-featured] .card::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; padding: 3px;
  background: conic-gradient(from var(--ga), transparent 0deg, transparent 60deg, var(--dw-yellow-deep) 95deg, #fff 120deg, var(--dw-yellow) 145deg, transparent 180deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: card-run 3s linear infinite;
}
[data-featured] .card:hover::after { animation-duration: 1.6s; }
@keyframes card-run { to { --ga: 360deg; } }
@media (prefers-reduced-motion: reduce) { [data-featured] .card::after { animation: none; } }
.card a.tilelink { text-decoration: none; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-family: var(--font-display-en); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.card-name { font-family: var(--font-body); font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--ink); text-decoration: none; min-height: 39px; }
.card-name:hover { background: var(--dw-yellow); }
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price-buy { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 22px; color: var(--ink); }
.price-rent { font-family: var(--font-body); font-size: 13px; color: var(--workboot-blue); font-weight: 700; }
.card-stock { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.card-stock.low { color: var(--price-red); font-weight: 700; }
.card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.card-actions .me-btn { flex: 1; }

/* ---------- product detail ---------- */
.pd { padding: 32px 0 80px; }
.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin-bottom: 20px; }
.crumbs a { color: var(--fg-2); text-decoration: none; }
.crumbs a:hover { background: var(--dw-yellow); }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.pd-info { display: flex; flex-direction: column; gap: 16px; }
.pd-brand { font-family: var(--font-display-en); font-style: italic; font-size: 16px; background: var(--ink); color: var(--dw-yellow); padding: 3px 10px; align-self: flex-start; }
.pd-name { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: clamp(26px,3vw,40px); line-height: 1.02; text-transform: uppercase; margin: 0; }
.pd-desc { font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--fg-1); margin: 0; }
.pd-desc p { margin: 0 0 8px; }
.pd-desc p:last-child { margin-bottom: 0; }
.pd-desc-h { font-weight: 800; color: var(--ink); margin: 12px 0 4px; }
.pd-desc-list { margin: 4px 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pd-desc-list li { position: relative; padding-left: 22px; line-height: 1.5; }
.pd-desc-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--dw-yellow-deep, #b8860b); font-weight: 900; }
.pd-prices { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 0; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.pd-price-box .k { font-family: var(--font-display-en); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.pd-price-box .v { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 34px; line-height: 1; }
.pd-price-box .v.rent { color: var(--workboot-blue); }
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; padding: 10px 0; border-bottom: 2px solid var(--border-3); font-family: var(--font-body); font-size: 14px; }
.specs th { color: var(--fg-3); font-weight: 600; width: 40%; }
.specs td { font-weight: 700; }
.buybox { background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 3px solid var(--ink); }
.mode-toggle button { font-family: var(--font-display-th); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 15px; padding: 12px; background: #fff; border: none; cursor: pointer; color: var(--ink); }
.mode-toggle button.on { background: var(--ink); color: var(--dw-yellow); }
.mode-toggle button[disabled] { opacity: .4; cursor: not-allowed; }
.qty { display: flex; align-items: center; gap: 0; border: 3px solid var(--ink); width: max-content; }
.qty button { width: 40px; height: 40px; border: none; background: #fff; font-size: 22px; cursor: pointer; font-family: var(--font-display-th); }
.qty button:hover { background: var(--dw-yellow); }
.qty input { width: 56px; height: 40px; text-align: center; border: none; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); font-family: var(--font-mono); font-size: 16px; }
.buybox-line { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-body); font-size: 14px; }
.buybox-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px dashed var(--concrete-300); padding-top: 12px; }
.buybox-total .v { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 28px; }
.stockpill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 13px; font-weight: 700; padding: 5px 12px; border: 2px solid var(--ink); align-self: flex-start; }
.stockpill.in { background: var(--dw-yellow-pale); }
.stockpill.out { background: var(--concrete-200); color: var(--fg-2); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-family: var(--font-display-en); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.inp, input[type=text], input[type=tel], input[type=number], input[type=date], input[type=password], textarea, select.inp, select {
  font-family: var(--font-body); font-size: 15px; padding: 11px 13px; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; width: 100%;
}
.inp:focus, input:focus, textarea:focus, select:focus { outline: 3px solid var(--dw-yellow); outline-offset: -2px; }
textarea { resize: vertical; min-height: 80px; }

/* ---------- cart + checkout ---------- */
.cartpage { padding: 32px 0 80px; }
.cart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 0 var(--ink); padding: 12px; align-items: center; }
.cart-item .tile { aspect-ratio: 1/1; height: 90px; width: 90px; border-bottom: none; border: 2px solid var(--ink); }
.cart-item .tile-icon svg { width: 40px; height: 40px; }
.ci-info { display: flex; flex-direction: column; gap: 4px; }
.ci-name { font-family: var(--font-body); font-weight: 700; font-size: 15px; }
.ci-mode { font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 2px 8px; border: 2px solid var(--ink); align-self: flex-start; }
.ci-mode.rent { background: var(--workboot-blue); color: #fff; }
.ci-mode.buy { background: var(--dw-yellow); color: var(--ink); }
.ci-controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ci-total { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 20px; }
.linkbtn { background: none; border: none; color: var(--price-red); font-family: var(--font-body); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.summary { background: var(--ink); color: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 rgba(0,0,0,.25); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.summary h3 { font-family: var(--font-display-th); font-style: italic; text-transform: uppercase; color: var(--paper); margin: 0; font-size: 22px; }
.summary-line { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: 14px; color: var(--concrete-200); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--concrete-700); padding-top: 14px; }
.summary-total .v { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 30px; color: var(--dw-yellow); }
.summary .note { font-family: var(--font-body); font-size: 12px; color: var(--concrete-300); line-height: 1.5; }
.empty { background: #fff; border: 3px dashed var(--concrete-300); padding: 56px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty-ic { color: var(--concrete-300); }

/* checkout form panel */
.panel { background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 var(--ink); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.panel h3 { font-family: var(--font-display-th); font-style: italic; text-transform: uppercase; margin: 0; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- orders page ---------- */
.orders-page { padding: 32px 0 80px; }
.order-card { background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 var(--ink); padding: 18px; margin-bottom: 16px; }
.order-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; border-bottom: 2px solid var(--border-3); padding-bottom: 12px; margin-bottom: 12px; }
.order-id { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.order-meta { font-family: var(--font-body); font-size: 13px; color: var(--fg-2); }
.order-line { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: 14px; padding: 4px 0; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: 12px; padding: 4px 10px; border: 2px solid var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.chip.new { background: var(--dw-yellow); color: var(--ink); }
.chip.paid { background: var(--workboot-blue); color: #fff; }
.chip.fulfilled { background: var(--tape-green); color: #fff; }
.chip.returned { background: var(--concrete-200); color: var(--ink); }
.chip.cancelled { background: var(--price-red); color: #fff; }
.chip.buy { background: var(--dw-yellow); color: var(--ink); }
.chip.rent { background: var(--workboot-blue); color: #fff; }

/* ---------- shop feature toggles (rent on/off) ---------- */
/* body.no-rent → ซ่อนทุกอย่างเกี่ยวกับเช่าทันที (Phase B+) */
body.no-rent .tile-badge.rent,
body.no-rent .tile-badge.both,
body.no-rent [data-rent-only],
body.no-rent .chip.rent { display: none !important; }
body.no-rent .tile-rent { display: none !important; }
body.no-rent .mode-toggle { grid-template-columns: 1fr !important; }
body.no-rent .mode-toggle [data-mode="rent"] { display: none !important; }
body.no-rent .mode-toggle [data-mode="buy"] { width: 100%; text-align: center; }

/* ---------- toast ---------- */
/* ---------- chat widget ---------- */
.me-chat { position: fixed; bottom: 22px; left: 22px; z-index: 190; }
.me-chat.me-chat-right { left: auto; right: 22px; }
.me-chat.me-chat-right .me-chat-panel { left: auto; right: 0; }
.me-chat-empty { padding: 24px 12px; text-align: center; color: var(--fg-2); font-family: var(--font-body); font-size: 13px; line-height: 1.5; }
.me-chat-fab { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 0 var(--dw-yellow); font-family: var(--font-display-th); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 14px; padding: 12px 18px; cursor: pointer; }
.me-chat-fab:hover { background: var(--ink-soft); }
.me-chat-fab svg { stroke: var(--dw-yellow); }
.me-chat-panel { position: absolute; bottom: 58px; left: 0; width: 320px; max-width: 86vw; background: #fff; border: 3px solid var(--ink); box-shadow: 8px 8px 0 0 var(--ink); display: flex; flex-direction: column; overflow: hidden; }
.me-chat-panel[hidden] { display: none; }
.me-chat-head { background: var(--ink); color: var(--paper); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display-th); font-style: italic; font-weight: 800; }
.me-chat-head button { background: none; border: none; color: var(--paper); font-size: 22px; cursor: pointer; line-height: 1; }
.me-chat-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; height: 300px; overflow-y: auto; background: var(--paper); }
.me-chat-msg { font-family: var(--font-body); font-size: 14px; padding: 9px 12px; max-width: 85%; line-height: 1.45; }
.me-chat-msg.bot { background: #fff; border: 2px solid var(--ink); align-self: flex-start; }
.me-chat-msg.me { background: var(--dw-yellow); border: 2px solid var(--ink); align-self: flex-end; }
.me-chat-msg.shop { background: var(--tape-green); color: #fff; border: 2px solid var(--ink); align-self: flex-start; }
.chat-who { display: block; font-size: 10px; font-weight: 800; opacity: .85; margin-bottom: 2px; }
.me-chat-input { display: flex; gap: 8px; padding: 10px; border-top: 2px solid var(--ink); background: #fff; }
.me-chat-input input { flex: 1; border: 2px solid var(--ink); padding: 9px 11px; font-family: var(--font-body); font-size: 14px; }
.me-chat-input input:focus { outline: 3px solid var(--dw-yellow); outline-offset: -2px; }

.me-toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.me-toast { background: var(--ink); color: var(--paper); border-left: 5px solid var(--dw-yellow); padding: 13px 18px; box-shadow: 6px 6px 0 0 rgba(0,0,0,.3); font-family: var(--font-body); font-weight: 600; font-size: 14px; transform: translateX(120%); transition: transform 250ms cubic-bezier(.2,.8,.2,1); max-width: 340px; }
.me-toast.show { transform: translateX(0); }
.me-toast.ok { border-left-color: var(--tape-green); }
.me-toast.err { border-left-color: var(--price-red); }

/* ---------- fulfillment toggle + address cascade ---------- */
.ful-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ful-opt { border: 3px solid var(--ink); background: #fff; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; transition: all 120ms cubic-bezier(.2,.8,.2,1); }
.ful-opt:hover { background: var(--dw-yellow-pale); }
.ful-opt.on { background: var(--dw-yellow); box-shadow: 4px 4px 0 0 var(--ink); }
.ful-opt .t { font-family: var(--font-display-th); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 16px; }
.ful-opt .d { font-family: var(--font-body); font-size: 12px; color: var(--fg-2); }
.addr-cascade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.addr-cascade .full { grid-column: 1 / -1; }
.addr-cascade[hidden] { display: none; }
/* กล่องกรอกข้อมูลใบกำกับภาษี (ช่าง/บริษัท) */
.tax-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border: 2px dashed var(--border-3, #d8d2c4); border-radius: 8px; padding: 14px; margin: 4px 0 12px; }
.tax-fields .full { grid-column: 1 / -1; }
.tax-fields[hidden] { display: none; }
@media (max-width: 860px) { .tax-fields { grid-template-columns: 1fr; } }
.req-note { font-family: var(--font-body); font-size: 12px; color: var(--price-red); }

/* ---------- payment / QR modal ---------- */
.me-modal-bg { position: fixed; inset: 0; background: rgba(11,11,11,.7); display: grid; place-items: center; z-index: 195; padding: 20px; }
.me-modal { background: var(--paper); border: 4px solid var(--ink); box-shadow: 12px 12px 0 0 rgba(0,0,0,.4); width: 100%; max-width: 420px; max-height: 92vh; overflow: auto; }
.me-modal-head { background: var(--ink); color: var(--paper); padding: 16px 22px; display: flex; justify-content: space-between; align-items: center; }
.me-modal-head h3 { font-family: var(--font-display-th); font-style: italic; text-transform: uppercase; margin: 0; font-size: 20px; }
.me-modal-x { background: none; border: none; color: var(--paper); font-size: 26px; cursor: pointer; line-height: 1; }
.me-modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.qr-card { background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 0 var(--ink); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-pp { font-family: var(--font-display-en); font-style: italic; font-weight: 700; letter-spacing: .06em; color: var(--workboot-blue); font-size: 16px; }
.qr-pp b { color: var(--price-red); }
.qr-amount { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 30px; }
.qr-locked { display: inline-block; vertical-align: middle; font-family: var(--font-body); font-style: normal; font-weight: 700; font-size: 11px; color: #157a3a; background: #def7e5; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.qr-cap { font-family: var(--font-body); font-size: 12px; color: var(--fg-3); }
.qr-img { width: 200px; height: 200px; object-fit: contain; display: block; }
.qr-expired { width: 200px; height: 200px; display: grid; place-items: center; text-align: center; font-family: var(--font-body); font-weight: 700; color: var(--price-red); border: 2px dashed var(--price-red); }
.qr-status { font-family: var(--font-body); font-size: 13px; font-weight: 700; padding: 8px 14px; border: 2px solid var(--ink); width: 100%; text-align: center; background: var(--concrete-100); }
.qr-status.checking { background: var(--dw-yellow-pale); border-color: var(--dw-yellow-deep); }
.qr-status.ok { background: var(--tape-green); color: #fff; border-color: var(--tape-green); }
.qr-status.err { background: #fde8e8; color: #c0392b; border-color: #c0392b; }
.slip-upload { width: 100%; border: 2px dashed var(--ink); padding: 12px; text-align: center; }
.slip-up-label { font-family: var(--font-body); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.slip-pick { margin: 0; }
.slip-prev { margin-top: 8px; }
.slip-prev img { max-width: 160px; max-height: 200px; border: 1px solid var(--ink); border-radius: 4px; }
.slip-manual { margin-top: 6px; background: none; border: none; color: #c0392b; font-weight: 700; text-decoration: underline; cursor: pointer; font-family: var(--font-body); font-size: 13px; }
.me-modal-foot { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.pay-rows { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.pay-rows .r { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: 14px; }
.pay-rows .r.total { border-top: 2px dashed var(--concrete-300); padding-top: 8px; font-weight: 800; }

/* ---------- auth pages ---------- */
.auth-wrap { padding: 56px 28px 80px; display: grid; place-items: center; }
.auth-card { background: #fff; border: 3px solid var(--ink); box-shadow: 8px 8px 0 0 var(--ink); padding: 32px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-family: var(--font-display-th); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 30px; margin: 0; }
.auth-sub { font-family: var(--font-body); font-size: 14px; color: var(--fg-2); margin: 0 0 4px; }
.auth-alt { font-family: var(--font-body); font-size: 14px; text-align: center; color: var(--fg-2); }
.auth-alt a { color: var(--ink); font-weight: 700; }
.auth-hint { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); background: var(--dw-yellow-pale); border: 2px dashed var(--dw-yellow-deep); padding: 10px 12px; }
.auth-note { font-family: var(--font-body); font-size: 12px; color: var(--fg-3); text-align: center; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--fg-3); font-family: var(--font-body); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border-3); }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border: 2px solid var(--ink); background: #fff; font-family: var(--font-body); font-weight: 700; font-size: 14px; cursor: pointer; }
.social-btn:hover { background: var(--concrete-100); }
.social-ic { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; color: #fff; font-weight: 900; font-family: Arial, sans-serif; }
.social-btn.google .social-ic { background: #4285F4; }
.social-btn.facebook .social-ic { background: #1877F2; }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.otp-verify { display: flex; gap: 8px; margin-top: 8px; }
.otp-verify input { flex: 1; }
.otp-status { font-family: var(--font-body); font-size: 12px; margin-top: 6px; }
.otp-status.sending { color: var(--dw-yellow-deep); }
.otp-status.ok { color: var(--tape-green); font-weight: 700; }

/* ---------- header right + account ---------- */
.me-header-right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex: 0 0 auto; }
.me-acct { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-acct-name { font-family: var(--font-body); font-size: 13px; color: var(--dw-yellow); font-weight: 700; text-decoration: none; }
.me-acct-name:hover { text-decoration: underline; }
.me-acct-link { background: none; border: none; color: var(--paper); font-family: var(--font-body); font-size: 13px; cursor: pointer; text-decoration: none; padding: 0; }
.me-acct-link:hover { color: var(--dw-yellow); background: transparent; }

/* ---------- footer (EasyRent-style, DeWalt colours) ---------- */
.me-footer { background: var(--ink); color: var(--paper); }
.me-footer-stripes { height: 10px; background: var(--hazard-stripes-tight); }
.me-footer-inner { max-width: 1280px; margin: 0 auto; padding: 56px 28px 32px; display: grid; grid-template-columns: 1.9fr 1fr 1fr 1fr; gap: 40px; }
.me-footer-wm { font-family: var(--font-wordmark); font-weight: 900; font-size: 34px; line-height: 1; }
.me-footer-company { font-family: var(--font-body); font-weight: 700; font-size: 15px; color: var(--dw-yellow); margin: 8px 0 14px; }
.me-footer-rows { display: flex; flex-direction: column; gap: 10px; }
.me-footer-row { display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-body); font-size: 14px; color: var(--concrete-200); }
.me-footer-row svg { stroke: var(--dw-yellow); flex: 0 0 auto; margin-top: 2px; }
.me-footer-row a { color: var(--concrete-200); text-decoration: none; }
.me-footer-row a:hover { color: var(--dw-yellow); background: transparent; }
.me-socials { display: flex; gap: 10px; margin-top: 16px; }
.me-soc { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ink-soft); border: 2px solid var(--concrete-700); color: var(--paper); text-decoration: none; transition: all 140ms cubic-bezier(.2,.8,.2,1); }
.me-soc:hover { background: var(--dw-yellow); color: var(--ink); border-color: var(--dw-yellow); transform: translateY(-2px); }
.me-footer-col { display: flex; flex-direction: column; gap: 8px; }
.me-footer-h { font-family: var(--font-display-en); font-size: 11px; letter-spacing: .18em; color: var(--dw-yellow); text-transform: uppercase; margin-bottom: 6px; }
.me-footer-col a { color: var(--concrete-200); text-decoration: none; font-family: var(--font-body); font-size: 14px; }
.me-footer-col a:hover { color: var(--dw-yellow); background: transparent; }
.me-footer-col > div { font-family: var(--font-body); font-size: 14px; color: var(--concrete-300); }
.me-footer-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--ink-soft); border: 1px solid var(--concrete-700); font-size: 12px; color: var(--paper); font-weight: 700; margin-top: 6px; align-self: flex-start; }
.me-footer-pill.open { border-color: var(--tape-green); color: #fff; }
.me-footer-pill.closed { border-color: var(--price-red); color: #ffb4ad; }
.dot-closed { background: var(--price-red); box-shadow: 0 0 0 4px rgba(196,30,30,.3); }
.me-footer-foot { border-top: 1px solid var(--concrete-700); padding: 18px 28px; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--concrete-500); flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .me-cats-grid { grid-template-columns: repeat(3,1fr); }
  .me-vp-grid, .me-how-grid { grid-template-columns: 1fr; }
  .me-brands-strip { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 860px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .me-header-inner { flex-wrap: wrap; gap: 12px 18px; padding: 12px 20px; }
  .me-header-nav { order: 3; flex: 0 0 100%; gap: 14px 16px; }
  .me-hero-grid { grid-template-columns: 1fr; padding: 36px 22px 0; min-height: 0; gap: 16px; }
  .me-hero-mascot { height: 220px; background-position: bottom center; }
  .me-search { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
  .filters { position: static; }
  .pd-grid { grid-template-columns: 1fr; gap: 24px; }
  .cart-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .me-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .me-footer-foot { flex-direction: column; text-align: center; }
  .me-header-right { gap: 10px; }
}
@media (max-width: 520px) {
  .me-footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .me-brands-strip { grid-template-columns: repeat(2,1fr); }
  .cards { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .card-body { padding: 10px; gap: 6px; }
  .card-name { font-size: 13.5px; min-height: 35px; }
  .price-buy { font-size: 19px; }
  .card-actions { padding: 0 10px 10px; gap: 6px; }
  .me-cats-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .me-cat { min-height: 112px; padding: 12px 6px; }
  .me-cat-ic svg, .me-cat-img { width: 40px; height: 40px; }
  .me-cat-name { font-size: 12px; }
  .pd-prices { gap: 16px; }
  /* chat widget + LINE FAB ขยับสั้นลง + ปุ่มเล็กลงเพื่อไม่บัง content */
  .me-chat-fab { font-size: 12px; padding: 10px 14px; }
  .me-chat { bottom: 14px; left: 14px; }
  .me-chat.me-chat-right { right: 14px; }
  .me-chat-panel { width: 92vw; max-width: 360px; }
  .me-chat-body { height: 260px; }
  /* auth forms */
  .auth-card { padding: 22px 18px; margin: 16px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }

/* ===================== เครื่องมือเปรียบเทียบสินค้า ===================== */
.card-cmp { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 12px; color: var(--fg-2); margin-top: 6px; cursor: pointer; user-select: none; }
.card-cmp input { width: 15px; height: 15px; accent-color: var(--ink); }
.cmp-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 188; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--paper); border: 3px solid var(--dw-yellow); box-shadow: 5px 5px 0 0 rgba(0,0,0,.3); padding: 10px 16px; max-width: calc(100vw - 24px); }
.cmp-bar-n { font-family: var(--font-body); font-weight: 700; font-size: 14px; }
.cmp-bar .linkbtn { color: var(--dw-yellow); }
.cmp-modal { max-width: min(960px, 96vw); width: 100%; }
.cmp-wrap { overflow: auto; max-height: 74vh; }
.cmp-table { border-collapse: collapse; width: 100%; font-family: var(--font-body); font-size: 14px; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border-3); padding: 8px 10px; text-align: left; vertical-align: middle; min-width: 130px; }
.cmp-table th { background: var(--bg-2); font-weight: 700; position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.cmp-table tr:first-child td { text-align: center; }
.cmp-table .cmp-img .tile { width: 120px; height: 90px; margin: 0 auto; }
.cmp-table a { color: var(--ink); text-decoration: none; font-weight: 700; }
.cmp-table a:hover { background: var(--dw-yellow); }
@media (max-width: 520px) { .cmp-bar { width: calc(100vw - 24px); bottom: 80px; justify-content: space-between; gap: 8px; padding: 9px 12px; } .cmp-bar-n { font-size: 13px; } .cmp-table th, .cmp-table td { min-width: 100px; font-size: 13px; } }

/* หน้าสินค้า: ป้าย "กำลังดู" + ส่วนซื้อคู่กัน */
.pd-viewing { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--safety-orange); background: var(--dw-yellow-pale); border: 1.5px solid var(--dw-yellow-deep); border-radius: 6px; padding: 6px 10px; align-self: flex-start; }
.pd-cross { margin-top: 48px; }
.pd-cross .me-section-h { margin-bottom: 20px; }

/* ขอใบเสนอราคา (modal) */
.quote-form { display: flex; flex-direction: column; gap: 12px; }
.quote-form .field { display: flex; flex-direction: column; gap: 5px; }
.quote-form .field label { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--fg-2); }
.quote-items { margin: 0; padding-left: 18px; font-family: var(--font-body); font-size: 14px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--border-3); border-radius: 6px; padding: 10px 10px 10px 26px; }

/* แต้มสะสมช่าง (Loyalty) */
.loyalty-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--ink); color: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 0 var(--dw-yellow); padding: 18px 22px; margin-bottom: 12px; }
.loyalty-tier { font-family: var(--font-display-th); font-style: italic; font-weight: 900; font-size: 22px; }
.loyalty-sub { font-family: var(--font-body); font-size: 13px; color: var(--concrete-300); margin-top: 2px; }
.loyalty-pts { text-align: right; display: flex; flex-direction: column; }
.loyalty-pts-n { font-family: var(--font-display-en); font-size: 38px; line-height: 1; color: var(--dw-yellow); }
.loyalty-pts-l { font-family: var(--font-body); font-size: 12px; color: var(--concrete-300); letter-spacing: .05em; }

/* =========================================================
   Product detail — modern upgrade (badges · quick grid · sticky bar)
   ========================================================= */
.pd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.pd-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body); font-weight: 800;
  font-size: 12.5px; padding: 5px 11px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; line-height: 1; }
.pd-badge.warranty { background: var(--dw-yellow); }
.pd-badge.genuine { background: #eaf7ef; }
.pd-badge.ready { background: #fff; color: var(--price-red); border-color: var(--price-red); }

.pd-quickgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.pd-qcell { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #fff;
  border: 2px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 0 var(--ink); }
.pd-qicon { font-size: 17px; line-height: 1; }
.pd-qk { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--concrete-500, #6b6b6b); text-transform: uppercase; letter-spacing: .03em; }
.pd-qv { font-family: var(--font-body); font-size: 14.5px; font-weight: 800; color: var(--ink); }
@media (min-width: 720px) { .pd-quickgrid { grid-template-columns: repeat(3, 1fr); } }

.pd-desc { line-height: 1.7; }
.pd-desc-h { font-weight: 800; margin: 14px 0 4px; }
.pd-desc-list { margin: 6px 0 12px; padding-left: 20px; }
.pd-desc-list li { margin: 4px 0; line-height: 1.6; }

/* Sticky bottom action bar — มือถือเท่านั้น */
.pd-stickybar { display: none; }
@media (max-width: 820px) {
  body[data-page="product"] { padding-bottom: 78px; }
  .pd-stickybar { display: flex; gap: 8px; align-items: stretch; position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 200; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper);
    border-top: 3px solid var(--ink); box-shadow: 0 -4px 14px rgba(0,0,0,.12); }
  .pd-stickybar button { font-family: var(--font-body); font-weight: 800; font-size: 14px; border: 3px solid var(--ink);
    border-radius: 12px; cursor: pointer; box-shadow: 3px 3px 0 0 var(--ink); padding: 10px 12px; }
  .pd-stickybar button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 0 var(--ink); }
  .pd-stickybar .sb-chat { display: flex; flex-direction: column; align-items: center; gap: 1px; background: #fff; padding: 6px 12px; }
  .pd-stickybar .sb-chat span { font-size: 10px; }
  .pd-stickybar .sb-cart { flex: 1; background: #14b8a6; color: #fff; }
  .pd-stickybar .sb-buy { flex: 1.3; background: var(--price-red); color: #fff; }
}

/* ---------- ACCOUNT (โปรไฟล์ลูกค้า — แก้เอง) ---------- */
.acct-page { max-width: 640px; }
.acct-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 0 var(--dw-yellow); padding: 20px 22px; margin-bottom: 18px; }
.acct-hero-ava { position: relative; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 30px; flex: 0 0 auto; cursor: pointer; overflow: visible; }
.acct-hero-ava [data-acct-ava-inner] { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.acct-hero-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-ava-cam { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; background: var(--dw-yellow); border: 2px solid var(--ink); border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.acct-hero-info { min-width: 0; }
.acct-hero-name { font-family: var(--font-display-th); font-weight: 800; font-size: 22px; line-height: 1.1; }
.acct-hero-code { font-family: var(--font-body); font-size: 13px; opacity: .92; margin-top: 2px; }
.acct-badge { display: inline-block; margin-top: 8px; font-family: var(--font-body); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #fff7da; color: #8a6d00; }
.acct-badge.ok { background: #def7e5; color: #157a3a; }
.acct-badge.pending { background: #fff7da; color: #8a6d00; }
.acct-badge.none { background: rgba(255,255,255,.2); color: #fff; }
.acct-card { background: #fff; border: 2px solid var(--concrete-200, #e5e5e5); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.acct-card-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-display-th); font-weight: 800; font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.acct-bar { width: 5px; height: 18px; background: #2563eb; border-radius: 3px; display: inline-block; }
.acct-card .field { margin-bottom: 12px; }
.acct-card .field:last-child { margin-bottom: 0; }
.acct-card label { display: block; font-family: var(--font-body); font-size: 12px; color: #777; margin-bottom: 4px; }
.acct-card input, .acct-card textarea { width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: 15px; padding: 11px 14px; border: 1.5px solid #d8d8d8; border-radius: 12px; background: #fafafa; }
.acct-card input:focus, .acct-card textarea:focus { outline: none; border-color: #2563eb; background: #fff; }
.acct-verify { background: #eff4ff; border-color: #cdddff; }
.acct-verify-row { display: flex; align-items: center; gap: 12px; }
.acct-verify-ic { width: 42px; height: 42px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.acct-verify-text { flex: 1; min-width: 0; }
.acct-verify-h { font-family: var(--font-body); font-weight: 800; font-size: 14px; color: #1d3c8a; }
.acct-verify-sub { font-family: var(--font-body); font-size: 12px; color: #5a6b8a; margin-top: 2px; }
.acct-verify-body { margin-top: 14px; }
.acct-upload { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; border: 2px dashed #9bb4e8; border-radius: 12px; background: #fff; color: #2563eb; font-family: var(--font-body); font-weight: 700; font-size: 13px; cursor: pointer; text-align: center; }
.acct-upload:hover { background: #f3f7ff; }
.acct-save-bar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--paper) 60%, transparent); }
.acct-save-btn { width: 100%; font-size: 16px; padding: 14px; }
.acct-msg { font-family: var(--font-body); font-size: 13px; text-align: center; margin-top: 8px; min-height: 18px; color: #777; }
.acct-msg.warn { color: #8a6d00; }
.acct-msg.err { color: var(--price-red); }
/* ยืนยันตัวตน (KYC) แสดงเสมอ — เป็นฟีเจอร์ของบัญชี ไม่ผูกกับบริการเช่า */
@media (max-width: 520px) { .acct-page .f2 { grid-template-columns: 1fr; } }

/* ---------- admin customers: code + verify chips ---------- */
.cus-code { font-family: var(--font-mono, monospace); font-size: 12px; background: #f0f0f0; padding: 2px 7px; border-radius: 6px; color: #333; }
.cus-vf { font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: none; cursor: pointer; }
button.cus-vf { background: #f0f0f0; }
.cus-vf.ok { background: #def7e5; color: #157a3a; }
.cus-vf.pending { background: #fff7da; color: #8a6d00; }
.cus-vf.none { background: #f0f0f0; color: #999; }
span.cus-vf.none { cursor: default; }

/* ---------- โหมดทดลอง: header storefront tint ---------- */
/* หัวเว็บ sticky ต้องเลื่อนลงมาอยู่ใต้แถบทดลอง (ความสูงจริงคำนวณด้วย JS) ไม่ให้ทับกัน */
body.testmode-on .me-header { border-bottom: 3px solid #f59e0b; top: var(--testbar-h, 34px); }
body.testmode-on .me-header-inner::before {
  content: "🧪 ทดลอง";
  font-family: var(--font-body); font-size: 11px; font-weight: 800;
  background: #fde68a; color: #92400e; padding: 1px 8px; border-radius: 4px; margin-right: 8px;
}
