/* Hom Fai - handwoven cotton shop (fictional brand). Palette named after natural dyes. */
:root {
  --kram: #1F2C4D;        /* indigo */
  --kram-2: #3D5687;
  --kram-deep: #172140;
  --khrang: #9B2C3C;      /* lac red */
  --khrang-d: #7E2131;
  --khamin: #D9A426;      /* turmeric */
  --fai: #F8F7F3;         /* bleached cotton */
  --tun: #E7E0D4;         /* natural brown cotton, light */
  --tun-2: #D9CFBF;
  --ink: #1A2236;
  --muted: #4F5568;
  --line: #D5CEC2;
  --field: #8C8577;
  --white: #FFFFFF;
  --serif: 'Trirong', 'Noto Serif Thai', Georgia, serif;
  --sans: 'Anuphan', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1200px;
  --gut: clamp(16px, 4vw, 40px);
  --bar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--fai);
  overflow-x: clip;
  padding-bottom: var(--bar-h);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--kram); }
a:hover { color: var(--khrang); }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--kram); outline-offset: 3px; }
.on-dark :focus-visible, .site-footer :focus-visible, .pvdev :focus-visible, .toast :focus-visible { outline-color: var(--khamin); }

.ph { display: inline-block; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--kram); color: #fff; padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* Selvedge: the coloured edge of a woven cloth, used as the site's border motif */
.selvedge {
  height: 8px;
  background: repeating-linear-gradient(90deg,
    var(--kram) 0 22px, var(--fai) 22px 24px,
    var(--khrang) 24px 30px, var(--fai) 30px 32px,
    var(--khamin) 32px 35px, var(--fai) 35px 37px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--fai);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  padding: 6px var(--gut);
  display: flex; align-items: center; gap: 6px;
  min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin-right: auto; text-decoration: none; color: var(--kram);
  min-height: 44px;
}
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; line-height: 1.35; }
.brand__sub { font-size: .8125rem; line-height: 1.5; color: var(--muted); }

.nav { display: none; }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem;
}
.nav a:hover { color: var(--khrang); }
.nav a[aria-current="page"] { color: var(--khrang); }

.nav.is-open {
  display: block;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--fai);
  border-bottom: 1px solid var(--line);
  padding: 8px var(--gut) 18px;
  box-shadow: 0 16px 24px -16px rgba(26, 34, 54, .35);
}
.nav.is-open a { border-bottom: 1px solid var(--line); }

.icon-btn, .cart-link {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  border: 0; background: none; border-radius: 6px;
  color: var(--kram); cursor: pointer; text-decoration: none;
}
.icon-btn svg, .cart-link svg { width: 26px; height: 26px; }
.cart-count {
  position: absolute; top: 2px; right: -2px;
  min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 11px; background: var(--khrang); color: #fff;
  font-size: .75rem; font-weight: 600; line-height: 21px; text-align: center;
  font-family: var(--sans);
}
.cart-count.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

@media (min-width: 960px) {
  .nav { display: flex; gap: 2px; margin-right: 8px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--khrang); }
  .nav-toggle { display: none; }
}

