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

:root {
  --wood-dark: #1a120e;
  --wood-mid: #3b2418;
  --gold: #c5a059;
  --gold-soft: #d8b978;
  --cream: #f2e6d0;
  --header-h: 96px;
  --nav-h: 84px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: "IBM Plex Sans Thai", sans-serif;
  background: #0d0a08;
  color: var(--cream);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

img,
video {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

html.allow-img-callout,
html.allow-img-callout body {
  -webkit-touch-callout: default;
  touch-action: auto;
}

html.allow-img-callout img:not(.pay-qr-saveable) {
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  touch-action: auto;
}

button,
a,
.nav-item,
.product-card,
.home-btn,
.cart-btn,
.mail-btn,
.header-points,
.header-mycoupons,
.avatar-wrap,
.points-bar {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
.nav-item:focus,
.nav-item:focus-visible {
  outline: none;
  box-shadow: none;
}

.app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 6, 4, 0.35) 0%, rgba(10, 6, 4, 0.55) 45%, rgba(10, 6, 4, 0.72) 100%),
    url("PIC/App_bg.png") center top / cover no-repeat;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
}

/* ===== Header stage: ครอสเฟดเบาๆ ตอนเปลี่ยนหัว ===== */
.app-header-stage {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  overflow: hidden;
}

.app-header {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: transparent;
  border-bottom: none;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.app-header.is-on {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* เฟรมแรกก่อน JS — หัวตาม hash ไม่โชว์หัวหน้าแรกปลอม */
html:not(.is-app-ready)[data-header="home"] .app-header-home,
html:not(.is-app-ready)[data-header="coupons"] .app-header-coupons,
html:not(.is-app-ready)[data-header="account"] .app-header-account,
html:not(.is-app-ready)[data-header="classic"] .app-header-classic {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

html:not(.is-app-ready)[data-page="my-coupons"] #myCouponsBtn,
html:not(.is-app-ready)[data-page="coupon-detail"] #myCouponsBtn {
  display: none !important;
}

html:not(.is-app-ready)[data-page="my-coupons"] #couponsBackBtn,
html:not(.is-app-ready)[data-page="coupon-detail"] #couponsBackBtn {
  display: grid !important;
  place-items: center;
}

.app-header-home {
  display: grid;
  padding: 6px 8px 8px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}

.app-header-classic {
  display: grid;
  padding: 6px 8px 8px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}

.app-header-coupons {
  display: grid;
  padding: 6px 10px 8px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}

/* ความสูงหัวคงที่ — กันทั้งหน้ากระตุกตอนสลับ */

.app-header-stage.is-animating .app-header.is-on,
.app-header-stage.is-animating .app-header.is-leave {
  transition: opacity 260ms ease;
}

.app-header.is-leave {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.app-header.is-enter-from {
  opacity: 0;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .app-header-stage.is-animating .app-header.is-on,
  .app-header-stage.is-animating .app-header.is-leave {
    transition: none;
  }
}

/* --- Header หน้าแรก --- */
.app-header-home .header-left {
  justify-self: start;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.app-header-home .header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.app-header-home .brand {
  justify-self: center;
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

.app-header-home .home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.app-header-home .brand-logo {
  width: auto;
  height: 83px;
  max-width: 153px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.app-header-home .home-btn:active {
  transform: scale(0.96);
}

/* --- Header หน้าคูปอง --- */
.app-header-coupons .header-left {
  justify-self: start;
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-header-coupons .header-right-spacer {
  justify-self: end;
  width: 46px;
  height: 46px;
}

.app-header-coupons .brand {
  justify-self: center;
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

.app-header-coupons .home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.app-header-coupons .brand-logo {
  width: auto;
  height: 83px;
  max-width: 153px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.app-header-coupons .home-btn:active {
  transform: scale(0.96);
}

.header-mycoupons {
  max-width: 118px;
  padding: 8px 10px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(48, 30, 20, 0.92), rgba(22, 14, 10, 0.94));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.header-mycoupons:active {
  transform: scale(0.97);
}

.header-mycoupons[hidden],
.header-coupons-back[hidden] {
  display: none !important;
}

.header-coupons-back {
  width: 40px;
  height: 40px;
}

.header-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: #fff4d8;
  font-family: inherit;
  cursor: pointer;
}

.header-points:active {
  transform: scale(0.96);
}

.header-points-coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #f0d48a, #b8862e 70%);
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #3a2410;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  line-height: 1;
}

.header-points-value {
  max-width: 64px;
  color: #fff4d8;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.app-header-home .mail-btn,
.app-header-home .cart-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.app-header-home .mail-btn:active,
.app-header-home .cart-btn:active,
.app-header-account .mail-btn:active,
.app-header-account .cart-btn:active {
  transform: scale(0.94);
}

.app-header-account {
  display: grid;
  padding: 6px 8px 8px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}

.app-header-account .header-left {
  justify-self: start;
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-header-account .header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-header-account .brand {
  justify-self: center;
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

.app-header-account .home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.app-header-account .brand-logo {
  width: auto;
  height: 83px;
  max-width: 153px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.app-header-account .home-btn:active {
  transform: scale(0.96);
}

.app-header-home .mail-btn,
.app-header-home .cart-btn,
.app-header-account .mail-btn,
.app-header-account .cart-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.app-header-classic .brand {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: visible;
}

.app-header-classic .home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  overflow: visible;
}

.app-header-classic .brand-logo {
  width: auto;
  height: 83px;
  max-width: 153px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.app-header-classic .home-btn:active {
  transform: scale(0.96);
}

.member-cluster {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-self: center;
  align-self: center;
  width: max-content;
  max-width: none;
  min-width: 0;
  padding: 0;
  flex-shrink: 0;
  transform: translateX(7%);
}

html.is-android .app-header-classic .member-cluster {
  transform: translateX(7%);
}

/* Android Chrome: คอลัมน์ซ้าย-ขวาไม่เท่ากัน เลยดูเบียดขวา — บังคับให้เท่า iOS */
html.is-android .app-header-classic {
  padding: 6px 8px 8px;
  gap: 4px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

html.is-android .app-header-classic .brand,
html.is-android .app-header-classic .cart-btn {
  min-width: 0;
}

html.is-android .app-header-classic .brand-logo {
  width: auto;
  height: 83px;
  max-width: 153px;
  flex-shrink: 0;
  transform: translateX(-7%);
}

html.is-android .app-header-classic .points-bar,
html.is-android .app-header-classic .points-text {
  max-height: 29px;
}

html.is-android .app-header-classic .avatar-wrap,
html.is-android .app-header-classic .avatar {
  width: 42px;
  height: 42px;
}

html.is-android .app-header-classic .crown {
  top: -11px;
  font-size: 13px;
}

html.is-android .app-header-classic .messenger-badge {
  width: 14px;
  height: 14px;
  font-size: 8px;
}

html.is-android .app-header-classic .points-bar {
  height: 29px;
  gap: 5px;
  margin-left: -10px;
  padding: 0 5px 0 13px;
}

html.is-android .app-header-classic .points-text {
  font-size: 0.58rem;
}

html.is-android .app-header-classic .points-v {
  width: 21px;
  height: 21px;
  font-size: 0.58rem;
}

html.is-android .app-header-classic .exp-bar {
  width: 42px;
  height: 3px;
  margin-top: 3px;
}

.avatar-wrap {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  z-index: 2;
  line-height: 1;
  pointer-events: none;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid #fff4d8;
  background:
    radial-gradient(circle at 35% 30%, #6b5344, #2a1c14 70%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.messenger-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1b1410;
  border: 1px solid var(--gold-soft);
  font-size: 10px;
  display: grid;
  place-items: center;
  line-height: 1;
  pointer-events: none;
}

.messenger-badge[hidden] {
  display: none !important;
}

.points-bar {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  height: 36px;
  margin-left: -12px;
  padding: 0 6px 0 16px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90, 28, 22, 0.92), rgba(140, 42, 32, 0.92));
  color: #fff4d8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-family: inherit;
  overflow: visible;
  flex-shrink: 0;
}

.points-text {
  overflow: visible;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  line-height: 1.55;
  padding-block: 0.12em;
  pointer-events: none;
}

.points-text strong {
  display: inline-block;
  width: 7ch;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: inherit;
}

.points-v {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #f0d48a, #b8862e 70%);
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #3a2410;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.exp-bar {
  grid-column: 1;
  grid-row: 2;
  width: 52px;
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.exp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8a6a2f, var(--gold-soft));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.app-header-classic .header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-header-classic .cart-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.app-header-classic .cart-btn:active {
  transform: scale(0.94);
}

.cart-btn svg {
  width: 30px;
  height: 30px;
}

.cart-btn.cart-bump {
  animation: cartBump 380ms ease;
}

@keyframes cartBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.cart-fly-blob {
  position: fixed;
  z-index: 200;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7a6a, #b33a2b 70%);
  box-shadow: 0 0 10px rgba(179, 58, 43, 0.55);
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 480ms cubic-bezier(0.22, 0.7, 0.2, 1), opacity 480ms ease;
}

.mail-count,
.cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b33a2b;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.app-header-home .mail-count,
.app-header-home .cart-count,
.app-header-account .mail-count,
.app-header-account .cart-count,
.app-header-classic .mail-count,
.app-header-classic .cart-count {
  top: 2px;
  right: 0;
}
}

.mail-count[hidden],
.cart-count[hidden] {
  display: none !important;
}

/* ===== Main ===== */
.app-main {
  height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 12px 14px calc(var(--nav-h) + var(--safe-bottom) + 28px);
  scrollbar-width: none;
}

.app-main::-webkit-scrollbar {
  display: none;
}

/* ===== Page panels ===== */
.page {
  display: none;
}

/* โชว์หน้าตาม html[data-page] — rule เพิ่มอัตโนมัติจาก JS สำหรับหน้าใหม่ */
#dynamic-page-visibility {
  /* filled by app.js */
}

html[data-page="home"] #navSmear { transform: translateX(0); }
html[data-page="products"] #navSmear { transform: translateX(100%); }
html[data-page="coupons"] #navSmear,
html[data-page="my-coupons"] #navSmear,
html[data-page="coupon-detail"] #navSmear { transform: translateX(200%); }
html[data-page="account"] #navSmear { transform: translateX(300%); }

html[data-page="home"] .nav-item[data-page="home"] .nav-icon,
html[data-page="products"] .nav-item[data-page="products"] .nav-icon,
html[data-page="coupons"] .nav-item[data-page="coupons"] .nav-icon,
html[data-page="my-coupons"] .nav-item[data-page="coupons"] .nav-icon,
html[data-page="coupon-detail"] .nav-item[data-page="coupons"] .nav-icon,
html[data-page="account"] .nav-item[data-page="account"] .nav-icon {
  transform: scale(1.1);
}

html[data-page="home"] .nav-item[data-page="home"] .nav-label,
html[data-page="products"] .nav-item[data-page="products"] .nav-label,
html[data-page="coupons"] .nav-item[data-page="coupons"] .nav-label,
html[data-page="my-coupons"] .nav-item[data-page="coupons"] .nav-label,
html[data-page="coupon-detail"] .nav-item[data-page="coupons"] .nav-label,
html[data-page="account"] .nav-item[data-page="account"] .nav-label {
  color: #fff6d8;
  font-weight: 700;
}

.page-title {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  line-height: 1.45;
}

.glass-panel {
  margin-bottom: 18px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.5);
  color: rgba(242, 230, 208, 0.9);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
}

.glass-panel p {
  margin: 0 0 0.85em;
}

.glass-panel p:last-child {
  margin-bottom: 0;
}

.products-intro {
  background: rgba(10, 8, 6, 0.45);
}

.ship-info {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(28, 16, 12, 0.72), rgba(12, 8, 6, 0.55));
}

.ship-info-title {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 0.95rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.ship-min {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(197, 160, 89, 0.12);
}

.ship-min-label {
  color: rgba(242, 230, 208, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
}

.ship-min-value {
  color: #fff4d8;
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.ship-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ship-card {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(8, 6, 4, 0.45);
}

.ship-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ship-emoji {
  font-size: 1rem;
  line-height: 1;
}

.ship-card h3 {
  margin: 0;
  color: #fff4d8;
  font-size: 0.82rem;
  font-weight: 700;
}

.ship-card ul {
  margin: 0;
  padding-left: 1.05em;
  color: rgba(242, 230, 208, 0.82);
  font-size: 0.68rem;
  line-height: 1.55;
}

.ship-card li {
  margin-bottom: 0.35em;
}

.ship-card li:last-child {
  margin-bottom: 0;
}

.ship-card strong {
  color: var(--gold-soft);
  font-weight: 700;
}

.ship-highlight {
  list-style: none;
  margin: 8px 0 0 -1.05em;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.28), rgba(140, 42, 32, 0.35));
  color: #fff4d8;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 0 0 1px rgba(255, 244, 216, 0.08) inset;
}

.ship-note {
  margin: 10px 0 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.68rem;
  line-height: 1.45;
}

.category-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 51px;
  margin-bottom: 18px;
  padding: 8px 0 10px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.category-orb {
  width: 144px; /* +20% จาก 120px */
  height: 144px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: visible;
  transition: transform 180ms ease;
}

.category-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.category-btn[data-category="edible"] .category-icon {
  filter: brightness(1.2);
}

.category-btn[data-category="buds"] .category-icon {
  filter: brightness(1.3);
}

.category-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(242, 230, 208, 0.82);
  letter-spacing: 0.02em;
}

.category-btn.is-active .category-orb {
  transform: scale(1.05);
}

.category-btn.is-active .category-name {
  color: var(--gold-soft);
}

.category-btn:active .category-orb {
  transform: scale(0.97);
}

/* ===== Catalog (Edible / พร้อมใช้ซ้ำกับ Buds) ===== */
.catalog-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.catalog-back {
  flex-shrink: 0;
  margin-top: 2px;
}

.catalog-heading {
  min-width: 0;
  flex: 1;
}

.catalog-title {
  margin-bottom: 4px;
}

.catalog-lead {
  margin: 0;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
}

.catalog-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 2px 2px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.catalog-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.45);
  color: rgba(242, 230, 208, 0.82);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.is-on {
  border-color: rgba(197, 160, 89, 0.75);
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.7), rgba(40, 22, 14, 0.75));
  color: #fff4d8;
}

.filter-chip:active {
  transform: scale(0.97);
}

.catalog-meta {
  margin-bottom: 10px;
  color: rgba(216, 185, 120, 0.85);
  font-size: 0.76rem;
  font-weight: 600;
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.catalog-card {
  /* ใช้สไตล์ .product-card เดิม — กว้างขึ้นนิดในกริด 2 คอลัมน์ */
  min-height: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}

.catalog-card.is-hidden {
  display: none;
}

.ship-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.ship-pill.parcel {
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: rgba(197, 160, 89, 0.18);
  color: #f0d48a;
}

.ship-pill.rider {
  border: 1px solid rgba(120, 180, 220, 0.55);
  background: rgba(40, 90, 120, 0.35);
  color: #c8e6f5;
}

.product-card {
  position: relative;
}

.product-card .ship-pill {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  padding: 5px 9px;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  isolation: isolate;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 2px 0 rgba(0, 0, 0, 0.42),
    0 5px 12px rgba(0, 0, 0, 0.45);
}

.product-card .ship-pill.parcel {
  background: #c5a059;
  border: 1px solid #f3dc9a;
  color: #1a120e;
}

.product-card .ship-pill.rider {
  background: #2a7aad;
  border: 1px solid #9ad4f0;
  color: #fff;
}

/* ===== Product detail ===== */
.pd-gallery {
  margin-bottom: 12px;
}

.pd-main-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.55);
  aspect-ratio: 1 / 1;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.pd-main-wrap.is-dragging {
  cursor: grabbing;
  touch-action: none;
}

.pd-main-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.pd-main-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.pd-thumbs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.pd-thumbs-row.is-swiping {
  cursor: grabbing;
}

.pd-thumbs-row.is-swiping .pd-thumb {
  pointer-events: none;
}

.pd-thumb-shift {
  flex: 0 0 auto;
  width: 22px;
  align-self: stretch;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(48, 32, 22, 0.92), rgba(16, 10, 8, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 244, 216, 0.08);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.pd-thumb-shift::before {
  content: "";
  width: 6px;
  height: 6px;
  border-left: 2px solid rgba(255, 244, 216, 0.82);
  border-bottom: 2px solid rgba(255, 244, 216, 0.82);
  transform: rotate(45deg);
  margin-left: 2px;
}

.pd-thumb-shift.is-next::before {
  transform: rotate(-135deg);
  margin-left: 0;
  margin-right: 2px;
}

.pd-thumb-shift:active {
  transform: scale(0.96);
  background: linear-gradient(180deg, rgba(70, 46, 30, 0.95), rgba(24, 14, 10, 0.9));
}

.pd-thumb-shift[hidden] {
  display: none !important;
}

.pd-thumbs-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: pd-thumbs;
}

.pd-thumbs-track {
  position: relative;
  display: flex;
  gap: 8px;
  width: max-content;
  will-change: transform;
}

.pd-thumbs-track.is-center {
  width: 100%;
  justify-content: center;
}

.pd-thumb {
  flex: 0 0 calc((100cqw - 16px) / 3);
  width: calc((100cqw - 16px) / 3);
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 0;
  border: 1.5px solid rgba(197, 160, 89, 0.3);
  border-radius: 12px;
  overflow: hidden;
  background: #1a120e;
  cursor: pointer;
}

.pd-thumbs-track.is-center .pd-thumb {
  flex-grow: 0;
  flex-shrink: 0;
}

.pd-thumb.is-on {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.35);
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.pd-ship-badge {
  margin-bottom: 10px;
}

.pd-ship-badge .ship-pill {
  font-size: 0.78rem;
  padding: 6px 12px;
}

.pd-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pd-desc {
  margin: 0 0 12px;
  color: rgba(242, 230, 208, 0.86);
  font-size: 0.84rem;
  line-height: 1.65;
  font-weight: 500;
  white-space: pre-wrap;
}

.pd-desc .news-article-h {
  margin: 16px 0 2px;
  font-size: 0.95rem;
}

.pd-desc .news-article-h:first-child {
  margin-top: 0;
}

.pd-warn {
  display: block;
  margin-top: 16px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(196, 74, 58, 0.62);
  background: rgba(62, 16, 12, 0.55);
  white-space: pre-wrap;
}

.pd-warn > .news-article-h:first-child {
  margin-top: 0;
  color: #ffd0c4;
}

.pd-warn .news-article-list {
  margin-bottom: 0;
}

.pd-stock {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(197, 160, 89, 0.12);
  color: #fff4d8;
  font-size: 0.82rem;
  font-weight: 700;
}

.pd-presets-block {
  margin-bottom: 14px;
}

.pd-presets-block.is-orbit .pd-presets {
  display: none;
}

.pd-label {
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.pd-presets-block.is-orbit .pd-label {
  font-size: 0.9rem;
  font-weight: 800;
}

.pd-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-preset {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.45);
  color: rgba(242, 230, 208, 0.88);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.pd-preset.is-on {
  border-color: rgba(197, 160, 89, 0.75);
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.75), rgba(40, 22, 14, 0.8));
  color: #fff4d8;
}

.pd-strength {
  margin-top: 12px;
}

.pd-strength[hidden] {
  display: none !important;
}

.pd-strengths {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.pd-strength-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  width: 100%;
  padding: 8px 4px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.45);
  color: rgba(242, 230, 208, 0.88);
  text-align: center;
  font-family: inherit;
  cursor: pointer;
}

.pd-strength-btn.is-on {
  border-color: rgba(197, 160, 89, 0.75);
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.75), rgba(40, 22, 14, 0.8));
  color: #fff4d8;
}

