/*
 * Mode Fashion Shop — visual reference: modestyleth.com (ModeStyle / Elementor kit)
 * Palette: brand pink #FC4992, black #000, text #3A3A3A, coral #FF6666, accent #6F77F4, surfaces #FFF / #FBFBFB / #F2F2F2
 */
@import url("https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Montserrat:ital,wght@0,500;0,600;0,700;0,800;1,600&family=Noto+Sans+Thai:wght@300;400;500;600&display=swap");

:root {
  /* Brand (from modestyleth Elementor globals) */
  --brand-pink: #fc4992;
  --brand-pink-soft: #ffa7ca;
  --brand-black: #000000;
  --brand-coral: #ff6666;
  --brand-purple: #6f77f4;
  --bg: #fbfbfb;
  --bg-warm: #f2f2f2;
  --surface: #ffffff;
  --text: #3a3a3a;
  --text-muted: #6b6b6b;
  --text-on-brand: #ffffff;
  --accent: var(--brand-coral);
  --accent-dark: #e04555;
  --accent-soft: rgba(252, 73, 146, 0.12);
  --accent-purple-soft: rgba(111, 119, 244, 0.12);
  --border: #e8e8e8;
  --success: #2d6a4f;
  --danger: #cf2e2e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
  /** พื้นโปร่งแสง ~60% (ทึบ 0.6) สำหรับแบนเนอร์ / pop-up */
  --surface-popup: rgba(255, 255, 255, 0.6);
  /** การ์ดสินค้า — ทึบ 80% (โปร่งแสง ~20%) */
  --surface-card: rgba(255, 255, 255, 0.8);
  --overlay-scrim: rgba(0, 0, 0, 0.6);
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "Noto Sans Thai", "Kanit", system-ui, sans-serif;
  --header-h: 56px;
  --bottom-bar: 64px;
  /** Responsive shell — ปรับความกว้างสูงสุดตาม viewport */
  --page-max: min(100vw - 1.5rem, 32rem);
  /** ระยะขอบซ้าย-ขวาในหน้า (แทน 16px คงที่) */
  --gutter: clamp(0.75rem, 4vw, 1.75rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(14px, 2.8vw, 16px);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (min-width: 40rem) {
  :root {
    --page-max: min(100vw - 2.5rem, 36rem);
    --header-h: 58px;
  }
}

@media (min-width: 56rem) {
  :root {
    --page-max: min(100vw - 3rem, 48rem);
  }
}

@media (min-width: 75rem) {
  :root {
    --page-max: min(100vw - 4rem, 60rem);
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--brand-pink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.btn,
[role="button"],
.cat-chip,
.pay-method {
  touch-action: manipulation;
}

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

/* —— Layout —— */
.page-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  min-height: 100dvh;
  min-height: 100svh;
  padding-bottom: calc(var(--bottom-bar) + 1rem + env(safe-area-inset-bottom));
  position: relative;
  box-sizing: border-box;
}

.page-wrap.no-bottom-pad {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

/* Landing — hero pink + black band (ModeStyle) */
.splash {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.25rem, 5vw, 2rem) var(--gutter) clamp(2rem, 8vh, 3rem);
  padding-top: max(clamp(1.25rem, 5vw, 2rem), env(safe-area-inset-top));
  padding-bottom: max(clamp(2rem, 8vh, 3rem), env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 255, 255, 0.15), transparent 50%),
    linear-gradient(165deg, var(--brand-pink) 0%, #e91e7a 42%, var(--brand-black) 100%);
  text-align: center;
}

.splash__tagline {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}

.splash__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--text-on-brand);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.splash__subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: normal;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.btn--primary {
  background: var(--brand-black);
  color: var(--surface);
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  background: #2a2a2a;
  text-decoration: none;
}

.splash .btn--primary {
  background: var(--brand-black);
  color: #fff;
}

.splash .btn--outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.splash .btn--outline:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.btn--outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--accent {
  background: var(--brand-coral);
  color: var(--surface);
}

.btn--accent:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 44px 1fr minmax(88px, auto);
  align-items: center;
  gap: clamp(0.25rem, 2vw, 0.5rem);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.site-header__icon:hover {
  background: var(--accent-soft);
}

.site-header__logo {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: capitalize;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  background: var(--brand-pink);
  color: #fff;
  border-radius: 9px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 200;
}

.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(20rem, 92vw);
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  background: linear-gradient(
    165deg,
    rgba(252, 73, 146, 0.42) 0%,
    rgba(255, 255, 255, 0.38) 55%,
    rgba(252, 73, 146, 0.28) 100%
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  z-index: 201;
  padding: max(1.25rem, env(safe-area-inset-top)) var(--gutter) 1.5rem;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer .splash__tagline {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(80, 20, 50, 0.25);
}

.drawer__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 20px;
  color: var(--text);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
}

.drawer nav a,
.drawer nav button.drawer-nav__link {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.drawer nav a:hover,
.drawer nav button.drawer-nav__link:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.drawer-nav a[hidden],
.drawer-nav button.drawer-nav__link[hidden] {
  display: none !important;
}

.drawer-meta {
  margin: 1rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.drawer-meta__line {
  margin: 0 0 0.25rem;
}

.drawer-meta__line:last-child {
  margin-bottom: 0;
}

/* Categories */
.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px var(--gutter);
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  padding: 8px clamp(0.75rem, 3vw, 1rem);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.cat-chip.is-active {
  background: var(--brand-black);
  color: var(--surface);
  border-color: var(--brand-black);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter) 12px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 600;
  margin: 0;
}

/* Product grid */
.grid-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.5rem, 2vw, 1rem);
  padding: 0 var(--gutter) clamp(1.25rem, 4vw, 1.5rem);
}

.card-product {
  background: var(--surface-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
}

.card-product__img-wrap {
  aspect-ratio: 1;
  background: var(--bg-warm);
  overflow: hidden;
}

.card-product__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-product__body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-product__name {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.35;
}

.card-product__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-pink);
  margin-bottom: 10px;
}