.concept { max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gut) 0; }
.concept span {
  display: inline-block;
  font-size: .8125rem; line-height: 1.6;
  padding: 2px 12px;
  border: 1px dashed var(--muted); border-radius: 999px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 10px 24px;
  border-radius: 6px; border: 2px solid transparent;
  font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; line-height: 1.4;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn--primary { background: var(--khrang); color: #fff; }
.btn--primary:hover { background: var(--khrang-d); color: #fff; }
.btn--ghost { border-color: var(--kram); color: var(--kram); background: transparent; }
.btn--ghost:hover { background: var(--kram); color: #fff; }
.btn--light { background: var(--fai); color: var(--kram); }
.btn--light:hover { background: #fff; color: var(--khrang); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-more {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; color: var(--khrang);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.link-more:hover { color: var(--kram); }

/* ---------- Sections ---------- */
.section { padding: clamp(52px, 8vw, 104px) 0; }
.section--tun { background: var(--tun); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px 32px; margin-bottom: clamp(24px, 4vw, 40px);
}
.section-head h2, .h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.7rem, 1.25rem + 2vw, 2.6rem); line-height: 1.38;
  color: var(--kram); margin: 0;
}
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 34em; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: 20px var(--gut) clamp(48px, 7vw, 88px);
  display: grid; gap: 32px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 1.35rem + 3.4vw, 3.9rem);
  line-height: 1.3; color: var(--kram);
  margin: 0 0 18px;
}
.hero h1 span { display: inline-block; }
.hero__lead { font-size: 1.125rem; max-width: 32em; color: var(--ink); margin-bottom: 26px; }
.perks {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; gap: 8px; font-size: 1rem; color: var(--muted);
}
.perks li { display: flex; align-items: center; gap: 12px; }
.perks li::before {
  content: ""; flex: none; width: 18px; height: 12px;
  background: repeating-linear-gradient(90deg, var(--kram) 0 3px, var(--fai) 3px 4px, var(--khrang) 4px 6px, var(--fai) 6px 7px);
}
.hero__media { position: relative; margin: 0; padding: 0 0 0 0; }
.hero__media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px;
  background: var(--tun);
}

/* The hang tag: every cloth ships with a hand-written tag naming its weaver */
.hangtag {
  position: absolute; left: 14px; bottom: 22px;
  width: min(230px, 64%);
  display: block; color: var(--ink); text-decoration: none;
  transform: rotate(-4deg); transform-origin: 50% 0;
  filter: drop-shadow(0 10px 16px rgba(26, 34, 54, .32));
  animation: swing 1.6s cubic-bezier(.3, 1.4, .5, 1) .3s both;
}
.hangtag::before {
  content: ""; position: absolute; left: 50%; top: -46px;
  width: 2px; height: 58px; background: var(--khamin);
  transform: rotate(24deg); transform-origin: 50% 100%;
}
.hangtag__card {
  position: relative; display: block;
  background: var(--fai);
  padding: 34px 18px 16px;
  clip-path: polygon(16% 0, 84% 0, 100% 13%, 100% 100%, 0 100%, 0 13%);
}
.hangtag__card::before {
  content: ""; position: absolute; left: 50%; top: 12px;
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--kram-deep); box-shadow: inset 0 0 0 2px var(--tun-2);
}
.hangtag__by { display: block; font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.hangtag__name { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.4; color: var(--kram); }
.hangtag__meta {
  display: block; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--field);
  font-size: .875rem; line-height: 1.55;
}
a.hangtag:hover .hangtag__meta { color: var(--khrang); }
@keyframes swing {
  0% { transform: rotate(-14deg); }
  100% { transform: rotate(-4deg); }
}

@media (min-width: 600px) and (max-width: 899px) {
  .hero__media img { aspect-ratio: 4 / 3; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 5fr 6fr; align-items: center; gap: 64px; padding-top: 32px; padding-bottom: 32px; }
  .hero__media img { aspect-ratio: 6 / 7; }
  .hangtag { left: -40px; bottom: 48px; }
}

/* ---------- Product cards ---------- */
.pgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 14px;
}
@media (min-width: 768px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 24px; } }
@media (min-width: 1100px) { .pgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pcard__link { display: block; text-decoration: none; color: inherit; }
.pcard__media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 4px; background: var(--tun);
}
.pcard__media img { width: 100%; height: 100%; object-fit: cover; }
.pcard__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--khrang); color: #fff;
  font-size: .8125rem; font-weight: 600; line-height: 1.6;
  padding: 2px 10px; border-radius: 2px;
}
.pcard__name {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem); line-height: 1.55;
  margin: 14px 0 2px; color: var(--ink);
}
.pcard__link:hover .pcard__name { color: var(--khrang); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.pcard__by { font-size: .875rem; color: var(--muted); margin: 0; }
.pcard__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 8px; }
.pcard__price { font-weight: 600; color: var(--kram); margin: 0; }
.dots { display: flex; gap: 5px; }
.dots i {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(26, 34, 54, .2);
}