.pd-strength-name {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.pd-strength-meta {
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.pd-strength-btn.is-on .pd-strength-meta {
  color: rgba(255, 244, 216, 0.78);
}

.pd-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.5);
}

.pd-step {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 8px;
  background: rgba(18, 12, 8, 0.7);
  color: #fff4d8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.pd-qty-text {
  min-width: 2em;
  text-align: center;
  color: #fff4d8;
  font-size: 0.95rem;
  font-weight: 700;
}

.pd-orbit {
  display: grid;
  gap: 8px;
}

.pd-orbit[hidden] {
  display: none !important;
}

.pd-vol-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background: rgba(18, 12, 8, 0.62);
  color: rgba(242, 230, 208, 0.9);
  font-size: 0.8rem;
}

.pd-vol-table th,
.pd-vol-table td {
  padding: 7px 10px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  line-height: 1.25;
}

.pd-vol-table thead th {
  background: rgba(48, 30, 18, 0.95);
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
}

.pd-vol-table th:last-child,
.pd-vol-table td:last-child {
  width: 42%;
  text-align: right;
}

.pd-vol-table td:last-child {
  font-family: "Cinzel", serif;
  font-weight: 700;
}

.pd-vol-table tbody tr {
  pointer-events: none;
}

.pd-vol-table tbody tr:nth-child(even) td {
  background: rgba(255, 244, 216, 0.03);
}

.pd-vol-table tbody tr.is-on td {
  background: rgba(90, 50, 24, 0.55);
  color: #fff4d8;
}

.pd-vol-table tbody tr.is-on td:first-child {
  box-shadow: inset 2px 2px 0 #c5a059, inset 0 -2px 0 #c5a059;
}

.pd-vol-table tbody tr.is-on td:last-child {
  box-shadow: inset -2px 2px 0 #c5a059, inset 0 -2px 0 #c5a059;
}

.pd-orbit-unit {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background:
    radial-gradient(120px 40px at 90% 0%, rgba(197, 160, 89, 0.16), transparent 70%),
    rgba(12, 8, 6, 0.55);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.12), inset 0 0 18px rgba(197, 160, 89, 0.06);
}

.pd-orbit-unit-label {
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.8rem;
  font-weight: 700;
}

.pd-orbit-unit-was {
  margin-left: auto;
  color: rgba(242, 230, 208, 0.38);
  font-size: 0.82rem;
  text-decoration: line-through;
}

.pd-orbit-unit-was[hidden] {
  display: none !important;
}

.pd-orbit-unit-price {
  color: #fff4d8;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.pd-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  background: rgba(12, 8, 6, 0.5);
  color: rgba(242, 230, 208, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

.pd-total-meta {
  display: block;
  margin-top: 3px;
  color: rgba(242, 230, 208, 0.5);
  font-size: 0.72rem;
  font-weight: 600;
}

.pd-total-meta:empty {
  display: none;
}

.pd-buy-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.pd-add {
  padding: 12px 14px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.92), rgba(90, 28, 22, 0.92));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.pd-add:active {
  transform: scale(0.99);
}

.pd-total strong {
  color: #fff4d8;
  font-family: "Cinzel", serif;
  font-size: 1.15rem;
}

.cart-line-unit {
  margin-bottom: 4px;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
}

.cart-line-unit s {
  margin-left: 6px;
  color: rgba(242, 230, 208, 0.34);
  font-weight: 600;
}

/* Alert */
.app-alert {
  position: absolute;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-alert[hidden] {
  display: none !important;
}

.app-alert-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.app-alert-card {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 18px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  background: linear-gradient(160deg, rgba(36, 22, 16, 0.96), rgba(16, 10, 8, 0.96));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.app-alert-title {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 700;
}

.app-alert-msg {
  margin: 0 0 14px;
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.86rem;
  line-height: 1.5;
}

.coupon-claim-card .app-alert-msg {
  margin-bottom: 8px;
}

.coupon-claim-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 8px;
  margin: 0 0 14px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 160, 89, 0.22), rgba(18, 10, 8, 0.55));
}

.coupon-claim-balance-label,
.coupon-claim-balance-unit {
  color: rgba(242, 230, 208, 0.7);
  font-size: 0.74rem;
  font-weight: 700;
}

.coupon-claim-balance-value {
  color: #f3e2b6;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 0 16px rgba(197, 160, 89, 0.32);
}

.app-alert-actions .app-alert-ok {
  width: auto;
}

/* ยืนยันแลกคูปอง — แผ่นเลื่อนขึ้นครึ่งจอ */
.coupon-confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 135;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.coupon-confirm-overlay[hidden] {
  display: none !important;
}

.coupon-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  opacity: 1;
  transition: opacity 280ms ease;
}

.coupon-confirm-overlay.is-closing .coupon-confirm-backdrop {
  opacity: 0;
}

.coupon-confirm-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px calc(18px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(197, 160, 89, 0.38);
  border-bottom: none;
  background: linear-gradient(
    180deg,
    rgba(42, 26, 18, 0.98),
    rgba(16, 10, 8, 0.98)
  );
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(0);
}

