/* ── สไตล์เฉพาะหน้า ─────────────────────────────────────────────── */

/* ── หน้าแรก: แบนเนอร์หลักแบบสไลด์ ─────────────────────────────
   แบนเนอร์กินเต็มความกว้างจอ จึงวางไว้นอก .container ใน index.html
   ความสูงประกาศไว้ที่ตัว mount เพื่อจองที่ไว้ก่อน JS วาดเสร็จ — กันหน้ากระตุก */
.hero-mount {
  --hero-h: clamp(360px, 44vw, 640px);
  min-height: var(--hero-h);
  background: var(--bg-sunken);
}

.hero-slider {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg-sunken);
  border-block-end: 1px solid
    color-mix(in srgb, var(--hero-accent, var(--accent)) 26%, var(--border));
}

.hero-slider__viewport {
  overflow: hidden;
  cursor: grab;
  /* ปัดแนวนอน = เปลี่ยนสไลด์ แต่ต้องยังเลื่อนหน้าขึ้นลงได้ตามปกติ */
  touch-action: pan-y;
}

.hero-slider.is-dragging .hero-slider__viewport {
  cursor: grabbing;
}

.hero-slider__track {
  display: flex;
  will-change: transform;
  transition: transform var(--t-slow);
}

/* ตอนลากนิ้วและตอนตั้งค่าสไลด์แรก ต้องขยับทันทีโดยไม่มีแอนิเมชัน */
.hero-slider.is-dragging .hero-slider__track,
.hero-slider__track.is-instant {
  transition: none;
}

.hero-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  /* min-width: auto ของ flex item ยอมให้สไลด์กว้างตามข้อความ — หัวเรื่องยาว ๆ
     จะดันจนล้นจอ จึงต้องปิดไว้ และให้ความสูงยืดตามสไลด์ที่เนื้อหามากที่สุด */
  min-width: 0;
  min-height: var(--hero-h, 520px);
  display: grid;
  place-items: center;
  user-select: none;
}

.hero-slide__art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide__art > svg,
.hero-slide__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── เนื้อหาบนสไลด์ ────────────────────────────────────────────── */
.hero-slide__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  max-width: 860px;
  padding: var(--sp-7) var(--sp-6);
  text-align: center;
}

/* align-items: center ทำให้ลูกกว้างเท่าเนื้อหา — ต้องคุมไว้ ไม่งั้นบรรทัดยาวจะไม่ยอมตัดคำ */
.hero-slide__content > * {
  max-width: 100%;
}

/* เนื้อหาไล่กันขึ้นมาเฉพาะสไลด์ที่แสดงอยู่ — ใช้ fill mode both
   เพื่อให้จบที่สถานะมองเห็น แม้เบราว์เซอร์จะปิดแอนิเมชันไว้ */
.hero-slide.is-active .hero-slide__content > * {
  animation: hero-rise var(--t-slow) both;
}