/* ---------- CSS-woven product illustrations ---------- */
.vis {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 90% at 28% 18%, #F2EEE6 0%, var(--tun) 58%, #D6CCBC 100%);
}
.weave {
  --tex:
    repeating-linear-gradient(90deg, rgba(255,255,255,.09) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px);
  background-color: var(--c1);
}
.weave--stripe {
  background-image: var(--tex),
    repeating-linear-gradient(90deg,
      var(--c1) 0 22px, var(--c2) 22px 26px, var(--c1) 26px 34px,
      var(--c3) 34px 37px, var(--c1) 37px 44px, var(--c2) 44px 46px);
}
.weave--check {
  background-color: var(--c2);
  background-image: var(--tex),
    repeating-linear-gradient(90deg, transparent 0 17px, color-mix(in srgb, var(--c3) 85%, transparent) 17px 19px, transparent 19px 38px),
    repeating-linear-gradient(0deg, transparent 0 17px, color-mix(in srgb, var(--c3) 85%, transparent) 17px 19px, transparent 19px 38px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--c1) 58%, transparent) 0 19px, transparent 19px 38px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--c1) 58%, transparent) 0 19px, transparent 19px 38px);
}
.weave--twill {
  background-image: var(--tex),
    repeating-linear-gradient(0deg, transparent 0 calc(100% - 14px), var(--c3) calc(100% - 14px) calc(100% - 10px), transparent calc(100% - 10px)),
    repeating-linear-gradient(45deg, var(--c1) 0 4px, color-mix(in srgb, var(--c1) 72%, var(--c2)) 4px 6px);
}
.weave--khit {
  background-image: var(--tex),
    repeating-linear-gradient(45deg, transparent 0 13px, var(--c2) 13px 16px, transparent 16px 26px),
    repeating-linear-gradient(-45deg, transparent 0 13px, var(--c2) 13px 16px, transparent 16px 26px),
    repeating-linear-gradient(0deg, transparent 0 44px, var(--c3) 44px 48px, transparent 48px 56px);
}
.weave--slub {
  background-image: var(--tex),
    repeating-linear-gradient(0deg, transparent 0 5px, color-mix(in srgb, var(--c3) 38%, transparent) 5px 6px,
      transparent 6px 13px, color-mix(in srgb, var(--c2) 70%, transparent) 13px 15px, transparent 15px 23px),
    repeating-linear-gradient(90deg, transparent 0 9px, color-mix(in srgb, var(--c3) 22%, transparent) 9px 10px, transparent 10px 17px);
}

.cloth {
  position: relative; display: block;
  box-shadow: 0 18px 26px -16px rgba(26, 34, 54, .55), 0 2px 4px rgba(26, 34, 54, .12);
}
/* fringe on scarves, pha khao ma and runners */
.vis--scarf .cloth::before, .vis--scarf .cloth::after,
.vis--khaoma .cloth::before, .vis--khaoma .cloth::after,
.vis--runner .cloth::before, .vis--runner .cloth::after {
  content: ""; position: absolute; left: 5%; right: 5%; height: 7%;
  background: repeating-linear-gradient(90deg, var(--c1) 0 2px, transparent 2px 5px);
}
.vis .cloth::before { bottom: 100%; }
.vis .cloth::after { top: 100%; }
.vis--scarf .cloth { width: 40%; height: 74%; transform: rotate(-5deg); }
.vis--khaoma .cloth { width: 58%; height: 68%; transform: rotate(4deg); }
.vis--runner .cloth { width: 32%; height: 82%; transform: rotate(9deg); }
.vis--cushion .cloth {
  width: 66%; aspect-ratio: 1; border-radius: 17%;
  box-shadow:
    inset 0 -24px 40px rgba(0, 0, 0, .24),
    inset 0 18px 30px rgba(255, 255, 255, .16),
    0 22px 28px -14px rgba(26, 34, 54, .6);
}
.vis--mats .cloth { position: absolute; width: 60%; height: 42%; }
.vis--mats .cloth:first-child { top: 14%; left: 10%; transform: rotate(-6deg); }
.vis--mats .cloth--b { bottom: 14%; right: 8%; transform: rotate(5deg); }
.vis--tote .cloth {
  position: absolute; left: 20%; top: 38%; width: 60%; height: 48%;
  border-radius: 2px 2px 6px 6px; z-index: 1;
}
.tote-handle {
  position: absolute; left: 33%; top: 19%; width: 34%; height: 22%;
  border: 7px solid #C4AD8A; border-bottom: 0;
  border-radius: 999px 999px 0 0;
}
.vis--throw .cloth {
  width: 74%; height: 50%;
  box-shadow:
    0 7px 0 -1px color-mix(in srgb, var(--c1) 82%, #000),
    0 14px 0 -2px color-mix(in srgb, var(--c1) 70%, #000),
    0 30px 30px -18px rgba(26, 34, 54, .6);
}
.vis--throw .cloth::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    transparent 31%, rgba(0,0,0,.16) 32%, rgba(255,255,255,.1) 34%, transparent 40%,
    transparent 64%, rgba(0,0,0,.16) 65%, rgba(255,255,255,.1) 67%, transparent 73%);
}
.vis--close .cloth { position: absolute; inset: -40%; transform: scale(1.8) rotate(-3deg); box-shadow: none; }