.coupon-confirm-overlay.is-opening .coupon-confirm-sheet {
  animation: coupon-confirm-in 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.coupon-confirm-overlay.is-closing .coupon-confirm-sheet {
  animation: coupon-confirm-out 280ms ease forwards;
}

.coupon-confirm-overlay.is-dragging .coupon-confirm-sheet {
  animation: none !important;
  transition: none;
}

.coupon-confirm-overlay.is-dragging .coupon-confirm-backdrop {
  transition: opacity 120ms linear;
}

.sheet-handle,
.coupon-confirm-handle {
  display: block;
  width: 42px;
  height: 4px;
  margin: 4px auto 8px;
  border-radius: 99px;
  background: rgba(197, 160, 89, 0.45);
  flex-shrink: 0;
  touch-action: none;
  cursor: grab;
}

.sheet-handle:active,
.coupon-confirm-handle:active {
  cursor: grabbing;
}

.sheet-swipe-zone {
  touch-action: pan-x;
}

@keyframes coupon-confirm-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes coupon-confirm-out {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

.coupon-confirm-title {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 280px;
  color: var(--cream);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

.coupon-confirm-title strong {
  color: var(--gold-soft);
  font-weight: 800;
}

.coupon-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.coupon-confirm-actions .app-alert-ok {
  width: auto;
}

.verify-code {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  background: rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
}

.verify-code:focus {
  outline: none;
  border-color: var(--gold);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Account page ===== */
.acct-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.acct-name-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-edit-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.78);
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(197, 160, 89, 0.28), rgba(28, 16, 10, 0.92));
  box-shadow: 0 0 0 1px rgba(10, 6, 4, 0.35), 0 4px 10px rgba(0, 0, 0, 0.28);
  color: var(--gold);
  cursor: pointer;
}

.acct-edit-btn svg {
  display: block;
}

.acct-edit-btn:active {
  transform: scale(0.94);
  background: rgba(197, 160, 89, 0.38);
}

.acct-menu {
  display: grid;
  gap: 0;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(14, 10, 8, 0.72);
  overflow: hidden;
}

.acct-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: none;
  border-bottom: 1px solid rgba(197, 160, 89, 0.16);
  background: transparent;
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

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

button.acct-menu-item:active {
  background: rgba(197, 160, 89, 0.1);
}

.acct-menu-toggle {
  cursor: default;
}

.acct-menu-ico {
  display: grid;
  place-items: center;
  color: var(--gold);
}

.acct-menu-label {
  flex: 1;
  min-width: 0;
}

.acct-menu-meta {
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.78rem;
  font-weight: 600;
}

.acct-menu-chevron {
  color: rgba(197, 160, 89, 0.7);
  font-size: 1.15rem;
  line-height: 1;
}

.acct-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.acct-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.acct-switch-ui {
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  background: rgba(18, 12, 8, 0.85);
  transition: background 180ms ease, border-color 180ms ease;
}

.acct-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cbb89a;
  transition: transform 180ms ease, background 180ms ease;
}

.acct-switch input:checked + .acct-switch-ui {
  background: linear-gradient(90deg, #b8862e, #d8b978);
  border-color: var(--gold);
}

.acct-switch input:checked + .acct-switch-ui::after {
  transform: translateX(18px);
  background: #3a2410;
}

.pf-sheet {
  padding-bottom: 0;
}

.pf-sheet .pts-title {
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: center;
}

.pf-body {
  padding-bottom: 12px;
}

.pf-sex {
  display: flex;
  gap: 8px;
  margin: 0 0 6px;
  border: none;
  padding: 0;
}

.pf-sex.is-error .pf-sex-opt {
  border-color: rgba(196, 72, 72, 0.7);
}

#pfGenderError {
  margin: 0 0 14px;
}

.pf-sex-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.45);
  color: #fff4d8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.pf-sex-opt input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: transparent;
  flex-shrink: 0;
}

.pf-sex-opt input:checked {
  box-shadow: inset 0 0 0 3.5px #b33a2b;
  border-color: #e24a38;
  background: #fff4d8;
}

.pf-sex-opt:has(input:checked) {
  border-color: rgba(226, 74, 56, 0.7);
  background: rgba(140, 42, 32, 0.28);
}

.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.pf-field {
  display: grid;
  gap: 5px;
  color: rgba(242, 230, 208, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
}

.pf-field em {
  color: #e24a38;
  font-style: normal;
}

.pf-field.pf-span {
  grid-column: 1 / -1;
}

.pf-announce {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin: -2px 0 2px;
}

.pf-announce .pf-consent,
.pf-announce .pf-consent {
  margin: 0;
  font-size: 0.72rem;
}

.pf-field input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.38);
  background: rgba(255, 244, 216, 0.96);
  color: #2a1c14;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.pf-field input:focus {
  outline: none;
  border-color: var(--gold);
}

.pf-field input.is-error {
  border-color: rgba(196, 74, 58, 0.9);
  box-shadow: 0 0 0 2px rgba(196, 74, 58, 0.16);
}

.pf-field input.is-error:focus {
  border-color: rgba(196, 74, 58, 0.95);
}

.pf-field-error {
  color: #c44a3a;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.pf-field-error[hidden] {
  display: none !important;
}

.pf-field input[type="date"] {
  color-scheme: light;
}

.pf-verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.pf-verify-btn {
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: linear-gradient(160deg, rgba(48, 30, 20, 0.92), rgba(22, 14, 10, 0.94));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.pf-verify-btn:active {
  transform: scale(0.97);
}

.pf-verify-btn.is-done {
  border-color: rgba(90, 180, 110, 0.7);
  color: #b6f0c2;
  pointer-events: none;
}

.pf-verify-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(242, 230, 208, 0.55);
}

.pf-consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin: 8px 0 6px;
  color: rgba(242, 230, 208, 0.82);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.pf-consent-check {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.5px solid var(--gold);
  background: rgba(12, 8, 6, 0.55);
}

.pf-consent-check:checked {
  background: #b33a2b;
  border-color: #e24a38;
}

.pf-consent-check:checked::after {
  content: "✓";
  display: grid;
  place-items: center;
  color: #fff4d8;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.pf-foot {
  display: grid;
  gap: 8px;
  padding: 10px 18px calc(12px + var(--safe-bottom));
  border-top: 1px solid rgba(197, 160, 89, 0.22);
}

.pf-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: none;
  background: transparent;
  color: rgba(242, 230, 208, 0.7);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pf-save {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.96), rgba(90, 28, 22, 0.96));
  color: #fff4d8;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.pf-save:active {
  transform: scale(0.99);
}

.acct-empty {
  margin: 12px 0 0;
  padding: 18px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(197, 160, 89, 0.35);
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

.acct-add-btn,
.acct-tax-save {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(160deg, rgba(48, 30, 20, 0.92), rgba(22, 14, 10, 0.94));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.acct-lang-list {
  display: grid;
  gap: 8px;
}

.acct-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: rgba(14, 10, 8, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.acct-lang.is-on {
  border-color: var(--gold);
  background: rgba(197, 160, 89, 0.14);
}

.acct-lang:disabled {
  opacity: 0.55;
  cursor: default;
}

.acct-terms h3 {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.95rem;
}

.acct-terms p,
.acct-terms li {
  color: rgba(242, 230, 208, 0.8);
  font-size: 0.84rem;
  line-height: 1.6;
}

.acct-terms ul {
  margin: 0 0 14px 18px;
}

.acct-terms p {
  margin: 0 0 12px;
}

.acct-lang-hint {
  margin: 0 0 12px;
  color: rgba(242, 230, 208, 0.68);
  font-size: 0.8rem;
  line-height: 1.5;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: linear-gradient(160deg, rgba(36, 22, 16, 0.88), rgba(16, 10, 8, 0.92));
}

.order-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.order-seq {
  margin: 0;
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.order-meta {
  margin: 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.order-bday-flag {
  margin: 0 0 8px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background: rgba(90, 50, 24, 0.45);
  color: #f0d48a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.order-items {
  margin: 0 0 8px;
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.84rem;
  line-height: 1.45;
}

.order-total {
  margin: 0 0 12px;
  color: #fff4d8;
  font-size: 0.9rem;
  font-weight: 700;
}

.order-track-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}

.order-courier {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.order-track-no {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-copy {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.65);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.order-status {
  margin: 0 0 10px;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
}

.order-card.is-shipped {
  border-color: rgba(240, 215, 160, 0.62);
  box-shadow: 0 0 18px rgba(197, 160, 89, 0.16);
}

.order-shipped-box {
  margin: 0 0 10px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(240, 215, 160, 0.55);
  background: linear-gradient(165deg, rgba(120, 78, 36, 0.48), rgba(28, 18, 12, 0.78));
}

.order-status.is-shipped {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 215, 160, 0.8);
  background: rgba(197, 160, 89, 0.28);
  color: #f0d7a0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.order-track-kicker {
  margin: 0 0 2px;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.order-track-value {
  margin: 0;
  color: #fff4d8;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.35;
  word-break: break-all;
  user-select: text;
}

.order-track-btn,
.order-receive,
.order-staff-send,
.acct-tax-save {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.9), rgba(90, 28, 22, 0.9));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.order-track-btn {
  margin-bottom: 8px;
}

.order-copy:active,
.order-receive:active,
.order-track-btn:active,
.order-staff-send:active {
  transform: scale(0.97);
}

.order-wait {
  margin: 0 0 10px;
  color: rgba(242, 230, 208, 0.58);
  font-size: 0.8rem;
}

.shop-track-member,
.shop-track-name,
.shop-track-phone,
.shop-track-addr {
  margin: 0 0 4px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(242, 230, 208, 0.88);
}

.shop-track-name {
  font-weight: 800;
  color: #fff4d8;
  font-size: 0.92rem;
}

.shop-track-addr {
  margin-bottom: 10px;
  color: rgba(242, 230, 208, 0.72);
}

.shop-tool-hint {
  margin: 0 0 12px;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.78rem;
  line-height: 1.45;
}

.shop-member-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.45);
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.82rem;
  line-height: 1.45;
}

.shop-member-card strong {
  color: var(--gold-soft);
}

.shop-tool-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.shop-track-form,
.order-staff {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(197, 160, 89, 0.28);
  display: grid;
  gap: 8px;
}

.order-staff-tools {
  margin-bottom: 12px;
}

.order-staff-clear {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 140, 120, 0.55);
  background: rgba(90, 24, 18, 0.42);
  color: #ffd4cc;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.order-staff-clear:active {
  transform: scale(0.99);
}

.order-staff-label {
  margin: 0;
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.shop-track-form select,
.shop-track-form input,
.order-staff select,
.order-staff input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  background: rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.86rem;
}

.order-shadow {
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.45);
}

.order-shadow h3 {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 0.86rem;
}

.order-shadow p {
  margin: 0 0 10px;
  color: rgba(242, 230, 208, 0.58);
  font-size: 0.74rem;
}

.order-shadow-item {
  margin: 0 0 8px;
  color: rgba(242, 230, 208, 0.82);
  font-size: 0.78rem;
  line-height: 1.45;
}

.track-overlay {
  position: absolute;
  inset: 0;
  z-index: 136;
  display: flex;
  flex-direction: column;
  background: #0c0806;
}

.track-overlay[hidden] {
  display: none !important;
}

.track-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.track-head {
  flex-shrink: 0;
}

.track-copy-bar {
  flex-shrink: 0;
  display: grid;
  gap: 6px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(16, 10, 8, 0.92);
}

.track-copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-copy-hint {
  margin: 0;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.68rem;
  line-height: 1.35;
}

.track-copy-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.track-copy-courier {
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.track-copy-no {
  color: #fff4d8;
  font-size: 0.98rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-copy-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.9), rgba(90, 28, 22, 0.9));
  color: #fff4d8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.track-copy-btn:active {
  transform: scale(0.97);
}

.track-refresh {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.65);
  color: #fff4d8;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.track-refresh:active {
  transform: scale(0.94);
  background: rgba(197, 160, 89, 0.22);
}

.track-external-fallback[hidden],
.track-frame-wrap[hidden] {
  display: none !important;
}

.track-external-fallback:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px 20px;
  background: #0c0806;
  text-align: center;
}

.track-external-note {
  margin: 0;
  max-width: 280px;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.track-external-btn {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.9), rgba(90, 28, 22, 0.9));
  color: #fff4d8;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.track-external-btn:active {
  transform: scale(0.97);
}