/* Product detail */
.product-hero {
  background: var(--surface);
}

.product-gallery {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-warm);
}

.product-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.gallery-dots span.is-active {
  background: var(--accent);
}

.product-panel {
  padding: 20px var(--gutter) max(6.25rem, calc(5rem + env(safe-area-inset-bottom)));
}

.product-panel h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 0 0 8px;
}

.product-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.option-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
}

.pill.is-selected {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.qty-val {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  z-index: 50;
}

/* Cart */
.cart-list {
  padding: var(--gutter);
}

.cart-row {
  display: grid;
  grid-template-columns: minmax(56px, 72px) minmax(0, 1fr) auto;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.cart-row__thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-warm);
}

.cart-row__meta {
  font-size: 14px;
}

.cart-row__price {
  font-weight: 600;
  white-space: nowrap;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter);
  font-size: 1.1rem;
  font-weight: 600;
}

.cart-footer-btns {
  padding: 0 var(--gutter) 24px;
}

/* Checkout / payment */
.pay-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  padding: 0 var(--gutter) 16px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  padding: clamp(0.75rem, 2vw, 0.9rem);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  min-height: 3.25rem;
}

.pay-method__label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-method.is-selected {
  border-color: var(--text);
}

.pay-method__icon {
  font-size: 1.4rem;
}

.pay-method__logos {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pay-method__logos--dual {
  gap: 6px;
}

.pay-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
}

.pay-logo-svg {
  display: block;
  height: 28px;
  width: auto;
}

.qr-box {
  margin: 16px;
  aspect-ratio: 1;
  max-height: 280px;
  margin-left: auto;
  margin-right: auto;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-muted);
  overflow: hidden;
}

.qr-box--live canvas {
  display: block;
  width: min(72vw, 220px);
  height: auto;
}

.qr-stripe-actions {
  padding: 0 var(--gutter) 12px;
  max-width: 400px;
  margin: 0 auto;
}

.qr-all-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--gutter) 16px;
  max-width: min(27.5rem, 100%);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 420px) {
  .qr-all-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.qr-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px 8px;
  text-align: center;
}

.qr-mini canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 6px;
}

.qr-mini__lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 6px;
}

.qr-mini__link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-purple);
}

.order-box {
  margin: 16px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.order-box code {
  font-size: 1.05rem;
  font-weight: 600;
}

/* Tracking timeline */
.track-steps {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 24px max(4px, env(safe-area-inset-left)) 8px max(4px, env(safe-area-inset-right));
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.track-steps::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 36px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.track-step {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1 0 auto;
  min-width: 0;
  font-size: clamp(10px, 2.4vw, 11px);
  max-width: 5rem;
}

.track-step__dot {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--surface);
}

.track-step.is-done .track-step__dot {
  background: var(--text);
}

.track-step.is-current .track-step__dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.info-lines {
  padding: 16px;
}

.info-line {
  height: 14px;
  background: var(--bg-warm);
  border-radius: 4px;
  margin-bottom: 10px;
}

.info-line--short {
  width: 60%;
}

/* Login social */
.social-grid {
  display: grid;
  gap: 10px;
  padding: 8px 0 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--gutter);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}

.social-btn:hover {
  background: var(--bg);
}

.social-btn svg {
  flex-shrink: 0;
}

/* Forms */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

/* Bottom bar (draft menu) */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--bottom-bar);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 90;
  font-size: clamp(11px, 2.5vw, 12px);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-bar a,
.bottom-bar span {
  text-align: center;
  color: var(--text);
  padding: 8px;
}

.bottom-bar strong {
  display: block;
  font-size: 14px;
}

/* Rating */
.rating-stars {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border);
  padding: 0;
  line-height: 1;
}

.star-btn.is-on {
  color: #c9a227;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: var(--page-max);
  max-height: 85dvh;
  max-height: 85svh;
  overflow-y: auto;
  background: var(--surface-popup);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.modal-overlay.is-open .modal-sheet {
  transform: translateY(0);
}

/* Admin table */
.admin-list {
  padding: 8px var(--gutter) 24px;
}

.admin-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface);
}

.admin-item h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