/* ---------- Categories (cut like swatches in a sample book) ---------- */
.cats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px;
}
@media (min-width: 768px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; } }
@media (min-width: 1100px) { .cats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 20px; } }
.cat { display: block; text-decoration: none; color: var(--ink); }
.cat__media {
  aspect-ratio: 1; overflow: hidden; background: var(--tun);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.cat__media img { width: 100%; height: 100%; object-fit: cover; }
.cat__name {
  display: block; font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); line-height: 1.45; margin-top: 12px;
}
.cat:hover .cat__name { color: var(--khrang); }
.cat__meta { display: block; font-size: .9375rem; color: var(--muted); line-height: 1.6; }

/* ---------- Story ---------- */
.story { background: var(--kram); color: #E9ECF3; }
.story .h2, .story h3 { color: #fff; }
.story a { color: #fff; }
.story__grid { display: grid; gap: 36px; }
.story__photo { margin: 0; }
.story__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 40% 50%; border-radius: 4px; }
.story .h2 { margin-bottom: 16px; }
#contact .h2 { margin-bottom: 12px; }
.story__photo figcaption { font-size: .9375rem; color: #C3CADB; margin-top: 10px; }
.story__text p { max-width: 36em; }
.story__quote {
  margin: 28px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--khamin);
  font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.6; color: #fff;
}
.story__quote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .9375rem; color: #C3CADB; margin-top: 6px; }
.dyes-title { font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; line-height: 1.6; color: #fff; margin: 32px 0 0; }
.photo-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 32px; }
.photo-pair figure { margin: 0; }
.photo-pair img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
.photo-pair figcaption { font-size: .875rem; line-height: 1.6; color: #C3CADB; margin-top: 8px; }
.dyes {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; gap: 18px 24px;
}
@media (min-width: 600px) { .dyes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dyes li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; }
.skein {
  width: 48px; height: 48px; border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, var(--d) 0 2px, color-mix(in srgb, var(--d) 72%, #000) 2px 3px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}
.dyes strong { display: block; color: #fff; font-size: 1.0625rem; }
.dyes span { display: block; font-size: .9375rem; line-height: 1.6; color: #C9D0DF; }

.steps-title { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; line-height: 1.45; margin: clamp(48px, 7vw, 80px) 0 20px; }
.process {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; gap: 24px;
}
.process li { counter-increment: step; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 16px; }
.process li::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--khamin); color: var(--kram); font-weight: 600; margin-bottom: 10px;
}
.process h4 { margin: 0 0 4px; font-size: 1.0625rem; color: #fff; }
.process p { margin: 0; font-size: .9375rem; color: #C9D0DF; line-height: 1.65; }
.process__img { margin: 0 0 14px; }
.process__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }

@media (min-width: 900px) {
  .story__grid { grid-template-columns: 5fr 6fr; gap: 72px; align-items: start; }
  .story__photo { position: sticky; top: 100px; }
  .story__photo img { aspect-ratio: 4 / 5; }
  .process { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
  .photo-pair img { aspect-ratio: 2 / 1; }
}

/* ---------- Reviews ---------- */
.rating-sum { display: flex; align-items: baseline; gap: 10px; color: var(--muted); margin: 8px 0 0; }
.rating-sum strong { font-family: var(--serif); font-size: 2rem; color: var(--kram); line-height: 1.3; }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.review { padding-left: 20px; border-left: 4px solid var(--kram); }
.review:nth-child(2) { border-left-color: var(--khrang); }
.review:nth-child(3) { border-left-color: var(--khamin); }
.review blockquote { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.125rem; line-height: 1.75; }
.stars { color: #9A6B00; letter-spacing: 2px; font-size: 1rem; margin: 0 0 8px; }
.review__who { margin: 14px 0 0; font-size: .9375rem; color: var(--muted); line-height: 1.9; }
.review__who b { color: var(--ink); font-weight: 600; }
@media (min-width: 900px) { .reviews { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }

/* ---------- Shipping info ---------- */
.ship-grid { display: grid; gap: 28px; }
.ship-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.ship-item svg { width: 40px; height: 40px; color: var(--khrang); }
.ship-item h3 { margin: 0 0 4px; font-size: 1.125rem; color: var(--kram); line-height: 1.5; }
.ship-item p { margin: 0; color: var(--muted); }
@media (min-width: 768px) { .ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; } }
@media (min-width: 1100px) { .ship-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.0625rem; color: var(--kram);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { margin: 0 0 18px; color: var(--ink); max-width: 40em; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 36px; }
.contact-grid h3 { font-size: 1.125rem; color: var(--kram); margin: 0 0 8px; }
.hours { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; }
.hours dt { color: var(--muted); }
.hours dd { margin: 0; font-weight: 600; }
@media (max-width: 599px) {
  .hours { grid-template-columns: 1fr; gap: 0; }
  .hours dd { margin-bottom: 10px; }
}
.addr { font-style: normal; margin-bottom: 20px; }
.contact-sub { margin-top: 28px !important; }
.tel-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: 1.35rem; font-weight: 600; text-decoration: none;
}
.tel-link svg { width: 24px; height: 24px; }

/* ---------- Custom-weaving banner (catalogue) ---------- */
.banner {
  margin: 64px 0 72px; padding: clamp(24px, 4vw, 40px);
  background: var(--kram); color: #E3E7F0; border-radius: 6px;
  display: grid; gap: 18px; align-items: center;
  position: relative; overflow: hidden;
}
.banner::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--khamin) 0 14px, var(--khrang) 14px 20px, var(--fai) 20px 22px);
}
.banner h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); line-height: 1.45; color: #fff; margin: 0 0 6px; }
.banner p { margin: 0; max-width: 40em; }
@media (min-width: 900px) { .banner { grid-template-columns: 1fr auto; gap: 40px; } }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 64px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--kram-deep); color: #C9D0DF; }
.site-footer__grid { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.site-footer h2 { font-size: 1rem; color: #fff; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; color: #E3E7F0; text-decoration: none; }
.site-footer li a:hover { color: var(--khamin); text-decoration: underline; }
.site-footer p { font-size: .9375rem; }
.site-footer__brand { font-family: var(--serif); font-weight: 700; font-size: 1.6rem !important; color: #fff; margin-bottom: 6px; line-height: 1.4; }
.site-footer__legal { font-size: .875rem; color: #A9B2C6; padding-bottom: 28px; margin: 0 auto; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; } }

/* ---------- PV Dev strip (studio band, not part of the shop design) ---------- */
.pvdev { background: #242424; text-align: center; padding: 6px 16px; }
.pvdev a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  color: #EDEDED; font: 400 15px/1.6 system-ui, -apple-system, 'Segoe UI', 'Noto Sans Thai', sans-serif;
  text-decoration: none;
}
.pvdev a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Mobile bottom bar ---------- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--fai); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 18px rgba(26, 34, 54, .1);
}
.mbar__btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 8px; border-radius: 6px;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer;
}
.mbar__btn svg { width: 22px; height: 22px; flex: none; }
.mbar__btn--main { background: var(--khrang); border-color: var(--khrang); color: #fff; }
.mbar__btn--main:hover { color: #fff; background: var(--khrang-d); }
.mbar__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #fff; color: var(--khrang); font-size: .8125rem; line-height: 22px; text-align: center;
}
body { --bar-h: 72px; }
@media (min-width: 960px) {
  .mbar { display: none; }
  body { --bar-h: 0px; }
}

/* ---------- Page heads ---------- */
.page-head { padding: 24px 0 4px; }
.page-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.9rem, 1.35rem + 2.4vw, 3rem); line-height: 1.35;
  color: var(--kram); margin: 0 0 6px;
}
.page-head p { color: var(--muted); max-width: 36em; }

/* ---------- Catalogue toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 24px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut) 6px;
  max-width: calc(100% + 2 * var(--gut));
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 8px 18px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; font-size: .9375rem; cursor: pointer; color: var(--ink);
}
.chip:hover { border-color: var(--kram); }
.chip[aria-pressed="true"] { background: var(--kram); border-color: var(--kram); color: #fff; }
.sort { display: flex; align-items: center; gap: 10px; }
.sort label { font-size: .9375rem; color: var(--muted); }
select, .field input, .field textarea {
  min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--field); border-radius: 6px; background: #fff;
  font-size: 1rem; line-height: 1.5;
}
.result-count { color: var(--muted); font-size: .9375rem; margin: 0 0 22px; }
@media (min-width: 960px) {
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; max-width: none; }
}

/* ---------- Product detail ---------- */
.crumbs ol { list-style: none; margin: 0; padding: 16px 0 8px; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .9375rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--line); }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.crumbs li { display: flex; align-items: center; }
.pdp { display: grid; gap: 28px; padding-bottom: 24px; }
.gallery__main {
  aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--tun);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb {
  width: 68px; aspect-ratio: 4 / 5; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 4px; background: var(--tun); cursor: pointer;
  outline-offset: 2px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--kram); box-shadow: 0 0 0 2px var(--fai) inset; }
.gallery__note { font-size: .875rem; color: var(--muted); margin-top: 12px; max-width: 38em; }

.pdp__cat { margin: 0 0 4px; }
.pdp__cat a { color: var(--muted); font-size: .9375rem; display: inline-flex; align-items: center; min-height: 44px; }
.pdp__name {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.65rem, 1.3rem + 1.6vw, 2.4rem); line-height: 1.38; color: var(--kram);
  margin: 0 0 8px;
}
.pdp__price { font-size: 1.6rem; font-weight: 600; color: var(--kram); margin: 0 0 20px; }
.opt-group { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.opt-group legend { font-weight: 600; padding: 0; margin-bottom: 10px; }
.opt-group legend span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch, .size { position: relative; cursor: pointer; }
.swatch input, .size input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span {
  display: block; width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(var(--c1) 0 50%, var(--c2) 0 75%, var(--c3) 0);
  box-shadow: 0 0 0 1px var(--line);
}
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--fai), 0 0 0 5px var(--kram); }
.swatch input:focus-visible + span { outline: 3px solid var(--kram); outline-offset: 6px; }
.size span {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 48px; padding: 6px 16px; line-height: 1.45;
  border: 1px solid var(--field); border-radius: 6px; background: #fff;
}
.size small { color: var(--muted); font-size: .875rem; }
.size input:checked + span { border-color: var(--kram); box-shadow: inset 0 0 0 2px var(--kram); font-weight: 600; }
.size input:focus-visible + span { outline: 3px solid var(--kram); outline-offset: 3px; }