.track-frame-wrap {
  flex: 1;
  min-height: 0;
  background: #0c0806;
}

.track-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.app-alert-ok {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.9), rgba(90, 28, 22, 0.9));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.app-alert-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-alert-cancel,
.app-alert-danger {
  padding: 11px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.app-alert-cancel {
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(18, 12, 8, 0.72);
  color: rgba(242, 230, 208, 0.88);
}

.app-alert-cancel:active {
  opacity: 0.82;
}

.app-alert-danger {
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.9), rgba(90, 28, 22, 0.9));
  color: #fff4d8;
}

.app-alert-danger:active {
  transform: scale(0.98);
}

.save-toast {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(160deg, rgba(48, 32, 20, 0.97), rgba(18, 12, 8, 0.97));
  color: #fff4d8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-140%);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.save-toast[hidden] {
  display: none !important;
}

.save-toast.is-on {
  transform: translateY(0);
}

.save-toast-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
}

.save-toast-text {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

/* ===== Page loader — ใบไม้ดึ๋งๆ ตอนเปลี่ยนหน้า / บูตแอป ===== */
html.is-booting,
html.is-booting body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

html.is-booting .app-main {
  overflow: hidden !important;
  touch-action: none;
  pointer-events: none;
}

html.is-booting .app-header-stage,
html.is-booting .bottom-nav {
  pointer-events: none;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 220ms ease;
}

.page-loader[hidden] {
  display: none !important;
}

.page-loader:not([hidden]) {
  pointer-events: auto;
}

.page-loader.is-on {
  opacity: 1;
  pointer-events: auto;
}

.page-loader-card {
  position: relative;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background:
    radial-gradient(circle at 50% 32%, rgba(62, 40, 26, 0.98), rgba(12, 8, 6, 0.98) 72%);
  box-shadow:
    0 0 0 1px rgba(255, 244, 216, 0.06) inset,
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(80, 220, 90, 0.12);
}

.page-loader-orbit,
.page-loader-orbit-slow {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  pointer-events: none;
}

.page-loader-orbit {
  border-top-color: rgba(197, 160, 89, 0.95);
  border-right-color: rgba(124, 255, 120, 0.35);
  animation: loaderOrbit 1.15s linear infinite;
}

.page-loader-orbit-slow {
  inset: 4px;
  border-bottom-color: rgba(216, 185, 120, 0.45);
  border-left-color: rgba(90, 255, 110, 0.18);
  animation: loaderOrbit 2.4s linear infinite reverse;
}

.page-loader-spark,
.page-loader-spark-2,
.page-loader-spark-3 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4d8, #c5a059 70%);
  box-shadow: 0 0 8px rgba(197, 160, 89, 0.9);
  pointer-events: none;
  animation: loaderSpark 1.7s linear infinite;
}

.page-loader-spark-2 {
  animation-duration: 2.2s;
  animation-direction: reverse;
}

.page-loader-spark-3 {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  animation-duration: 2.8s;
  animation-delay: -0.4s;
}

.page-loader-leaf-wrap {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  animation: loaderDance 1.05s ease-in-out infinite;
}

.page-loader-leaf {
  width: 72px;
  height: 72px;
  object-fit: contain;
  mix-blend-mode: screen;
  animation: loaderGlow 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loaderOrbit {
  to { transform: rotate(360deg); }
}

@keyframes loaderDance {
  0%, 100% { transform: translateY(0) rotate(-7deg) scale(1); }
  30% { transform: translateY(-8px) rotate(5deg) scale(1.08); }
  55% { transform: translateY(1px) rotate(-3deg) scale(0.98); }
  78% { transform: translateY(-5px) rotate(8deg) scale(1.06); }
}

@keyframes loaderGlow {
  0%, 100% {
    filter:
      drop-shadow(0 0 6px rgba(90, 255, 110, 0.45))
      drop-shadow(0 0 16px rgba(90, 255, 110, 0.2));
  }
  50% {
    filter:
      drop-shadow(0 0 14px rgba(140, 255, 150, 0.95))
      drop-shadow(0 0 28px rgba(90, 255, 110, 0.5));
  }
}

@keyframes loaderSpark {
  from { transform: rotate(0deg) translateX(42px); }
  to { transform: rotate(360deg) translateX(42px); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader-orbit,
  .page-loader-orbit-slow,
  .page-loader-spark,
  .page-loader-spark-2,
  .page-loader-spark-3,
  .page-loader-leaf-wrap,
  .page-loader-leaf {
    animation: none;
  }
}

.ticker {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.55);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: flex;
  gap: 40px;
  width: max-content;
  padding: 8px 0;
  animation: ticker-run 18s linear infinite;
  font-size: 0.78rem;
  color: var(--gold-soft);
}

.ticker-track span {
  white-space: nowrap;
}

.ticker-rank {
  width: 1.15em;
  height: 1.15em;
  margin: 0 0.12em;
  object-fit: contain;
  vertical-align: -0.22em;
}

@keyframes ticker-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.home-block {
  margin-bottom: 16px;
}

.block-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-soft);
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.news-stage {
  background: transparent;
  overflow: visible;
}

.news-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1379 / 752;
}

.news-viewport {
  position: absolute;
  left: 5.15%;
  top: 7.45%;
  right: 4.21%;
  bottom: 7.31%;
  overflow: hidden;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  border-radius: 8px;
  background: #140e0a;
  touch-action: pan-y;
  cursor: grab;
  z-index: 1;
}

.news-frame-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 2;
  display: block;
}

.news-viewport:active {
  cursor: grabbing;
}

.news-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 450ms ease;
  will-change: transform;
}

.news-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 10px;
}

.dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.dots button.on {
  background: var(--gold);
  transform: scale(1.2);
}

.product-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.product-row.wide {
  grid-template-columns: 1fr 1fr;
}

.product-slot {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(18, 12, 8, 0.4);
}

.product-card {
  aspect-ratio: 3 / 4;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: 12px;
  background: rgba(25, 16, 10, 0.92);
  color: var(--cream);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: 1fr auto;
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.product-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px 8px;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  min-height: calc(1.25em * 2);
  color: #fff4d8;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.product-price {
  color: var(--gold-soft);
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.product-stock {
  min-width: 0;
  overflow: hidden;
  color: rgba(242, 230, 208, 0.68);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-icons {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  font-size: 0.72rem;
  line-height: 1;
}

.product-card:active {
  transform: scale(0.98);
}

.product-slot.tall {
  aspect-ratio: 4 / 5;
}

.promo-strip {
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.25);
  background: rgba(18, 12, 8, 0.45);
  display: grid;
  place-items: center;
  color: rgba(242, 230, 208, 0.5);
  font-size: 0.82rem;
}

/* ===== Bottom nav ===== */
/* พื้นหลังเมนูใช้ไฟล์ App_MenuBG.png ตามที่หั่นแล้ว — วางไอคอนปกติ */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 0 4px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  background: url("PIC/App_MenuBG.png") center bottom / 100% 100% no-repeat;
  isolation: isolate;
}

.app-powered {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 28px 0 8px;
  padding: 18px 12px 6px;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.app-powered-by {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(220px, 72%);
  color: rgba(242, 230, 208, 0.42);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-powered-by::before,
.app-powered-by::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.45), transparent);
}

.app-powered-brand {
  color: var(--gold-soft);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.app-powered-ver {
  color: rgba(242, 230, 208, 0.38);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.nav-smear {
  position: absolute;
  left: 0;
  bottom: var(--safe-bottom);
  width: 25%;
  height: 100%;
  max-height: var(--nav-h);
  border-radius: 10px 10px 0 0;
  background: rgba(0, 0, 0, 0.45);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
}

.nav-item {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: #fff8e7;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 2px 8px;
  min-height: 72px;
  font-family: inherit;
}

.nav-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin-top: -18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 200ms ease;
  transform: scale(1);
  pointer-events: none;
  user-select: none;
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.1;
  color: #fff8e7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.nav-item.active .nav-label {
  color: #fff6d8;
  font-weight: 700;
}

/* ===== Mail / messages pop-up ===== */
.mail-overlay {
  position: absolute;
  inset: 0;
  z-index: 125;
  display: block;
}

.mail-overlay[hidden] {
  display: none !important;
}

.mail-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  opacity: 1;
  transition: opacity 280ms ease;
}

.mail-overlay.is-closing .mail-backdrop {
  opacity: 0;
}

.mail-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  background: linear-gradient(
    180deg,
    rgba(36, 24, 16, 0.98),
    rgba(14, 10, 8, 0.98)
  );
  box-shadow: none;
  padding-bottom: calc(12px + var(--safe-bottom));
  transform: translateX(0);
  overflow: hidden;
}

.mail-overlay.is-opening .mail-sheet {
  animation: mail-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mail-overlay.is-dragging .mail-backdrop {
  transition: none;
}

.mail-overlay.is-dragging .mail-sheet,
.mail-overlay.is-closing-swipe .mail-sheet {
  animation: none;
}

.mail-overlay.is-dragging .mail-sheet {
  transition: none;
  will-change: transform;
}

.mail-overlay.is-closing .mail-sheet {
  animation: mail-sheet-out 260ms ease forwards;
}

.mail-overlay.is-closing-swipe.is-closing .mail-sheet {
  animation: none;
  transition: transform 260ms ease-in;
}

@keyframes mail-sheet-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes mail-sheet-out {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

.mail-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 4px;
  padding: 12px 10px 10px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.mail-back,
.mail-clear,
.pts-back,
.header-coupons-back,
.catalog-back,
.addr-back {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.65);
  color: #fff4d8;
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mail-back:active,
.mail-clear:active,
.pts-back:active,
.header-coupons-back:active,
.catalog-back:active,
.addr-back:active {
  transform: scale(0.96);
  background: rgba(12, 8, 6, 0.8);
}

.mail-title {
  margin: 0;
  color: #fff4d8;
  font-size: 1.02rem;
  font-weight: 800;
}

.mail-head-spacer {
  width: 40px;
  height: 40px;
}

.mail-clear {
  color: #fff4d8;
}

.mail-clear:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.mail-clear:disabled:active {
  transform: none;
  background: rgba(12, 8, 6, 0.65);
}

.mail-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.14);
}

.mail-toggle-label {
  color: #fff4d8;
  font-size: 0.92rem;
  font-weight: 700;
}

.mail-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.mail-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mail-switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(90, 70, 52, 0.85);
  border: 1px solid rgba(197, 160, 89, 0.35);
  transition: background 180ms ease;
}

.mail-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff4d8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease;
}

.mail-switch input:checked + .mail-switch-ui {
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.95), rgba(90, 28, 22, 0.95));
  border-color: rgba(197, 160, 89, 0.5);
}

.mail-switch input:checked + .mail-switch-ui::after {
  transform: translateX(20px);
}

.mail-body {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 8px 0 20px;
}

.mail-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 52%;
  padding: 40px 20px;
  color: rgba(197, 160, 89, 0.55);
}

.mail-empty[hidden] {
  display: none !important;
}

.mail-empty-icon {
  display: grid;
  place-items: center;
  opacity: 0.72;
}

.mail-empty-text {
  margin: 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.95rem;
  font-weight: 600;
}

.mail-list {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  display: grid;
  gap: 8px;
}

.mail-list > li {
  min-width: 0;
}

.mail-list[hidden] {
  display: none !important;
}

.mail-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(18, 12, 8, 0.55);
  color: inherit;
  text-align: left;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  content-visibility: auto;
  contain-intrinsic-size: auto 88px;
}

.mail-item:active {
  transform: scale(0.99);
  background: rgba(32, 20, 14, 0.78);
}

.mail-item.is-unread {
  border-color: rgba(197, 160, 89, 0.5);
  background: rgba(48, 28, 18, 0.78);
}

.mail-item-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background: radial-gradient(circle at 35% 28%, #4a3424, #120c08 72%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mail-item-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  mix-blend-mode: screen;
  pointer-events: none;
}

.mail-item.is-unread .mail-item-mark {
  box-shadow: 0 0 10px rgba(90, 255, 110, 0.16);
}

.mail-item.is-unread .mail-item-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c45a3a;
  border: 1.5px solid #1a120e;
}