/* Page title */
.page-title {
  padding: 20px var(--gutter) 8px;
}

.page-title h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  margin: 0 0 4px;
  line-height: 1.2;
  word-break: break-word;
}

.page-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Search overlay */
#app-search-wrap {
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.search-panel {
  display: none;
  padding: 12px var(--gutter);
  background: var(--surface-popup);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.search-panel.is-open {
  display: block;
}

.search-panel input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* SPA views */
.view {
  display: none;
}

.view.is-active {
  display: block;
}

#view-splash.view.is-active {
  display: flex;
}

/* Shop — พื้นหลังชมพูโทนเดียวกับแบรนด์ (modestyleth / splash) */
#view-shop {
  background-color: var(--brand-pink);
  background-image: linear-gradient(165deg, var(--brand-pink) 0%, #e91e7a 52%, #d81b6a 100%);
  color: var(--text-on-brand);
}

/* shop-promo: ใช้พื้นโปร่ง 60% จาก base — ข้อความในบล็อกใช้สีตัวอักษรปกติให้อ่านบนกระจก */
#view-shop .shop-promo__text,
#view-shop .shop-promo--member .shop-promo__text {
  color: var(--text);
}

#view-shop .cat-scroll {
  background: rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

#view-shop .cat-chip {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--text);
}

#view-shop .cat-chip.is-active {
  background: var(--brand-black);
  color: var(--surface);
  border-color: var(--brand-black);
}

#view-shop .section-head h2 {
  color: var(--text-on-brand);
}

#view-shop .section-head__accent {
  color: rgba(255, 255, 255, 0.55);
}

#view-shop .bottom-bar {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: rgba(255, 255, 255, 0.35);
}

#view-shop .bottom-bar a,
#view-shop .bottom-bar span {
  color: var(--text);
}

body.no-scroll {
  overflow: hidden;
}

.toast {
  position: fixed;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  max-width: min(25rem, calc(100vw - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding: 12px 18px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 14px;
  text-align: center;
  background: rgba(58, 58, 58, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
}

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

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

.cart-qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px var(--gutter) 0;
  line-height: 1.45;
}

.hint--error {
  color: #b42318;
}

.checkout-stripe-root {
  min-height: 4rem;
  padding: 0 var(--gutter);
}

/* แถบสถานะ Stripe — ด้านล่าง ไม่บังทั้งหน้า */
.stripe-checkout-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  padding: 0.55rem var(--gutter) max(0.55rem, env(safe-area-inset-bottom));
  background: var(--surface-popup);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.1);
}

.stripe-checkout-bar__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 36rem;
  margin: 0 auto;
}

.stripe-checkout-bar__msg {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  min-width: 0;
}

.stripe-checkout-bar__msg code {
  font-size: 0.8em;
}

.stripe-checkout-bar__spinner {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: stripe-bar-spin 0.7s linear infinite;
}

.stripe-checkout-bar:not(.is-loading) .stripe-checkout-bar__spinner {
  display: none;
}

@keyframes stripe-bar-spin {
  to {
    transform: rotate(360deg);
  }
}

.stripe-checkout-bar__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 36rem;
  margin: 0.45rem auto 0;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* การ์ด / บล็อกทั่วไป (login, subscription, admin) — โทนเดียวกับ shop-promo */
.panel {
  background: var(--surface-popup);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-dark);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

.order-summary-mini {
  padding: 0 var(--gutter) 16px;
  font-size: 14px;
}

/* Shop promo — สมาชิก / แขก */
.shop-promo {
  margin: 12px var(--gutter) 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-popup);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-promo__text {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}

.shop-promo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 36rem) {
  .shop-promo {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .shop-promo__actions {
    flex-shrink: 0;
  }
}

.shop-promo--member {
  background: var(--surface-popup);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.section-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.cart-discount {
  padding: 0 var(--gutter) 8px;
  font-size: 14px;
  color: var(--success);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.cart-discount .hint {
  width: 100%;
  margin: 4px 0 0;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--gutter) 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.admin-tab {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-warm);
  text-decoration: none;
}

.admin-tab:hover {
  color: var(--brand-pink);
  text-decoration: none;
}

.admin-tab.is-active {
  background: var(--brand-pink);
  color: var(--text-on-brand);
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
}

.admin-payload-pre {
  margin: 0;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.78);
  color: #e8e8e8;
  border-radius: 10px;
  overflow: auto;
  max-height: min(70vh, 520px);
  white-space: pre-wrap;
  word-break: break-word;
}

/* —— Breakpoints: กริดสินค้า / ชำระเงิน / จอสั้น (landscape) —— */
@media (min-width: 36rem) {
  .pay-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) {
  .grid-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-panel h1 {
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  }
}

@media (min-width: 64rem) {
  .grid-products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-height: 28rem) and (orientation: landscape) {
  .splash {
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 1.25rem;
    justify-content: flex-start;
  }

  .splash__subtitle {
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 20rem) {
  .bottom-bar {
    font-size: 10px;
  }

  .bottom-bar strong {
    font-size: 12px;
  }
}