.buy__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--field); border-radius: 6px; background: #fff;
}
.qty button {
  width: 46px; min-height: 48px; border: 0; background: none; cursor: pointer;
  font-size: 1.35rem; line-height: 1; color: var(--kram); border-radius: 6px;
}
.qty input {
  width: 48px; min-height: 44px; border: 0; text-align: center; background: transparent;
  font-weight: 600; font-size: 1rem; -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn--buy { flex: 1 1 160px; padding-left: 16px; padding-right: 16px; }
.buy__note { margin: 14px 0 0; padding: 10px 14px; background: #FBF1D9; border-radius: 4px; font-size: .9375rem; }
.buy__ship { margin: 12px 0 0; font-size: .9375rem; color: var(--muted); }

.maker {
  position: relative; margin: 32px 0 8px; max-width: 320px;
  filter: drop-shadow(0 8px 14px rgba(26, 34, 54, .18));
  transform: rotate(-2deg);
}
.maker .hangtag__card { background: #fff; }
.pdp__h2 { font-size: 1.15rem; color: var(--kram); margin: 32px 0 8px; }
.facts { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px 16px; margin: 18px 0 0; font-size: 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

@media (min-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
  .gallery__main { aspect-ratio: 1; }
  .gallery { position: sticky; top: 96px; }
  .thumb { width: 80px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px); z-index: 60;
  width: min(420px, calc(100% - 32px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--kram); color: #fff; border-radius: 6px;
  padding: 14px 18px; box-shadow: 0 16px 32px -12px rgba(26, 34, 54, .6);
  transition: transform .25s ease, opacity .25s ease;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast a { color: #fff; font-weight: 600; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Cart ---------- */
.cart-grid { display: grid; gap: 32px; padding-bottom: 56px; }
.cart-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.citem { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.citem__media { display: block; width: 92px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--tun); }
.citem__media img { width: 100%; height: 100%; object-fit: cover; }
.citem__name { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.5; margin: 0 0 2px; }
.citem__name a { color: var(--ink); text-decoration: none; display: inline-block; padding: 6px 0; }
.citem__name a:hover { color: var(--khrang); text-decoration: underline; }
.citem__opts { font-size: .9375rem; color: var(--muted); margin: 0; line-height: 1.6; }
.citem__unit { font-size: .9375rem; margin: 4px 0 0; }
.citem__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.citem__total { font-weight: 600; color: var(--kram); font-size: 1.0625rem; }
.link-btn {
  background: none; border: 0; padding: 0 2px; min-height: 44px; cursor: pointer;
  color: var(--khrang); text-decoration: underline; text-underline-offset: 4px; font-size: .9375rem;
}
.link-btn:hover { color: var(--khrang-d); }

.summary {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 22px 20px; align-self: start;
}
.summary__title { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--kram); margin: 0 0 14px; line-height: 1.45; }
.sumlist { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0; }
.sumlist dt { color: var(--muted); }
.sumlist dd { margin: 0; padding-left: 16px; text-align: right; font-weight: 600; }
.sumlist .total { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; color: var(--ink); font-size: 1.2rem; }
.freeship { margin: 18px 0; font-size: .9375rem; }
.freeship p { margin: 0 0 8px; }
.meter { height: 10px; border-radius: 5px; background: var(--tun); overflow: hidden; }
.meter span {
  display: block; height: 100%; border-radius: 5px;
  background: repeating-linear-gradient(90deg, var(--kram) 0 10px, var(--khamin) 10px 13px, var(--khrang) 13px 17px, var(--khamin) 17px 20px);
  transition: width .3s ease;
}
.summary .link-more { margin-top: 6px; }
.summary__pay { font-size: .875rem; color: var(--muted); margin: 14px 0 0; }
.empty { text-align: left; padding: 24px 0 72px; max-width: 34em; }
.empty .vis { width: 160px; height: 200px; border-radius: 4px; margin-bottom: 20px; }

@media (min-width: 900px) {
  .cart-grid { grid-template-columns: 1fr 380px; gap: 56px; }
  .summary { position: sticky; top: 96px; }
}

/* ---------- Checkout ---------- */
.steps {
  list-style: none; counter-reset: s; display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin: 0 0 24px; padding: 0; font-size: .9375rem; color: var(--muted);
}
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; }
.steps li::before {
  content: counter(s); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--field); font-size: .8125rem; font-weight: 600;
}
.steps li[aria-current="step"] { color: var(--kram); font-weight: 600; }
.steps li[aria-current="step"]::before { background: var(--kram); border-color: var(--kram); color: #fff; }
.co-grid { display: grid; gap: 28px; padding-bottom: 56px; }
.co-block { border: 0; margin: 0 0 32px; padding: 0; }
.co-block h2 { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--kram); margin: 0 0 16px; line-height: 1.45; }
.form-grid { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; color: var(--ink); }
.field textarea { min-height: 96px; resize: vertical; }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--khrang); box-shadow: inset 0 0 0 1px var(--khrang); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-height: 44px; padding-top: 8px; }
.check input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--kram); flex: none; }
@media (min-width: 600px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}
.payopts { display: grid; gap: 10px; }
.payopt {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--field); border-radius: 6px; background: #fff; cursor: pointer;
}
.payopt input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--kram); flex: none; }
.payopt b { display: block; }
.payopt small { display: block; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.payopt:has(input:checked) { border-color: var(--kram); box-shadow: inset 0 0 0 1px var(--kram); }
.paypanel { margin-top: 14px; padding: 18px; background: var(--tun); border-radius: 6px; }
.paypanel p { margin: 0 0 8px; font-size: .9375rem; }
.paypanel p:last-child { margin-bottom: 0; }
.qr { margin: 0 0 14px; display: grid; justify-items: center; text-align: center; }
.qr__card {
  position: relative; width: min(260px, 100%);
  background: #fff; border-radius: 6px; padding: 30px 16px 16px;
  border-top: 8px solid var(--kram);
}
.qr__card svg { width: 100%; height: auto; display: block; }
.qr__brand { font-weight: 600; color: var(--kram); margin: 0 0 8px !important; font-size: 1rem !important; }
.qr__flag {
  position: absolute; top: -4px; right: 10px;
  background: var(--khrang); color: #fff; font-weight: 600; font-size: .875rem; line-height: 1.6;
  padding: 2px 10px; border-radius: 0 0 4px 4px;
}
.qr__label { font-family: var(--sans); font-weight: 600; }
.qr__amt { margin: 10px 0 0 !important; font-size: 1rem !important; }
.qr__amt strong { font-size: 1.25rem; color: var(--kram); }
.qr figcaption { font-size: .875rem; color: var(--muted); margin-top: 10px; max-width: 30em; }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.bank dt { color: var(--muted); }
.bank dd { margin: 0; font-weight: 600; }
.fine { font-size: .875rem; color: var(--muted); margin-top: 12px; }
.co-items { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.co-items li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; font-size: .9375rem; line-height: 1.5; }
.co-items .mini { width: 52px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: var(--tun); }
.co-items .mini img { width: 100%; height: 100%; object-fit: cover; }
.co-items small { display: block; color: var(--muted); }
@media (min-width: 900px) {
  .co-grid { grid-template-columns: 1fr 380px; gap: 56px; }
  .co-grid .summary { grid-column: 2; grid-row: 1; position: sticky; top: 96px; }
  .co-grid .co-form { grid-column: 1; grid-row: 1; }
}

.confirm { max-width: 760px; padding: 8px 0 72px; }
.confirm__mark {
  width: 64px; height: 64px; border-radius: 50%; margin-bottom: 18px;
  background: var(--kram); color: var(--khamin);
  display: grid; place-items: center;
}
.confirm__mark svg { width: 34px; height: 34px; }
.confirm h1:focus { outline: none; }
.confirm__no { font-size: 1.125rem; }
.confirm__no strong { color: var(--khrang); letter-spacing: .5px; }
.confirm__box { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin: 24px 0; }
.confirm__box h2 { font-size: 1.125rem; color: var(--kram); margin: 0 0 10px; }
.confirm__pay { display: grid; gap: 20px; }
@media (min-width: 700px) { .confirm__pay { grid-template-columns: 240px 1fr; align-items: start; } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