.mail-item-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mail-item-title {
  color: #fff4d8;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-item-text {
  margin: 0;
  color: rgba(242, 230, 208, 0.68);
  font-size: 0.76rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-item-time {
  margin: 2px 0 0;
  color: rgba(242, 230, 208, 0.42);
  font-size: 0.7rem;
  font-weight: 600;
}

.mail-note {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 18px 16px calc(18px + var(--safe-bottom));
}

.mail-note[hidden] {
  display: none !important;
}

.mail-note-dim {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  opacity: 1;
}

.mail-note-card {
  position: relative;
  z-index: 1;
  width: min(100%, 340px);
  max-height: 82%;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background:
    linear-gradient(165deg, rgba(56, 36, 24, 0.98), rgba(16, 10, 8, 0.98));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 244, 216, 0.04) inset;
  animation: mail-note-in 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mail-note.is-closing .mail-note-card {
  animation: mail-note-out 200ms ease forwards;
}

.mail-note.is-closing .mail-note-dim {
  opacity: 0;
  transition: opacity 200ms ease;
}

@keyframes mail-note-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mail-note-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

.mail-note-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 50%;
  background: rgba(12, 8, 6, 0.62);
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mail-note-x:active {
  transform: scale(0.94);
  background: rgba(197, 160, 89, 0.22);
}

.mail-note-hero {
  margin: 0;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #120c08;
}

.mail-note-hero[hidden] {
  display: none !important;
}

.mail-note-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.mail-note-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 16px 16px 18px;
}

.mail-note-kicker {
  margin: 0;
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mail-note-title {
  margin: 0;
  color: #fff4d8;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.mail-note-text {
  margin: 0;
  color: rgba(242, 230, 208, 0.82);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-line;
}

.mail-note-date {
  margin: 2px 0 4px;
  color: rgba(242, 230, 208, 0.42);
  font-size: 0.72rem;
  font-weight: 600;
}

.mail-note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.mail-note-cta {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  width: auto;
  padding: 11px 14px;
  border: 1px solid rgba(197, 160, 89, 0.65);
  border-radius: 999px;
  background: linear-gradient(90deg, #8a6a2f, var(--gold-soft));
  color: #2a1a0c;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.mail-note-cta:active {
  transform: scale(0.98);
}

.mail-note-cta[hidden] {
  display: none !important;
}

.mail-note-trash {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.65);
  color: #fff4d8;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mail-note-trash:active {
  transform: scale(0.96);
  background: rgba(12, 8, 6, 0.8);
}

.mail-note-leaf {
  position: absolute;
  right: 8px;
  bottom: 52px;
  z-index: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: 0.22;
  pointer-events: none;
}

/* ===== Cart pop-up ===== */
.cart-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.cart-overlay[hidden] {
  display: none !important;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 1;
  transition: opacity 360ms ease;
}

.cart-overlay.is-closing .cart-backdrop {
  opacity: 0;
}

.cart-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  background: linear-gradient(
    180deg,
    rgba(28, 18, 12, 0.78),
    rgba(12, 8, 6, 0.72)
  );
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: none;
  padding-bottom: calc(12px + var(--safe-bottom));
  padding-top: env(safe-area-inset-top, 0px);
  transform: translateY(0);
  animation: none;
  touch-action: pan-y;
  overflow: hidden;
}

.cart-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cart-view-main {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.cart-view-map,
.cart-view-form,
.cart-view-list,
.cart-view-pay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  background: linear-gradient(
    180deg,
    rgba(28, 18, 12, 0.96),
    rgba(12, 8, 6, 0.98)
  );
  color: var(--cream);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 340ms;
  will-change: transform;
}

.addr-overlay {
  z-index: 130;
}

.addr-sheet {
  padding-bottom: 0;
}

.addr-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.addr-head-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.addr-head-brand .addr-title {
  text-align: center;
}

.addr-sheet[data-addr="list"] .cart-view-list,
.addr-sheet[data-addr="map"] .cart-view-list,
.addr-sheet[data-addr="map"] .cart-view-map,
.addr-sheet[data-addr="form"] .cart-view-list,
.addr-sheet[data-addr="form"] .cart-view-map,
.addr-sheet[data-addr="form"] .cart-view-form {
  visibility: visible;
  pointer-events: auto;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.addr-sheet[data-addr="list"] .cart-view-list {
  transform: translateX(0);
}

.addr-sheet[data-addr="map"] .cart-view-list {
  transform: translateX(-22%);
  pointer-events: none;
}

.addr-sheet[data-addr="map"] .cart-view-map {
  transform: translateX(0);
}

.addr-sheet[data-addr="form"] .cart-view-list {
  transform: translateX(-22%);
  pointer-events: none;
}

.addr-sheet[data-addr="form"] .cart-view-map {
  transform: translateX(-22%);
  pointer-events: none;
}

.addr-sheet[data-addr="form"] .cart-view-form {
  transform: translateX(0);
}

.addr-sheet.is-snap .cart-view-list,
.addr-sheet.is-snap .cart-view-map,
.addr-sheet.is-snap .cart-view-form {
  transition: none;
}

.cart-sheet[data-addr="pay"] .cart-view-pay {
  visibility: visible;
  pointer-events: auto;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  transform: translateX(0);
}

.cart-sheet[data-addr="list"] .cart-view-main,
.cart-sheet[data-addr="map"] .cart-view-main,
.cart-sheet[data-addr="form"] .cart-view-main,
.cart-sheet[data-addr="pay"] .cart-view-main {
  transform: translateX(-16%);
}

.addr-step-spacer {
  width: 40px;
  min-height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.addr-list-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.addr-add-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(197, 160, 89, 0.5);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.4);
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.addr-add-btn:active {
  transform: scale(0.99);
  background: rgba(197, 160, 89, 0.1);
}

.addr-add-btn:disabled,
.addr-add-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: rgba(242, 230, 208, 0.62);
  border-color: rgba(160, 160, 160, 0.35);
}

.addr-add-btn:disabled:active,
.addr-add-btn.is-disabled:active {
  transform: none;
  background: rgba(12, 8, 6, 0.4);
}

.addr-add-plus {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.addr-list-empty {
  margin: 18px 4px;
  text-align: center;
  color: rgba(242, 230, 208, 0.5);
  font-size: 0.86rem;
  font-weight: 500;
}

.addr-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 12px;
  background: rgba(18, 12, 8, 0.72);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.addr-card:active {
  border-color: rgba(197, 160, 89, 0.7);
  background: rgba(60, 36, 22, 0.72);
}

.addr-card-main {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
}

.addr-card-contact {
  margin: 0 0 4px;
  color: #fff4d8;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.addr-card-line {
  margin: 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.addr-card-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(220, 90, 80, 0.55);
  background: rgba(140, 36, 28, 0.35);
  color: #ffd2c8;
  font-size: 0.68rem;
  font-weight: 700;
}

.addr-card-badge.is-ghost {
  visibility: hidden;
}

.addr-card-edit {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  padding: 2px 0 0;
  border: none;
  background: transparent;
  color: #f0a090;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.addr-card-edit:active {
  opacity: 0.75;
}

.addr-card-delete {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(160, 160, 160, 0.28);
  border-radius: 8px;
  background: rgba(12, 8, 6, 0.45);
  color: rgba(170, 170, 170, 0.92);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.addr-card-delete:active {
  transform: scale(0.96);
  background: rgba(80, 80, 80, 0.35);
  color: rgba(200, 200, 200, 0.95);
}

.cart-overlay.is-opening .cart-sheet {
  animation: cart-slide-in 360ms ease-out;
}

.cart-overlay.is-dragging .cart-sheet {
  animation: none;
  transition: none;
  /* กันภาพซ้อนตอนลาก: ปิด blur + ทำให้พื้นทึบ */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, #1c120c 0%, #0c0806 100%);
}

.cart-overlay.is-dragging .cart-view-main,
.cart-overlay.is-dragging .cart-view-map,
.cart-overlay.is-dragging .cart-view-form,
.cart-overlay.is-dragging .cart-view-list,
.cart-overlay.is-dragging .cart-view-pay {
  transition: none !important;
  will-change: auto;
}

.cart-overlay.is-closing .cart-sheet {
  animation: none;
  transform: translateY(100%);
  transition: transform 360ms ease-in;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, #1c120c 0%, #0c0806 100%);
}

@keyframes cart-slide-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cart-sheet-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 12px;
  flex-shrink: 0;
}

.cart-head-spacer {
  width: 40px;
  height: 40px;
}

.cart-head-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.cart-title {
  margin: 0;
  color: var(--gold-soft);
  font-size: 1.12rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.cart-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.65);
  color: #fff4d8;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: grid;
  place-items: center;
}

.cart-close:active {
  transform: scale(0.96);
}

.cart-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 10px;
}

.cart-tab {
  padding: 9px 10px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.45);
  color: rgba(242, 230, 208, 0.78);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.cart-tab.is-on {
  border-color: rgba(197, 160, 89, 0.7);
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.72), rgba(40, 22, 14, 0.78));
  color: #fff4d8;
}

.cart-sheet-head,
.cart-tabs,
.cart-empty {
  touch-action: none;
}

.cart-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px 12px;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.cart-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  padding: 0;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(18, 12, 8, 0.72);
  overflow: hidden;
  height: 88px;
  max-height: 88px;
  content-visibility: auto;
  contain-intrinsic-size: 88px;
}

.cart-line-media {
  height: 88px;
  background: #1a120e;
  border-right: 1px solid rgba(197, 160, 89, 0.28);
}

.cart-line-img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.cart-line-body {
  min-width: 0;
  height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px 8px 7px 10px;
  gap: 2px;
}

.cart-line-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.cart-line-name {
  flex: 1;
  min-width: 0;
  color: #fff4d8;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-line-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.cart-line-ship {
  margin-top: 0;
  display: inline-flex;
}

.cart-line-ship .ship-pill {
  position: static;
  font-size: 0.62rem;
  padding: 2px 7px;
}

.cart-line-pack {
  margin-top: 0;
  color: rgba(242, 230, 208, 0.58);
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.cart-line-price {
  margin-top: 0;
  color: var(--gold-soft);
  font-family: "Cinzel", serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.cart-line-qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  padding-top: 0;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 6px;
  background: rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.qty-val {
  min-width: 1em;
  text-align: center;
  color: #fff4d8;
  font-weight: 700;
  font-size: 0.78rem;
}

.cart-line-remove {
  flex: 0 0 auto;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.55);
  color: rgba(242, 230, 208, 0.78);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 7px;
  line-height: 1.2;
}

.cart-empty {
  padding: 28px 12px;
  text-align: center;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.88rem;
}

.cart-foot {
  margin-top: 8px;
  padding: 14px 0 8px;
  border-top: 1px solid rgba(197, 160, 89, 0.22);
}

.cart-coupon {
  margin-bottom: 10px;
}

.cart-coupon-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.cart-coupon-input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  outline: none;
}

.cart-coupon-input::placeholder {
  color: rgba(242, 230, 208, 0.42);
  font-weight: 500;
  letter-spacing: 0;
}

.cart-coupon-input:focus {
  border-color: rgba(197, 160, 89, 0.7);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.18);
}

.cart-coupon-btn {
  padding: 10px 14px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.85), rgba(40, 22, 14, 0.9));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.cart-coupon-btn:active {
  transform: scale(0.98);
}

.cart-coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(120, 180, 110, 0.4);
  background: rgba(28, 48, 24, 0.45);
}

.cart-coupon-form[hidden],
.cart-coupon-applied[hidden],
.cart-coupon-msg[hidden],
.cart-sum-row[hidden] {
  display: none !important;
}

.cart-coupon-chip {
  color: #d8f0c8;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cart-coupon-clear {
  padding: 4px 10px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 999px;
  background: transparent;
  color: rgba(242, 230, 208, 0.78);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.cart-coupon-msg {
  margin: 6px 2px 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.cart-coupon-msg.is-ok {
  color: #b8e09a;
}

.cart-coupon-msg.is-err {
  color: #f0a090;
}

.cart-totals {
  margin-bottom: 10px;
}

.cart-order-block {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(197, 160, 89, 0.42);
}

.cart-order-block[hidden] {
  display: none !important;
}

.cart-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.8rem;
  font-weight: 500;
}

.cart-order-block .cart-sum-row:last-child {
  margin-bottom: 0;
}

.cart-sum-row.is-subtotal.is-struck #cartSubtotalValue {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: rgba(242, 230, 208, 0.42);
}

.cart-sum-row.is-subtotal-net {
  color: #b8e09a;
  font-weight: 700;
}

.cart-net-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  padding-right: 8px;
}