.hero-slide.is-active .hero-slide__content > :nth-child(2) {
  animation-delay: 70ms;
}
.hero-slide.is-active .hero-slide__content > :nth-child(3) {
  animation-delay: 140ms;
}
.hero-slide.is-active .hero-slide__content > :nth-child(4) {
  animation-delay: 210ms;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* แบนเนอร์เป็นภาพพื้นมืดเสมอ (ทั้งธีมมืดและสว่าง) สีตัวอักษรในนี้จึงตั้งตายตัว ไม่อิงธีม */
.hero-slide__kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #ebca6b;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

html[lang='th'] .hero-slide__kicker {
  letter-spacing: 0.06em;
  text-transform: none;
}

.hero-slide__title {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-slide__title-main {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 700;
  /* ตัวอักษรไล่สีทองแบบทองคำเปลว — ตัดพื้นหลังด้วย background-clip */
  background-image: linear-gradient(
    180deg,
    #fff6dc 6%,
    #f1d88c 34%,
    var(--hero-accent) 58%,
    #9a7419 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.6));
}

.hero-slide__title-sub {
  font-size: clamp(1.05rem, 2.3vw, 1.85rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #f6f3ec;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

html[lang='th'] .hero-slide__title {
  text-transform: none;
  line-height: 1.3;
  letter-spacing: 0;
}

html[lang='th'] .hero-slide__title-sub {
  letter-spacing: 0.02em;
}

.hero-slide__subtitle {
  max-width: 60ch;
  color: rgba(246, 243, 236, 0.84);
  font-size: var(--fs-md);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.hero-slide__cta {
  margin-top: var(--sp-2);
  padding-inline: var(--sp-7);
  letter-spacing: 0.06em;
}

/* ── ปุ่มลูกศรซ้าย-ขวา ─────────────────────────────────────────── */
.hero-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: rgba(0, 0, 0, 0.42);
  color: #ebca6b;
  opacity: 0.7;
  backdrop-filter: blur(8px);
  transition: opacity var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.hero-slider__arrow:hover,
.hero-slider__arrow:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.72);
  border-color: var(--hero-accent, #d4af37);
}

.hero-slider__arrow svg {
  width: 22px;
  height: 22px;
}

.hero-slider__arrow--prev {
  inset-inline-start: clamp(6px, 1.6vw, 26px);
}

.hero-slider__arrow--next {
  inset-inline-end: clamp(6px, 1.6vw, 26px);
}

/* ── จุดบอกตำแหน่ง ─────────────────────────────────────────────── */
.hero-slider__dots {
  position: absolute;
  inset-inline: 0;
  bottom: clamp(10px, 2.2vw, 24px);
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
}

.hero-slider__dot {
  position: relative;
  width: 12px;
  height: 30px; /* พื้นที่กดสูงพอสำหรับนิ้ว แม้รางจะบาง */
  padding: 0;
  border: 0;
  background: none;
  transition: width var(--t-base);
}

.hero-slider__dot::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 50%;
  margin-top: -5px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.28);
  transition: background var(--t-base);
}

.hero-slider__dot:hover::before {
  background: rgba(255, 255, 255, 0.5);
}

.hero-slider__dot.is-active {
  width: 44px;
}

.hero-slider__dot.is-active::before {
  background: rgba(255, 255, 255, 0.2);
}

/* แถบในจุดที่ทำงานอยู่ไหลไปพร้อมกับตัวจับเวลา จึงบอกได้ว่าอีกนานไหมจะเปลี่ยน */
.hero-slider__dot-fill {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  margin-top: -5px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #f1d88c, var(--hero-accent, #d4af37));
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-slider__dot.is-active .hero-slider__dot-fill {
  transform: scaleX(1);
  animation: hero-dot-fill var(--hero-interval, 7000ms) linear both;
}

.hero-slider.is-paused .hero-slider__dot.is-active .hero-slider__dot-fill {
  animation-play-state: paused;
}

@keyframes hero-dot-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ── ปุ่มหยุด/เล่นสไลด์อัตโนมัติ ───────────────────────────────── */
.hero-slider__play {
  position: absolute;
  z-index: 3;
  inset-inline-end: clamp(12px, 2.4vw, 30px);
  bottom: clamp(12px, 2.2vw, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.85);
  opacity: 0.6;
  transition: opacity var(--t-fast), color var(--t-fast);
}

.hero-slider__play:hover,
.hero-slider__play:focus-visible {
  opacity: 1;
  color: #fff;
}

/* เครื่องหมายวาดด้วย CSS เพราะชุดไอคอนยังไม่มี pause/play */
.hero-slider__play::before,
.hero-slider__play::after {
  content: '';
  width: 3px;
  height: 11px;
  border-radius: 1px;
  background: currentColor;
}

.hero-slider__play.is-paused::before {
  width: 0;
  height: 0;
  margin-inline-start: 3px;
  background: none;
  border-inline-start: 9px solid currentColor;
  border-block: 6px solid transparent;
}

.hero-slider__play.is-paused::after {
  display: none;
}

/* ── ชิปแบรนด์มุมล่างซ้าย ──────────────────────────────────────── */
/* คนที่ตั้งค่าลดการเคลื่อนไหวไว้จะไม่เห็นสไลด์เลื่อนเอง
   แถบในจุดจึงต้องเต็มค้างไว้ ไม่ใช่ว่างเปล่า */
@media (prefers-reduced-motion: reduce) {
  .hero-slider__dot.is-active .hero-slider__dot-fill {
    animation: none;
    transform: scaleX(1);
  }
}

/* ── หน้าข่าว ──────────────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}

.news-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color var(--t-base), transform var(--t-base);
}

.news-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

/* แถบหัวการ์ดข่าว: ดำไล่ทอง พร้อมลายเส้นทแยงบาง ๆ แบบกระดาษพิมพ์ลาย */
.news-card__banner {
  height: 96px;
  background:
    repeating-linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0 1px, transparent 1px 12px),
    linear-gradient(120deg, rgba(212, 175, 55, 0.55), #0a0a0a 70%);
  border-bottom: 1px solid var(--gold-line);
}

:root[data-theme='light'] .news-card__banner {
  background:
    repeating-linear-gradient(135deg, rgba(143, 109, 20, 0.08) 0 1px, transparent 1px 12px),
    linear-gradient(120deg, rgba(184, 145, 42, 0.5), var(--bg-sunken) 70%);
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  flex: 1;
}

/* ป้ายหมวดข่าวกว้างเท่าข้อความ — ไม่ยืดเต็มการ์ดตาม flex แนวตั้ง */
.news-card__body > .badge {
  align-self: flex-start;
}

.news-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.news-card__excerpt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__meta {
  display: flex;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.article {
  max-width: 720px;
}

.article__body p {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

/* ── หน้ารายละเอียดการ์ด ───────────────────────────────────────── */
.card-detail {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

.card-detail__art {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
}

.card-stage {
  perspective: 1100px;
}

.card-stage__inner {
  position: relative;
  aspect-ratio: var(--card-ratio);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  transition: transform var(--t-base);
  transform-style: preserve-3d;
  cursor: zoom-in;
}

.card-stage__inner svg,
.card-stage__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-stage__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.22),
    transparent 62%
  );
  opacity: 0;
  transition: opacity var(--t-base);
}

.card-stage:hover .card-stage__shine {
  opacity: 1;
}

.card-detail__art-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

/* หัวข้อ: ชื่อ + รหัสทางซ้าย · ปุ่มใบก่อนหน้า/ถัดไปมุมขวาบน (เหนือช่อง "ขายล่าสุด") */
.card-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-4);
}

.card-detail__heading {
  min-width: 0;
}

.card-detail__title {
  font-size: var(--fs-2xl);
  line-height: 1.15;
}

.card-detail__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.card-detail__id {
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.card-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block: var(--sp-5);
}

.card-detail__actions .btn {
  flex: 1 1 150px;
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm);
}

.spec-list dt {
  color: var(--text-muted);
}

.spec-list dd {
  color: var(--text);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.card-nav {
  display: flex;
  flex-shrink: 0;
  gap: var(--sp-2);
}

/* ── หน้าตลาด / ประกาศขาย ──────────────────────────────────────── */
.listing-detail {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

.seller-box {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.seller-box__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  flex: none;
}

/* ── หน้าสั่งซื้อสินค้า (กล่อง / คาร์ตัน) ───────────────────────── */
/* ซ้าย: แกลเลอรี + รายละเอียดสินค้า / ขวา: ข้อมูลสั่งซื้อ สูงคร่อมสองแถว */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    'gallery info'
    'details info';
  grid-template-rows: auto 1fr;
  gap: var(--sp-6) var(--sp-7);
  align-items: start;
}

.product-detail__gallery {
  grid-area: gallery;
}

.product-detail__info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
}

.product-detail__details {
  grid-area: details;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

/* ── แกลเลอรี: รูปย่อเรียงแนวตั้งด้านซ้าย รูปใหญ่ด้านขวา ─────────── */
.product-gallery {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.product-gallery--single {
  grid-template-columns: minmax(0, 1fr);
}

.product-gallery__stage {
  grid-column: 2;
  grid-row: 1;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 50% 22%, var(--gold-soft), transparent 70%),
    var(--bg-sunken);
}

.product-gallery--single .product-gallery__stage {
  grid-column: 1;
}

.product-gallery__thumbs {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.product-gallery__thumb {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-sunken);
  opacity: 0.62;
  transition: opacity var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.product-gallery__thumb:hover {
  opacity: 1;
  border-color: var(--border-strong);
}

.product-gallery__thumb.is-active {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.product-gallery__stage > svg,
.product-gallery__stage > img,
.product-gallery__thumb > svg,
.product-gallery__thumb > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── ป้ายสถานะ: พรีออเดอร์ / คลัง / มาใหม่ ──────────────────────── */
.product-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.product-status__badge {
  --status-color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--status-color) 55%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--status-color) 12%, transparent);
  color: var(--status-color);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-status__badge--preorder {
  --status-color: var(--accent);
}

.product-status__badge--new {
  --status-color: var(--gold);
}

.product-status__badge--stock {
  --status-color: var(--success);
}

.product-status__badge--low {
  --status-color: var(--accent);
}

.product-status__badge--soldout {
  --status-color: var(--danger);
}

/* ── ชื่อ + ราคา ───────────────────────────────────────────────── */
.product-detail__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.35;
}

.product-detail__price {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ── หัวข้อเล็กตัวห่าง (ตัวเลือก / จำนวน / วันวางจำหน่าย / รายละเอียด) ── */
.product-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.product-field__label,
.product-fact__label,
.product-detail__heading {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.product-detail__heading {
  font-size: var(--fs-sm);
  color: var(--text);
}

.product-field__hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ภาษาไทยไม่มีตัวพิมพ์ใหญ่ และระยะห่างตัวอักษรกว้างทำให้สระ/วรรณยุกต์ลอยแยก */
html[lang='th'] .product-status__badge,
html[lang='th'] .product-field__label,
html[lang='th'] .product-fact__label,
html[lang='th'] .product-detail__heading,
html[lang='th'] .product-actions__buy {
  letter-spacing: 0.02em;
}

/* ── ตัวเลือกสินค้า ────────────────────────────────────────────── */
.product-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.product-option {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.product-option:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

.product-option.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.product-option.is-soldout {
  border-style: dashed;
}

.product-option__note {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-faint);
}

/* ── จำนวน (ใหญ่กว่าในตะกร้า) ──────────────────────────────────── */
.qty-input--lg {
  width: fit-content;
}

.qty-input--lg button {
  width: 44px;
  height: 44px;
}

.qty-input--lg input {
  width: 52px;
  height: 44px;
  font-size: var(--fs-md);
}

/* ── ปุ่มสั่งซื้อ + ใส่ตะกร้า ───────────────────────────────────── */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ปุ่มสั่งซื้อหลักตัดมุมเฉียง ให้เด่นกว่าปุ่มใส่ตะกร้า
   (clip-path ตัดเงาด้านนอกทิ้ง เงาเรืองของปุ่มส้มจึงไม่แสดงที่ปุ่มนี้) */
.product-actions__buy {
  --cut: 14px;
  border-radius: 0;
  font-size: 1.125rem;
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* clip-path ตัดกรอบโฟกัสที่อยู่นอกปุ่มทิ้ง จึงวาดกรอบไว้ด้านในแทน */
.product-actions__buy:focus-visible {
  outline: 2px solid var(--on-accent);
  outline-offset: -6px;
}

.product-actions__incart {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.product-actions__incart a {
  font-weight: 600;
}

.product-actions__note {
  font-size: var(--fs-sm);
  color: var(--warning);
}

/* ── วันวางจำหน่าย + การจัดส่ง ─────────────────────────────────── */
.product-facts {
  border-top: 1px solid var(--border);
}

.product-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.product-fact__value {
  font-weight: 700;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.product-fact--toggle {
  display: block;
}

.product-fact--toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  cursor: pointer;
  list-style: none;
}

.product-fact--toggle summary::-webkit-details-marker {
  display: none;
}

.product-fact--toggle summary svg {
  color: var(--text-muted);
  transition: transform var(--t-base);
}

.product-fact--toggle[open] summary svg {
  transform: rotate(180deg);
}

.product-fact__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.product-fact__body strong {
  color: var(--text);
}

/* ── รายละเอียดสินค้า (ใต้แกลเลอรี) ───────────────────────────── */
.product-detail__desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ── รูปที่ผู้ขายแนบมากับประกาศ ─────────────────────────────────── */
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.upload-preview__item {
  position: relative;
  width: 84px;
  aspect-ratio: var(--card-ratio);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.payout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.payout__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.payout__row--total {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}

/* ── หน้าคลังสะสม ──────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-variant-numeric: lining-nums tabular-nums;
}

.stat-card__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.rarity-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}

.set-progress {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.set-progress__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* ── หน้าตะกร้า ────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-5);
  align-items: start;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item__art {
  aspect-ratio: var(--card-ratio);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cart-item__art svg {
  width: 100%;
  height: 100%;
}

/* สินค้ากล่อง/คาร์ตันใช้ภาพจัตุรัส ไม่ใช่สัดส่วนการ์ด */
.cart-item__art--product {
  aspect-ratio: 1;
  background: var(--bg-sunken);
}

.cart-item__art--product img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.cart-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.cart-item__price {
  text-align: end;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cart-summary {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
}

/* ตะกร้าว่าง: cart.js ล้างกล่องสรุปยอดทิ้ง — ซ่อนกรอบเปล่า แล้วให้ข้อความตะกร้าว่างอยู่กลางหน้า */
.cart-summary:empty {
  display: none;
}

.cart-layout:has(> .cart-summary:empty) {
  grid-template-columns: minmax(0, 1fr);
}

.qty-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-input button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background var(--t-fast);
}

.qty-input button:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.qty-input input {
  width: 38px;
  height: 28px;
  border: none;
  background: none;
  text-align: center;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── หน้าคู่มือ ────────────────────────────────────────────────── */
.guide-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
}

.guide-toc a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border-inline-start: 2px solid transparent;
}

.guide-toc a:hover {
  color: var(--gold);
  background: var(--gold-soft);
}

/* ── หน้าเนื้อหาสั้น: เกี่ยวกับเรา / ติดต่อ / จัดส่ง / ข้อกำหนด ──── */
.info-page {
  max-width: 76ch;
}

.guide-section {
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
  margin-bottom: var(--sp-7);
}

.guide-section h2 {
  margin-bottom: var(--sp-4);
}

.guide-section p {
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.guide-section ol {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  counter-reset: step;
}

.guide-section ol li {
  position: relative;
  padding-inline-start: var(--sp-7);
  color: var(--text-muted);
}

.guide-section ol li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.code-inline {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-sunken);
  color: var(--gold);
}

/* ── หน้าโปรไฟล์ ───────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-5);
  align-items: start;
}

/* รูปโปรไฟล์ + ปุ่มเปลี่ยนรูป */
.profile-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-sunken);
}

.seller-box__avatar.profile-avatar {
  font-size: var(--fs-2xl);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.profile-form .field__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* บัญชีที่เชื่อมต่อ (Facebook) */
.profile-connect__title {
  margin: var(--sp-5) 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.profile-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
}

.profile-connect__logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
  background: #1877f2;
  color: #fff;
}

.profile-connect__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 160px;
}

/* ── หน้าเข้าสู่ระบบ / สมัครสมาชิก ─────────────────────────────── */
.auth-box {
  max-width: 440px;
  margin-inline: auto;
}

.auth-box__title {
  margin-bottom: var(--sp-4);
}

.auth-box__tabs {
  margin-bottom: var(--sp-4);
}

.auth-box__hint {
  margin-bottom: var(--sp-4);
}

.auth-box__notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.auth-box__notice--error {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.auth-box__notice--success {
  background: var(--success-soft);
}

.auth-box__done {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  text-align: center;
  align-items: center;
}

.auth-box__done .data-actions {
  justify-content: center;
  margin-top: var(--sp-2);
}

.auth-box__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
}

/* ── ปุ่มลอยเปิดตัวกรองบนมือถือ ────────────────────────────────── */
.filter-fab {
  display: none;
  position: fixed;
  bottom: var(--sp-5);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  box-shadow: var(--shadow-pop);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(0, 0, 0, 0.62);
  animation: fade-in var(--t-base);
}

/* ── แถบสั่งซื้อติดขอบล่างจอ (หน้าสินค้า บนแท็บเล็ต/มือถือ) ────────
   product.js ใส่/ถอด [hidden] ตามตำแหน่งปุ่มสั่งซื้อหลัก ส่วนจอกว้างซ่อนตลอด */
.buy-bar {
  display: none;
}

@keyframes buy-bar-in {
  from {
    transform: translateY(100%);
  }
}