.cart-net-label em {
  font-style: normal;
  font-weight: 800;
  color: #d8f0c8;
}

.cart-sum-row.is-ship {
  align-items: center;
}

.cart-sum-row.is-rank-pct {
  color: #b8e09a;
  font-weight: 700;
  align-items: center;
}

.cart-rank-pct-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  padding-right: 8px;
}

.cart-rank-pct-label em {
  font-style: normal;
  font-weight: 800;
  color: #d8f0c8;
}

.cart-ship-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.25;
}

.cart-ship-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(220, 80, 70, 0.55);
  background: rgba(140, 36, 28, 0.72);
  color: #ffd2c8;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.cart-ship-badge[hidden] {
  display: none !important;
}

.cart-sum-row.is-ship.is-free .cart-ship-badge {
  border-color: rgba(120, 180, 110, 0.55);
  background: rgba(28, 56, 28, 0.72);
  color: #d8f0c8;
}

.cart-sum-row.is-ship.is-free #cartShipValue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #b8e09a;
  font-weight: 700;
}

.cart-sum-row.is-ship.is-free #cartShipValue::before {
  content: "✓";
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.cart-sum-row.is-ship.is-rider .cart-ship-badge {
  border-color: rgba(120, 180, 220, 0.55);
  background: rgba(28, 56, 80, 0.72);
  color: #d4eef8;
}

.cart-sum-row.is-ship.is-out .cart-ship-badge {
  border-color: rgba(220, 80, 70, 0.55);
  background: rgba(140, 36, 28, 0.72);
  color: #ffd2c8;
}

.cart-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(197, 160, 89, 0.45);
  color: rgba(242, 230, 208, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-sum strong {
  color: #fff4d8;
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
}

.cart-sum strong.is-flash {
  animation: cart-sum-flash 420ms ease;
}

@keyframes cart-sum-flash {
  0% { transform: scale(1); color: #fff4d8; }
  40% { transform: scale(1.06); color: #d8f0c8; }
  100% { transform: scale(1); color: #fff4d8; }
}

.cart-address {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 4px;
  border: none;
  border-top: 1px solid rgba(197, 160, 89, 0.38);
  border-bottom: 1px solid rgba(197, 160, 89, 0.38);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.cart-address:active {
  background: rgba(197, 160, 89, 0.08);
}

.cart-address-pin {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.cart-address-pin svg {
  display: block;
}

.cart-address-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-address-label {
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cart-address-value {
  color: #fff4d8;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cart-address-value:not(.is-empty) {
  min-height: calc(1.35em * 3);
}

.cart-address-value.is-empty {
  color: rgba(255, 210, 160, 0.92);
}

.cart-address-chevron {
  color: rgba(197, 160, 89, 0.85);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  margin-top: 6px;
  padding-right: 2px;
}

/* ===== Address panels inside cart (ธีมตะกร้า) ===== */
.addr-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  flex-shrink: 0;
  background: transparent;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.addr-back {
  width: 40px;
  height: 40px;
}

.addr-title {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-soft);
}

.addr-step {
  justify-self: end;
  min-width: 40px;
  text-align: right;
  color: rgba(216, 185, 120, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
  padding-right: 2px;
  letter-spacing: 0.04em;
}

.addr-search-wrap {
  position: relative;
  z-index: 6;
  padding: 10px 14px 0;
  flex-shrink: 0;
}

.addr-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.65);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.addr-search-pin {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.addr-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff4d8;
}

.addr-search input::placeholder {
  color: rgba(242, 230, 208, 0.42);
}

.addr-search-results {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(100% + 6px);
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(22, 14, 10, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.addr-search-results[hidden] {
  display: none !important;
}

.addr-search-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid rgba(197, 160, 89, 0.14);
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(242, 230, 208, 0.9);
  cursor: pointer;
}

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

.addr-search-item:active {
  background: rgba(197, 160, 89, 0.14);
}

.addr-map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 10px 10px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: #1a120e;
}

.addr-map {
  width: 100%;
  height: 100%;
  z-index: 0;
}

.addr-map-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, calc(-100% + 8px));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

.addr-map-bubble {
  margin-bottom: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: linear-gradient(160deg, rgba(110, 36, 28, 0.95), rgba(56, 22, 16, 0.96));
  color: #fff4d8;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
}

.addr-map-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(72, 26, 18, 0.98);
  border-bottom-width: 0;
}

.addr-map-pin {
  width: 28px;
  height: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 36'%3E%3Cpath fill='%23e53935' d='M12 0C5.4 0 0 5.4 0 12c0 9 12 24 12 24s12-15 12-24C24 5.4 18.6 0 12 0z'/%3E%3Ccircle cx='12' cy='12' r='5' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}

.addr-map-stage.is-moving .addr-map-center {
  transform: translate(-50%, calc(-100% - 4px));
  transition: transform 120ms ease;
}

.addr-locate {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: 50%;
  background: rgba(18, 12, 8, 0.88);
  color: var(--gold-soft);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.addr-locate:active {
  transform: scale(0.96);
}

.addr-map-foot {
  flex-shrink: 0;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  background: transparent;
  border-top: 1px solid rgba(197, 160, 89, 0.22);
  box-shadow: none;
}

.addr-picked {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.addr-picked-pin {
  margin-top: 2px;
  flex-shrink: 0;
}

.addr-picked-text {
  flex: 1;
  min-width: 0;
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.addr-use-btn {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.92), rgba(90, 28, 22, 0.92));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.addr-use-btn:active {
  transform: scale(0.99);
}

.addr-use-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.addr-form-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px 8px;
  -webkit-overflow-scrolling: touch;
}

.addr-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.18);
  min-width: 0;
  max-width: 100%;
}

.addr-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.addr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.addr-section-title {
  margin: 0;
  color: #fff4d8;
  font-size: 0.92rem;
  font-weight: 700;
}

.addr-edit-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.45);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.addr-edit-btn:active {
  transform: scale(0.96);
}

.addr-contact-view {
  display: grid;
  gap: 4px;
}

.addr-contact-line {
  margin: 0;
  color: rgba(242, 230, 208, 0.9);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.addr-contact-line.is-muted {
  color: rgba(242, 230, 208, 0.55);
  font-weight: 500;
}

.addr-contact-edit[hidden],
.addr-contact-view[hidden] {
  display: none !important;
}

.addr-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.addr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  min-width: 0;
  max-width: 100%;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(216, 185, 120, 0.78);
}

.addr-field em {
  font-style: normal;
  color: #f0a090;
}

.addr-field input,
.addr-field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  resize: vertical;
}

.addr-field textarea {
  min-height: 64px;
  line-height: 1.35;
}

.addr-field input::placeholder,
.addr-field textarea::placeholder {
  color: rgba(242, 230, 208, 0.38);
}

.addr-field input:focus,
.addr-field textarea:focus {
  border-color: rgba(197, 160, 89, 0.7);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.18);
}

.addr-field input.is-error,
.addr-field textarea.is-error {
  border-color: rgba(220, 90, 80, 0.75);
}

.addr-field-error {
  color: #f0a090;
  font-size: 0.72rem;
  font-weight: 600;
}

.addr-field-error[hidden] {
  display: none !important;
}

.addr-extra-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.addr-extra-chevron {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(12, 8, 6, 0.45);
  color: var(--gold-soft);
  transition: transform 260ms ease, background 160ms ease;
}

.addr-extra-chevron svg {
  display: block;
}

.addr-extra.is-open .addr-extra-chevron {
  transform: rotate(180deg);
  background: rgba(197, 160, 89, 0.14);
}

.addr-extra-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 320ms ease, opacity 220ms ease, margin 220ms ease;
  margin-top: 0;
}

.addr-extra.is-open .addr-extra-panel {
  max-height: 420px;
  opacity: 1;
  margin-top: 12px;
  pointer-events: auto;
}

.addr-default-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  color: rgba(242, 230, 208, 0.88);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.addr-default-check {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid rgba(197, 160, 89, 0.55);
  border-radius: 6px;
  background: rgba(12, 8, 6, 0.55);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.addr-default-check:checked {
  border-color: rgba(197, 160, 89, 0.85);
  background: linear-gradient(160deg, rgba(140, 42, 32, 0.95), rgba(90, 28, 22, 0.95));
}

.addr-default-check:checked::after {
  content: "✓";
  color: #fff4d8;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.addr-default-check:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.addr-default-row.is-locked {
  color: rgba(242, 230, 208, 0.42);
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.72;
}

.addr-default-row.is-locked .addr-default-check {
  border-color: rgba(160, 160, 160, 0.45);
  background: rgba(90, 90, 90, 0.45);
  box-shadow: none;
}

.addr-default-row.is-locked .addr-default-check:checked {
  border-color: rgba(150, 150, 150, 0.55);
  background: linear-gradient(160deg, rgba(110, 110, 110, 0.85), rgba(70, 70, 70, 0.9));
}

.addr-default-row.is-locked .addr-default-check:checked::after {
  color: rgba(230, 230, 230, 0.75);
}

.addr-default-row.is-locked span {
  position: relative;
}

.cart-view-form .addr-map-foot {
  margin-top: auto;
}

.pay-mock-tag {
  min-width: 40px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.pay-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px 8px;
  -webkit-overflow-scrolling: touch;
}

.pay-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(140, 42, 32, 0.22);
  color: #ffd2c8;
  font-size: 0.78rem;
  line-height: 1.45;
}

.pay-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.pay-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(242, 230, 208, 0.7);
  font-size: 0.8rem;
}

.pay-meta-row strong {
  color: #fff4d8;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.pay-qr-card {
  display: grid;
  place-items: center;
  padding: 16px 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(255, 248, 236, 0.96);
}

.pay-qr-card canvas,
.pay-qr-card img {
  width: 220px;
  height: 220px;
  border-radius: 8px;
}

.pay-qr-card img.pay-qr-saveable {
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-user-drag: auto;
  user-drag: auto;
  pointer-events: auto;
  touch-action: auto;
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.35);
}

.pay-qr-card img.is-priced {
  height: auto;
  background: #fff8ec;
}

.pay-qr-card:has(img.is-priced) .pay-amount {
  display: none;
}

.pay-amount {
  margin: 10px 0 0;
  color: #1a120c;
  font-size: 1.35rem;
  font-weight: 800;
}

.pay-qr-note {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(72, 64, 56, 0.4);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(96, 88, 80, 0.78), rgba(64, 58, 52, 0.82));
  color: rgba(255, 244, 216, 0.52);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

.pay-qr-save {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(90, 28, 22, 0.45);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.92), rgba(90, 28, 22, 0.92));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.pay-qr-save:active {
  transform: scale(0.98);
}

.pay-qr-save-msg {
  margin: 8px 0 0;
  color: rgba(26, 18, 12, 0.7);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
}

.pay-pp {
  margin: 4px 0 0;
  color: rgba(26, 18, 12, 0.62);
  font-size: 0.78rem;
  font-weight: 600;
}

.pay-hint {
  margin: 12px 0 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.pay-slip-block {
  margin-top: 16px;
}

.pay-slip-label {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.pay-slip-drop {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 4px 8px;
  padding: 12px;
  border: 1px dashed rgba(197, 160, 89, 0.5);
  border-radius: 12px;
  background: rgba(12, 8, 6, 0.4);
  color: var(--gold-soft);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.pay-slip-drop:active {
  transform: scale(0.99);
  background: rgba(197, 160, 89, 0.1);
}

.pay-slip-drop.has-file {
  border-style: solid;
  border-color: rgba(197, 160, 89, 0.55);
  background: rgba(18, 12, 8, 0.72);
}

.pay-slip-icon,
.pay-slip-preview {
  grid-column: 1;
  justify-self: center;
}

.pay-slip-preview {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(0, 0, 0, 0.35) center / cover no-repeat;
}

.pay-slip-copy {
  grid-column: 2;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pay-slip-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--gold-soft);
  opacity: 0.9;
}

.pay-slip-icon svg {
  width: 64px;
  height: 64px;
  display: block;
}

.pay-slip-drop.has-file .pay-slip-icon {
  display: none;
}

.pay-slip-title {
  color: #fff4d8;
  font-size: 0.88rem;
  font-weight: 700;
}

.pay-slip-sub {
  color: rgba(242, 230, 208, 0.58);
  font-size: 0.74rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-slip-msg {
  margin: 8px 0 0;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.78rem;
  line-height: 1.4;
}

.pay-slip-msg.is-ok {
  color: #c8e6c0;
}

.pay-slip-msg.is-warn {
  color: #ffd2c8;
}

.cart-view-pay .addr-map-foot {
  margin-top: auto;
}

.cart-checkout {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.92), rgba(90, 28, 22, 0.92));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.cart-checkout:active {
  transform: scale(0.99);
}

body.cart-open {
  overflow: hidden;
}

/* ===== Coupons pages ===== */
.cp-member-card {
  --leaf-top: 8px;
  --leaf-right: 22px;
  --leaf-size: 72px;
  position: relative;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(197, 160, 89, 0.38);
  background: linear-gradient(160deg, rgba(48, 32, 22, 0.94), rgba(18, 12, 8, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.cp-member-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding-right: 78px;
}

.cp-member-who {
  min-width: 0;
}

.cp-member-leaf {
  position: absolute;
  top: var(--leaf-top);
  right: var(--leaf-right);
  width: var(--leaf-size);
  height: var(--leaf-size);
  object-fit: contain;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(90, 255, 110, 0.48));
}

.cp-member-no {
  position: absolute;
  top: calc(var(--leaf-top) + var(--leaf-size));
  right: var(--leaf-right);
  width: var(--leaf-size);
  margin: 0;
  color: rgba(255, 244, 216, 0.88);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

#acctMemberNo {
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.cp-member-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 216, 0.85);
  background:
    radial-gradient(circle at 35% 30%, #6b5344, #2a1c14 70%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cp-member-name {
  margin: 0 0 4px;
  color: #fff4d8;
  font-size: 0.98rem;
  font-weight: 700;
}

.cp-member-points {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(242, 230, 208, 0.78);
  font-size: 0.82rem;
  font-weight: 600;
}

.cp-member-points strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.cp-member-v {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #f0d48a, #b8862e 70%);
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.58rem;
  font-weight: 700;
  color: #3a2410;
  flex-shrink: 0;
}

.cp-member-info {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 244, 216, 0.82);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cp-member-info svg {
  display: block;
}

.cp-member-info:active {
  transform: scale(0.92);
  background: rgba(197, 160, 89, 0.28);
}

/* ===== เงื่อนไขแต้ม V — bottom sheet ===== */
.pts-overlay {
  position: absolute;
  inset: 0;
  z-index: 126;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pts-overlay[hidden] {
  display: none !important;
}

.pts-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  opacity: 1;
  transition: opacity 280ms ease;
}

.pts-overlay.is-closing .pts-backdrop {
  opacity: 0;
}

.pts-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  background: linear-gradient(
    180deg,
    rgba(36, 24, 16, 0.98),
    rgba(14, 10, 8, 0.98)
  );
  box-shadow: none;
  padding-bottom: calc(12px + var(--safe-bottom));
  transform: translateY(0);
  animation: pts-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.pts-overlay.is-closing .pts-sheet {
  animation: pts-sheet-out 260ms ease forwards;
}

@keyframes pts-sheet-in {
  from { transform: translateY(108%); }
  to { transform: translateY(0); }
}

@keyframes pts-sheet-out {
  from { transform: translateY(0); }
  to { transform: translateY(108%); }
}

.pts-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 4px;
  padding: 12px 10px 10px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.pts-back {
  width: 40px;
  height: 40px;
}

.pts-head-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.menu-logo {
  height: 46px;
  width: auto;
  max-width: 54px;
  object-fit: contain;
  mix-blend-mode: screen;
  flex-shrink: 0;
  pointer-events: none;
}

.pts-head-v {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #f0d48a, #b8862e 70%);
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #3a2410;
}

.pts-title {
  margin: 0;
  color: #fff4d8;
  font-size: 1.02rem;
  font-weight: 800;
}

.pts-head-spacer {
  width: 40px;
  height: 40px;
}

.pts-body {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior-y: auto;
  padding: 16px 18px 24px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.pts-body-inner {
  min-height: calc(100% + 1px);
}

.pts-block {
  margin: 0 0 18px;
}

.pts-block:last-child {
  margin-bottom: 0;
}

.pts-block h3 {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

.pts-block p {
  margin: 0;
  color: rgba(242, 230, 208, 0.78);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ===== Slide-from-right sheets ===== */
.side-overlay {
  position: absolute;
  inset: 0;
  z-index: 128;
  display: block;
}

.side-overlay[hidden] {
  display: none !important;
}

.side-sheet {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(36, 24, 16, 0.98),
    rgba(14, 10, 8, 0.98)
  );
  transform: translateX(0);
  overflow: hidden;
  padding-bottom: calc(12px + var(--safe-bottom));
}

.side-overlay.is-opening .side-sheet {
  animation: side-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.side-overlay.is-dragging .side-sheet,
.side-overlay.is-closing-swipe .side-sheet {
  animation: none;
}

.side-overlay.is-dragging .side-sheet {
  transition: none;
  will-change: transform;
}

.side-overlay.is-closing .side-sheet {
  animation: side-sheet-out 260ms ease forwards;
}

.side-overlay.is-closing-swipe.is-closing .side-sheet {
  animation: none;
  transition: transform 260ms ease-in;
}

@keyframes side-sheet-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes side-sheet-out {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

.hx-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex-shrink: 0;
  margin: 0;
  padding: 0 8px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.hx-tab {
  padding: 10px 4px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(242, 230, 208, 0.55);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.hx-tab.is-on {
  color: #fff4d8;
  border-bottom-color: #b33a2b;
}

.hx-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 14px 4px;
}

.hx-select-wrap {
  position: relative;
  display: block;
}

.hx-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 28px 8px 12px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d8b978' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 10px center / 10px no-repeat,
    rgba(12, 8, 6, 0.55);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color-scheme: dark;
}

.hx-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(197, 160, 89, 0.18);
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}

.hx-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a120c;
  border: 1px solid rgba(197, 160, 89, 0.28);
}

.hx-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
}

.hx-name {
  margin: 0;
  color: #fff4d8;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.3;
}

.hx-meta,
.hx-status {
  margin: 0;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.72rem;
}

.hx-pts {
  margin: 0;
  color: #e0b15a;
  font-size: 0.74rem;
  font-weight: 800;
}

.perk-now {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  background: linear-gradient(160deg, rgba(90, 50, 24, 0.55), rgba(22, 14, 10, 0.9));
}

.perk-now-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 215, 160, 0.75);
  background: rgba(197, 160, 89, 0.22);
  color: #f0d7a0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.perk-now-name {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perk-now-copy {
  margin: 0;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-line;
}

.perk-tier {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(18, 12, 8, 0.72);
}

.perk-tier.is-current {
  border: 2px solid #f0d7a0;
  background: linear-gradient(165deg, rgba(120, 78, 36, 0.62), rgba(28, 18, 12, 0.94));
  box-shadow:
    0 0 0 1px rgba(240, 215, 160, 0.45),
    0 0 22px rgba(197, 160, 89, 0.42);
}

.perk-tier.is-locked {
  opacity: 0.55;
}

.perk-tier h3 {
  margin: 0 0 8px;
  color: #fff4d8;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.perk-tier h3 .perk-you {
  display: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: rgba(197, 160, 89, 0.16);
  color: var(--gold-soft);
  font-size: 0.62rem;
  font-weight: 800;
}

.perk-tier.is-current h3 .perk-you {
  display: inline-flex;
  align-items: center;
}

.perk-tier h3 .perk-exp {
  margin-left: auto;
  color: rgba(242, 230, 208, 0.52);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.perk-rank-ico {
  width: 1.7em;
  height: 1.7em;
  object-fit: contain;
  flex: 0 0 auto;
}

.perk-now-name .perk-rank-ico {
  width: 2em;
  height: 2em;
}

.perk-tier ul {
  margin: 0;
  padding-left: 1.1em;
  color: rgba(242, 230, 208, 0.78);
  font-size: 0.8rem;
  line-height: 1.55;
}

.perk-tier li {
  margin: 4px 0;
}

.perk-ico {
  display: inline-block;
  vertical-align: -0.28em;
  margin-left: 0.22em;
  object-fit: contain;
}

.perk-ico-coupon,
.perk-ico-box {
  height: 1.2em;
  width: auto;
}

.perk-ico-fire {
  height: 1.45em;
  width: auto;
}

.perk-ico-new,
.perk-ico-up {
  height: 0.95em;
  width: auto;
  margin-left: 0.28em;
}

.perk-empty {
  margin: 0;
  color: rgba(242, 230, 208, 0.48);
  font-size: 0.78rem;
  line-height: 1.45;
}

.perk-soon {
  margin: 0 0 8px;
  color: rgba(231, 201, 138, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
}

.perk-tier.is-soon ul,
.perk-tier.is-soon .perk-empty {
  opacity: 0.55;
}

.perk-foot {
  margin: 10px 4px 2px;
  text-align: center;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.74rem;
  line-height: 1.45;
}

.cp-member-tier {
  margin-top: 14px;
}

.cp-member-level {
  margin: 0 0 4px;
  padding-right: 86px;
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-member-admin-tools {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.cp-member-admin-tools[hidden] {
  display: none;
}

.staff-mode-btn,
.dev-reset-exp {
  padding: 3px 10px;
  border-radius: 99px;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.staff-mode-btn {
  border: 1px dashed rgba(180, 220, 255, 0.65);
  background: rgba(24, 48, 72, 0.45);
  color: #d8ecff;
}

.staff-mode-btn.is-on {
  border-style: solid;
  border-color: rgba(140, 220, 160, 0.85);
  background: rgba(24, 72, 40, 0.55);
  color: #d8ffe4;
}

.staff-mode-btn:active,
.dev-reset-exp:active {
  transform: scale(0.96);
}

/* DEV ONLY: ปุ่มรีเซ็ตเวลสำหรับเทส ลบบล็อกนี้ได้เลยตอนขึ้นจริง */
.dev-reset-exp {
  border: 1px dashed rgba(255, 120, 120, 0.75);
  background: rgba(120, 20, 20, 0.35);
  color: #ffd9d9;
}

.cp-member-rank-ico {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  flex: 0 0 auto;
}

.cp-member-hint {
  margin: 0 0 8px;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.74rem;
  line-height: 1.4;
}

.cp-member-tier.is-rank-off .cp-member-level {
  color: rgba(210, 210, 210, 0.7);
}

.cp-member-tier.is-rank-off .cp-member-hint {
  color: rgba(210, 210, 210, 0.55);
}

.cp-member-tier.is-rank-off .cp-member-bar {
  border-color: rgba(168, 168, 168, 0.42);
  background: rgba(72, 72, 72, 0.72);
  box-shadow: none;
  filter: none;
  opacity: 1;
}

.cp-member-tier.is-rank-off .cp-member-fill {
  width: 0 !important;
  background: rgba(140, 140, 140, 0.45);
}

.cp-member-tier.is-rank-off .cp-member-exp-frac,
.cp-member-tier.is-rank-off .cp-member-exp-pct {
  color: rgba(200, 200, 200, 0.42);
  text-shadow: none;
}

.cp-member-bar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 22px;
  border-radius: 99px;
  border: 1px solid rgba(197, 160, 89, 0.55);
  background: rgba(18, 12, 8, 0.55);
  box-shadow:
    inset 0 1px 2px rgba(255, 244, 216, 0.18),
    inset 0 -1px 3px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.cp-member-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      180deg,
      rgba(255, 244, 216, 0.38) 0%,
      rgba(255, 244, 216, 0.05) 42%,
      rgba(0, 0, 0, 0.22) 100%
    ),
    linear-gradient(90deg, #8a6a2f, var(--gold-soft));
}

.cp-member-exp {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-member-exp-frac {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff4d8;
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.cp-member-exp-pct {
  flex-shrink: 0;
  min-width: 2.7em;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cp-member-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.cp-member-btn {
  padding: 9px 10px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.35);
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.cp-member-btn:active {
  background: rgba(197, 160, 89, 0.14);
}

.cp-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 4px 0 14px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.cp-tab {
  padding: 10px 8px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(242, 230, 208, 0.55);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.cp-tab.is-on {
  color: #fff4d8;
  border-bottom-color: #b33a2b;
}

.cp-card-list {
  display: grid;
  gap: 16px;
}

.cp-offer {
  display: grid;
  grid-template-rows: auto auto;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}

.cp-offer:active {
  transform: scale(0.99);
}

.cp-offer-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background: #1a120c;
  overflow: hidden;
  box-sizing: border-box;
}

.cp-offer-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cp-offer-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px 7px;
  background: linear-gradient(180deg, transparent, rgba(10, 6, 4, 0.78));
  color: rgba(255, 244, 216, 0.88);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

.cp-offer-stock {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(10, 6, 4, 0.82);
  border: 1px solid rgba(255, 244, 216, 0.35);
  color: #ffe8b8;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.cp-offer-stock.is-out {
  background: rgba(60, 18, 14, 0.92);
  color: rgba(255, 210, 200, 0.88);
}

.cp-offer.is-sold-out {
  opacity: 0.72;
}

.cp-offer.is-sold-out .cp-offer-media img {
  filter: grayscale(0.35) brightness(0.88);
}

.cpd-stock-line {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0c98a;
}

.cpd-stock-line.is-out {
  color: #e8a090;
}

.cpd-staff-refill {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(240, 201, 138, 0.45);
  background: rgba(20, 10, 8, 0.55);
}

.cpd-staff-refill-label {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 232, 184, 0.85);
}

.cpd-staff-refill-meta {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: rgba(255, 244, 216, 0.9);
}

.cpd-staff-refill-actions {
  display: flex;
  gap: 8px;
}

.cpd-staff-refill-btn {
  flex: 1;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 232, 184, 0.35);
  background: rgba(120, 48, 32, 0.55);
  color: #fff0d0;
  font-size: 0.76rem;
  font-weight: 700;
}

.cpd-staff-refill-btn:active {
  transform: scale(0.98);
}

.cpd-staff-refill-btn.is-minus {
  border-color: rgba(255, 180, 160, 0.45);
  background: rgba(72, 28, 24, 0.62);
  color: #ffd8cf;
}

.cp-offer-price {
  position: absolute;
  left: 10px;
  top: 10px;
  min-width: 64px;
  padding: 8px 7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 216, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(170, 48, 36, 0.98), rgba(90, 22, 16, 0.98));
  color: #fff4d8;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.cp-offer-price strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
}

.cp-offer-price span {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 600;
  text-decoration: line-through;
  opacity: 0.75;
}

.cp-offer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 2px 0;
}

.cp-offer-name {
  min-width: 0;
  flex: 1;
  margin: 0;
  color: #fff4d8;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-offer-pts {
  flex-shrink: 0;
  color: #e0b15a;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.cp-empty {
  margin: 0;
  padding: 18px 12px;
  border: 1px dashed rgba(197, 160, 89, 0.28);
  border-radius: 14px;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.82rem;
  text-align: center;
}

/* My coupons */
.mycp-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  flex-shrink: 0;
  margin: 0;
  padding: 0 8px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.mycp-tab {
  padding: 10px 4px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(242, 230, 208, 0.55);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.mycp-tab.is-on {
  color: #fff4d8;
  border-bottom-color: #b33a2b;
}

.mycp-list {
  display: grid;
  gap: 10px;
}

.mycp-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(18, 12, 8, 0.72);
  content-visibility: auto;
  contain-intrinsic-size: auto 112px;
}

.mycp-thumb {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  background: #1a120c;
}

.mycp-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
}

.mycp-title {
  margin: 0;
  color: #fff4d8;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.3;
}

.mycp-meta {
  margin: 0;
  color: rgba(242, 230, 208, 0.55);
  font-size: 0.72rem;
}

.mycp-pts {
  margin: 0;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.74rem;
  font-weight: 600;
}

.mycp-code-btn {
  margin-top: 6px;
  justify-self: start;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.95), rgba(90, 28, 22, 0.95));
  color: #fff4d8;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.mycp-code-btn:active {
  transform: scale(0.97);
}

.mycp-code-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mycp-media {
  position: relative;
  width: 92px;
  height: 92px;
}

.mycp-item.is-used,
.mycp-item.is-expired {
  opacity: 0.72;
  filter: saturate(0.7);
}

.mycp-stamp {
  position: absolute;
  right: -6px;
  top: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(197, 160, 89, 0.7);
  border-radius: 6px;
  background: rgba(18, 10, 8, 0.82);
  color: #e7c98a;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transform: rotate(12deg);
}

.mycp-new-tag {
  position: absolute;
  left: -4px;
  top: -4px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(90, 200, 110, 0.55);
  background: linear-gradient(160deg, rgba(46, 120, 58, 0.95), rgba(22, 70, 32, 0.95));
  color: #d8ffe0;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.mycp-item.is-new {
  border-color: rgba(90, 200, 110, 0.42);
}

.mycp-item.is-expired .mycp-stamp {
  color: rgba(242, 230, 208, 0.7);
  border-color: rgba(242, 230, 208, 0.28);
}

.coupon-code-card {
  text-align: center;
}

.coupon-code-kicker {
  margin: 0 0 4px;
  color: rgba(231, 201, 138, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.coupon-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 8px;
}

.coupon-code-value {
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #f3e2b6;
}

.coupon-code-copy {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.65);
  color: var(--gold, #c5a059);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.coupon-code-copy:active {
  transform: scale(0.96);
}

.coupon-code-hint {
  margin: 0 0 8px;
  color: #c5a059;
  font-size: 0.78rem;
  font-weight: 700;
}

.cp-offer-price.is-exp,
.cpd-price-badge.is-exp {
  background: radial-gradient(circle at 35% 30%, rgba(214, 168, 72, 0.98), rgba(92, 56, 16, 0.98));
}

.cp-offer-price.is-exp strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.cpd-price-badge.is-exp strong {
  font-size: 0.92rem;
}

.mycp-code-btn.is-use {
  background: linear-gradient(90deg, rgba(186, 138, 52, 0.96), rgba(118, 72, 22, 0.96));
  color: #fff6dc;
}

.coupon-use-overlay {
  z-index: 146;
}

.coupon-use-card {
  width: min(100%, 328px);
  text-align: center;
  padding: 20px 16px 16px;
  animation: coupon-use-in 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes coupon-use-in {
  from {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.coupon-use-kicker {
  margin: 0 0 10px;
  color: rgba(231, 201, 138, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.coupon-use-art {
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background:
    radial-gradient(circle at 50% 20%, rgba(210, 90, 36, 0.28), transparent 62%),
    rgba(12, 8, 6, 0.72);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.coupon-use-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.coupon-use-card .app-alert-title {
  margin-bottom: 12px;
}

.coupon-use-reward {
  margin: 0 0 10px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 160, 89, 0.26), rgba(18, 10, 8, 0.55));
}

.coupon-use-reward-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(242, 230, 208, 0.7);
  font-size: 0.74rem;
  font-weight: 700;
}

.coupon-use-reward-value {
  display: block;
  color: #f3e2b6;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-shadow: 0 0 18px rgba(197, 160, 89, 0.35);
}

.coupon-use-hint {
  min-height: 1.25em;
  margin: 0 0 14px;
  color: rgba(242, 230, 208, 0.64);
  font-size: 0.78rem;
  line-height: 1.45;
}

.coupon-use-actions {
  align-items: stretch;
}

.coupon-use-actions .app-alert-ok,
.coupon-use-actions .app-alert-cancel {
  width: 100%;
  min-width: 0;
}

.coupon-use-done-gain {
  margin: 4px 0 8px;
  color: #f3e2b6;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 22px rgba(197, 160, 89, 0.4);
}

.coupon-use-done-card .app-alert-ok {
  width: 100%;
}

/* Coupon detail */
html[data-page="coupon-detail"] .app-main {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 28px);
}

.cpd-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.3);
  background: #1a120c;
  aspect-ratio: 16 / 11;
}

.cpd-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cpd-price-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  min-width: 78px;
  padding: 11px 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 216, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(170, 48, 36, 0.98), rgba(90, 22, 16, 0.98));
  color: #fff4d8;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.cpd-price-badge strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
}

.cpd-caption {
  margin: 10px 2px 0;
  color: rgba(242, 230, 208, 0.62);
  font-size: 0.78rem;
}

.cpd-title {
  margin: 8px 2px 14px;
  color: #fff4d8;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
}

.cpd-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(197, 160, 89, 0.22);
  margin-bottom: 12px;
}

.cpd-tab {
  padding: 10px 8px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(242, 230, 208, 0.55);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.cpd-tab.is-on {
  color: #fff4d8;
  border-bottom-color: #b33a2b;
}

.cpd-panel {
  color: rgba(242, 230, 208, 0.82);
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 0 2px 12px;
}

.cpd-panels {
  display: grid;
}

.cpd-panels > .cpd-panel {
  grid-area: 1 / 1;
}

.cpd-panel:not(.is-on) {
  visibility: hidden;
  pointer-events: none;
}

.cpd-panel ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
}

.cpd-panel li {
  margin: 4px 0;
}

.cpd-foot {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 8px;
  padding: 0 0 4px;
  pointer-events: none;
}

html[data-page="coupon-detail"] .cpd-foot {
  pointer-events: auto;
}

html:not([data-page="coupon-detail"]) .cpd-foot {
  display: none;
}

.cpd-claim {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(90, 28, 22, 0.5);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(140, 42, 32, 0.96), rgba(90, 28, 22, 0.96));
  color: #fff4d8;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.cpd-claim:active {
  transform: scale(0.985);
}

.cpd-claim:disabled {
  opacity: 0.55;
  cursor: default;
}

.auth-gate {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top, rgba(42, 27, 18, 0.96), #0a0705 72%);
}

.auth-gate[hidden] {
  display: none !important;
}

html.auth-pending .app-header-stage,
html.auth-pending .app-main,
html.auth-pending .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-card {
  width: min(360px, 100%);
  text-align: center;
}

.auth-gate-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 12px;
}

.auth-gate-title {
  margin: 0 0 8px;
  font-family: Cinzel, serif;
  font-size: 1.45rem;
  color: var(--gold-soft);
}

.auth-gate-copy {
  margin: 0 0 22px;
  color: var(--cream);
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.9;
}

.auth-line-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  background: #06c755;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.auth-line-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-gate-status {
  margin: 14px 0 0;
  color: var(--gold-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.news-article {
  padding: 4px 4px 24px;
}

.news-viewport {
  cursor: pointer;
}

.news-article-img {
  display: block;
  width: 100%;
  border-radius: 14px;
  aspect-ratio: 1424 / 752;
  object-fit: cover;
  margin-bottom: 16px;
  border: 1px solid rgba(197, 160, 89, 0.25);
}

.news-article-title {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 1.15rem;
  line-height: 1.35;
}

.news-article-body {
  margin: 0 0 18px;
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.news-article-em {
  color: #ffe8b8;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(197, 160, 89, 0.72);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.news-article-note {
  color: var(--gold-soft);
  font-weight: 600;
}

.news-article-h {
  display: block;
  margin: 0 0 2px;
  color: var(--gold-soft);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.news-article-list {
  display: block;
  white-space: normal;
  margin: 0 0 8px;
}

.news-article-li {
  display: block;
  position: relative;
  padding: 3px 0 3px 1.15em;
  line-height: 1.55;
}

.news-article-li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.42em;
  color: var(--gold);
  font-size: 0.55em;
}

.news-article-foot {
  display: block;
  color: rgba(242, 230, 208, 0.72);
  font-size: 0.88rem;
}

.news-age-badge {
  display: inline-block;
  height: 2.03em;
  width: auto;
  vertical-align: middle;
  margin: 0 0.18em;
}

.news-article-sign-wrap {
  display: block;
  margin-top: 0.15em;
  text-align: right;
}

.news-article-sign-plain {
  display: block;
  margin: 0;
  line-height: 1.25;
  color: inherit;
  font-weight: inherit;
}

.news-article-sign {
  display: block;
  margin: 0;
  line-height: 1.25;
  color: var(--gold-soft);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.news-article-cta {
  width: 100%;
  border: 1px solid rgba(197, 160, 89, 0.55);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(197, 160, 89, 0.16);
  color: var(--gold-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.news-slide {
  border: 0;
  padding: 0;
  background: none;
  pointer-events: auto;
}

button.news-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

.cp-member-avatar.has-photo,
.avatar.has-photo {
  background-size: cover;
  background-position: center;
}

/* Desktop preview frame */
@media (min-width: 500px) {
  body {
    display: grid;
    place-items: center;
    padding: 20px 0;
    background:
      radial-gradient(circle at top, #2a1b12, #0a0705 70%);
  }

  .app {
    height: min(920px, calc(100dvh - 40px));
    border-radius: 28px;
    overflow: hidden;
  }
}
