/* HubShop Frontend Styles */

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

html,
body {
  height: 100%;
  background: #e5e5ea;
  font-family: 'Inter', sans-serif;
}

html.hubshop-surface-lock,
body.hubshop-surface-lock {
  overflow: hidden !important;
}

/* ================================================
       DESIGN TOKENS
    ================================================ */
:root {
  /* Colors */
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-sage: #f8f8fc;
  --surface-sage2: #ececf0;
  --primary: #7c3aed;
  --primary-mid: #8b5cf6;
  --primary-light: rgba(124, 58, 237, 0.10);
  --text: #111111;
  --text-muted: #888888;
  --accent: #ec4899;
  --accent-light: rgba(236, 72, 153, 0.10);
  --border: rgba(0, 0, 0, 0.07);
  --star: #F5C842;
  --rad-card: 16px;
  --rad-pill: 999px;
  --shadow: 0 2px 14px rgba(124, 58, 237, 0.09);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);

  /* Responsive tokens */
  --shell-max-width: 480px;
  --shell-padding: 20px;
  --card-width: 132px;
  --event-card-width: 168px;
  --fab-size: 58px;
  --nav-height: 74px;
  --app-name-size: 23px;
}

/* ================================================
       APP SHELL  (mobile-first, 390px)
    ================================================ */
.app-shell {
  width: 100%;
  max-width: var(--shell-max-width);
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  color: var(--text);
  box-shadow: 0 0 60px rgba(0, 0, 0, .25);
}

.hubshop-wrapper {
  width: 100%;
}

/* ── Mobile full-bleed: escape theme container on small screens ── */
@media (max-width: 639px) {
  .hubshop-wrapper {
    width: 100vw;
    /* Push left edge to viewport edge, regardless of parent padding */
    margin-left: calc(50% - 50vw);
    position: relative;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-shell {
    /* Fill viewport width completely on mobile */
    max-width: 100%;
    box-shadow: none;
  }
}

/* ── Status Bar ── */
.status-bar {
  background: var(--bg);
  padding: 12px 20px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.status-time {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 14px;
}

/* ── Top Bar ── */
.top-bar {
  padding: 10px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg);
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.top-bar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.top-bar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.top-bar-info .app-name {
  line-height: 1.2;
}

.top-bar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.app-name {
  font-family: 'Playfair Display', serif;
  font-size: var(--app-name-size);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.5px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* ── Scroll Area ── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}

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

/* ── Tab Panels ── */
.tab-panel {
  display: none;
  padding-bottom: 100px;
}

.tab-panel.active {
  display: block;
}

/* ── Help Tab: fill full scroll-area height without overlapping nav ── */
#tab-help {
  padding-bottom: 0;
  height: 100%;
  display: none;
  flex-direction: column;
}

#tab-help.active {
  display: flex;
}

/* ── Help Chat Header ── */
.help-chat-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.help-back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px 4px 0;
  line-height: 1;
}

.help-chat-hdr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.help-chat-hdr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.help-chat-hdr-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.help-chat-hdr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.help-chat-hdr-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.help-iframe-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.help-iframe-wrap iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  min-height: 0;
  background: transparent;
}

.help-iframe-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0px;
  border-radius: 0px;
  overflow: hidden;
  min-height: 0;
}

.help-iframe-panel iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  min-height: 0;
}

.help-no-url {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

/* When help tab is active, scroll-area must not scroll — iframe handles its own scroll */
.scroll-area:has(#tab-help.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ================================================
       REUSABLE COMPONENTS
    ================================================ */

/* Section Header */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px;
}

.sec-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
}

.sec-link {
  font-size: 12px;
  color: var(--primary-mid);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
}

.sec-more {
  font-size: 12px;
  color: var(--primary-mid);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
}

/* Horizontal Scroll Row */
.h-row {
  display: flex;
  gap: 12px;
  padding: 0 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.h-row::-webkit-scrollbar {
  display: none;
}

/* Category Chips */
.chips-row {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--rad-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all .2s;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--rad-pill);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-sale {
  background: var(--accent);
  color: #fff;
}

.badge-new {
  background: var(--primary-mid);
  color: #fff;
}

/* Spacer */
.sp {
  height: 20px;
}

.sp-sm {
  height: 10px;
}

/* Stars */
.stars {
  color: var(--star);
  font-size: 11px;
}

/* ================================================
       HOME TAB
    ================================================ */

/* Hero */
.hero {
  background: var(--surface-sage);
  padding: 28px 24px 0;
  min-height: 230px;
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary-mid);
  margin-bottom: 10px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: -.3px;
  max-width: 195px;
  margin-bottom: 22px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--rad-pill);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-bottom: 28px;
  transition: background .2s;
}

.hero-cta:hover {
  background: var(--primary-mid);
}

.hero-cta.cta-dark {
  background: var(--primary);
  color: #fff;
}

.hero-cta.cta-light {
  background: #fff;
  color: #333;
}

.hero-floats {
  position: absolute;
  right: 0;
  top: 0;
  width: 175px;
  height: 230px;
  pointer-events: none;
}

.hf {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.hf-1 {
  width: 92px;
  height: 92px;
  background: #B8D4CC;
  top: 18px;
  right: 24px;
}

.hf-2 {
  width: 68px;
  height: 68px;
  background: #CAE0DA;
  top: 110px;
  right: 82px;
  font-size: 26px;
}

.hf-3 {
  width: 58px;
  height: 58px;
  background: #D8EBE6;
  top: 64px;
  right: 4px;
  font-size: 24px;
}

/* Featured product card (home) */
.prod-card {
  flex-shrink: 0;
  width: var(--card-width);
  background: var(--surface);
  border-radius: var(--rad-card);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s;
}

.prod-card:hover {
  transform: translateY(-2px);
}

.prod-img-circle {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--surface-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 10px;
  overflow: hidden;
}

.prod-card .prod-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.prod-card .prod-cat {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.prod-card .prod-price {
  font-size: 14px;
  font-weight: 700;
  color: #e74c3c;
}

.prod-price-old {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
}

/* Promo countdown card */
.promo-card {
  margin: 10px 10px 20px 10px;
  background: var(--primary);
  border-radius: var(--rad-card);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.promo-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.promo-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-box {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.timer-lbl {
  font-size: 9px;
  color: rgba(255, 255, 255, .55);
  text-align: center;
  margin-top: 2px;
}

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

.timer-sep {
  color: rgba(255, 255, 255, .5);
  font-size: 18px;
  font-weight: 700;
  padding-bottom: 12px;
}

.btn-promo {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 9px 16px;
  border-radius: var(--rad-pill);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.home-promo-grid {
  padding: 0 20px 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-promo-card {
  padding: 16px;
  border-radius: var(--rad-card);
  color: #333;
  box-shadow: var(--shadow);
  min-width: 0;
}

.home-promo-card-title {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.home-promo-card-disc {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 8px;
}

.home-promo-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
}

.home-promo-action {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--rad-pill);
}

.home-promo-code {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 11px;
  color: #333;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Event card */
.event-card {
  flex-shrink: 0;
  width: var(--event-card-width);
  background: var(--surface);
  border-radius: var(--rad-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.event-img {
  aspect-ratio: 1.85 / 1;
  background: var(--surface-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  overflow: hidden;
}

.event-body {
  padding: 10px 12px;
}

.event-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-mid);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.event-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.event-desc-preview {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.event-countdown {
  font-size: 11px;
  font-weight: 700;
  color: #e65100;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.btn-event-detail {
  background: var(--surface-sage);
  border: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--rad-pill);
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s;
}

.btn-event-detail:hover {
  background: var(--primary-light);
}

/* Blog mini card */
.blog-mini {
  margin: 0 20px 10px;
  background: var(--surface);
  border-radius: var(--rad-card);
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.blog-mini-img {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  background: var(--surface-sage);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.blog-mini-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-mini-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* AI Highlight Box */
.ai-box {
  margin: 0 20px;
  background: var(--surface-sage);
  border-radius: var(--rad-card);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ai-avatar-sm {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.ai-box-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.ai-box-text p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: var(--rad-pill);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.ai-chip:hover {
  background: var(--primary-light);
}

/* ================================================
       PRODUCTS TAB
    ================================================ */
.search-wrap {
  padding: 12px 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--rad-pill);
  padding: 10px 16px;
  gap: 8px;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.products-wrap {
  padding: 0 20px;
}

.products-list {
  display: none;
}

/* keep for back-compat if needed */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.prod-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--rad-card);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  row-gap: 6px;
}

.prod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.heart-btn-abs {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

/* ── Product Detail Overlay (Blog Reader) ── */
.detail-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel.open {
  transform: translateY(0);
}

/* Center detail-panel on desktop */
@media (min-width: 481px) {
  .detail-panel {
    max-width: var(--shell-max-width);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .detail-panel.open {
    transform: translateX(-50%) translateY(0);
  }
}

.detail-header {
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.detail-article-hero {
  margin: -20px -20px 20px;
}

.detail-article-hero--text {
  margin-top: 0;
}

.detail-article-cover {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.detail-article-title {
  margin: 0;
  padding: 18px 20px 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

.detail-article-content {
  color: var(--text);
  line-height: 1.75;
}

.detail-article-content>*:first-child {
  margin-top: 0;
}

/* ── Compare Bar ── */
.compare-bar {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 900;
}

@media (min-width: 481px) {
  .compare-bar {
    max-width: var(--shell-max-width);
    left: 50%;
    right: auto;
    width: 100%;
    transform: translateX(-50%);
  }
}

.compare-info {
  font-size: 14px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.btn-compare {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
}

.btn-compare.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.compare-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 18px;
  border: none;
  border-radius: var(--rad-pill);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.24);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.compare-action:hover {
  background: var(--primary-mid);
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.30);
  transform: translateY(-1px);
}

.compare-clear {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface-sage);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.compare-clear:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: scale(1.04);
}

.btn-detail {
  margin-top: 6px;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border: none;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

.heart-btn {
  position: absolute;
  top: 11px;
  right: 58px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #D1C9C0;
  line-height: 1;
  transition: color .15s;
}

.heart-btn.liked {
  color: #E05252;
}

/* ================================================
       HELP TAB (AI Chat)
    ================================================ */
.chat-hdr {
  background: var(--surface-sage);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  flex-shrink: 0;
}

.online {
  color: #10b981;
}

.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background: #22C55E;
  border-radius: 50%;
  border: 2px solid var(--surface-sage);
}

.chat-hdr-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--rad-pill);
  margin-top: 3px;
}

.chat-msgs {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.bub-wrap {
  display: flex;
  flex-direction: column;
}

.bub-wrap.usr {
  align-items: flex-end;
}

.bubble {
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.55;
}

.bubble.ai {
  background: var(--surface-sage);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.bubble.usr {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bub-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.quick-row {
  padding: 6px 20px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-row::-webkit-scrollbar {
  display: none;
}

.qchip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  padding: 6px 13px;
  border-radius: var(--rad-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.qchip:hover {
  background: var(--primary-light);
}

.chat-input-bar {
  padding: 10px 20px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rad-pill);
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  color: var(--text);
}

.chat-input:focus {
  border-color: var(--primary-mid);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}

.send-btn:hover {
  background: var(--primary-mid);
}

/* ================================================
       BLOG TAB
    ================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px;
}

.blog-card {
  background: var(--surface);
  border-radius: var(--rad-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.blog-card:hover {
  transform: translateY(-2px);
}

.blog-card-img {
  background: var(--surface-sage);
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.blog-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-cat {
  display: inline-block;
  background: #FFF3E0;
  color: #E65100;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--rad-pill);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  align-self: flex-start;
}

.blog-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
}

.blog-meta-txt {
  font-size: 13px;
  color: var(--text-muted);
}

.blog-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  min-height: 42px;
}

.ai-sum-btn {
  background: var(--surface-sage);
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--rad-pill);
  cursor: pointer;
  white-space: normal;
  line-height: 1.3;
}

/* ================================================
       BOTTOM NAV
    ================================================ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  height: var(--nav-height);
  padding-bottom: 8px;
  z-index: 100;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, .06);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: color .18s;
  position: relative;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn .nicon {
  font-size: 24px;
}

.hubshop-icon--material {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

.nav-btn .hubshop-icon,
.room-card .hubshop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-btn .nlabel {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}

.nav-btn.active::after {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  position: absolute;
  bottom: 2px;
}

/* ================================================
       FLOATING AI BUTTON
    ================================================ */
.fab {
  position: absolute;
  bottom: 90px;
  right: 16px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  border: none;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--primary-mid);
  animation: fab-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes fab-pulse {
  0% {
    transform: scale(1);
    opacity: .7;
  }

  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

/* ================================================
       CHAT DRAWER (Floating)
    ================================================ */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .38);
  z-index: 300;
  display: none;
  opacity: 0;
  transition: opacity .28s;
}

.overlay.open {
  display: block;
  opacity: 1;
}

.drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  z-index: 301;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  max-height: 72%;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 38px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 6px;
  flex-shrink: 0;
}

.drawer-hdr {
  padding: 10px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.drawer-info .dtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.drawer-info .dsub {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.drawer-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}

.drawer-msgs::-webkit-scrollbar {
  display: none;
}

.drawer-qrow {
  padding: 6px 18px 10px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.drawer-qrow::-webkit-scrollbar {
  display: none;
}

.drawer-input-wrap {
  padding: 8px 18px 14px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rad-pill);
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  color: var(--text);
}

.drawer-input:focus {
  border-color: var(--primary-mid);
}

.drawer-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================
       UTILITY CLASSES (replacing inline styles)
    ================================================ */

/* Product card badge (home featured) */
.prod-card-badge {
  display: block;
  text-align: center;
  margin-bottom: 6px;
}

/* Image cover (product thumbnails) */
.prod-img-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}

/* Grid view: center card info */
.prod-card .prod-card-info {
  width: 100%;
  text-align: center;
}

/* Stars margin in prod-card */
.prod-card .stars {
  margin-bottom: 4px;
}

/* Promo card layout helpers */
.promo-content {
  flex: 1;
}

.promo-action {
  margin-left: 14px;
}

/* Event image cover */
.event-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Search bar icon */
.search-icon {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

/* Sort bar */
.sort-bar {
  padding: 0 var(--shell-padding) 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sort-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  background: white;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* Section head variants */
.sec-head--compact {
  padding-bottom: 10px;
}

.sec-head--top {
  padding-top: 16px;
}

/* Blog card image as <img> */
.blog-card-img img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Blog card placeholder (no thumbnail) */
.blog-card-placeholder {
  background: var(--surface-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

/* Blog link (no underline) */
.blog-link {
  color: inherit;
  text-decoration: none;
}

.blog-link:hover {
  text-decoration: underline;
}

/* Chat avatar image */
.chat-avatar-img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bottom spacer (replaces inline height:24px) */
.bottom-spacer {
  height: 24px;
}

.bottom-spacer--with-credit {
  height: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 18px;
}

.bottom-spacer-credit {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Blog empty state */
.blog-empty {
  text-align: center;
  padding: 40px var(--shell-padding);
  color: var(--text-muted);
}

.blog-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.blog-empty-hint {
  font-size: 13px;
  margin-top: 4px;
}

/* AI summary box */
.ai-summary-box {
  margin-top: 10px;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 10px;
  border-radius: 8px;
}

/* ================================================
       RESPONSIVE BREAKPOINTS
    ================================================ */

/* ── Mobile compact (≤ 480px) ── */
@media (max-width: 480px) {
  :root {
    --shell-max-width: 100%;
    --shell-padding: 16px;
    --card-width: 120px;
    --event-card-width: 152px;
    --fab-size: 50px;
    --nav-height: 66px;
    --app-name-size: 21px;
  }

  .top-bar,
  .sec-head {
    padding-left: 16px;
    padding-right: 16px;
  }

  .h-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chips-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .promo-card {
    margin-left: 16px;
    margin-right: 16px;
  }

  .home-promo-grid {
    padding-left: 16px;
    padding-right: 16px;
    grid-template-columns: 1fr;
  }

  .blog-mini {
    margin-left: 16px;
    margin-right: 16px;
  }


  .ai-box {
    margin-left: 16px;
    margin-right: 16px;
  }

  .products-wrap {
    padding: 0 10px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .prod-card {
    padding: 12px 10px;
  }

  .search-wrap {
    padding: 10px 16px;
  }

  .hero {
    padding: 22px 18px 0;
    min-height: 210px;
  }

  .hero-title {
    font-size: 24px;
    max-width: 170px;
  }

  .hero-floats {
    width: 150px;
    height: 210px;
  }

  .hf-1 {
    width: 78px;
    height: 78px;
  }

  .hf-2 {
    width: 58px;
    height: 58px;
  }

  .hf-3 {
    width: 48px;
    height: 48px;
  }

  .fab {
    bottom: 78px;
    right: 12px;
  }

  .chat-msgs {
    min-height: 220px;
  }
}

/* ── Mobile Large / Tablet Portrait (481px – 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --shell-max-width: 480px;
    --card-width: 140px;
    --event-card-width: 175px;
  }
}

/* ── Tablet Landscape / Desktop (≥ 769px) ── */
@media (min-width: 769px) {
  :root {
    --shell-max-width: 560px;
    --shell-padding: 24px;
    --card-width: 155px;
    --event-card-width: 190px;
    --app-name-size: 25px;
  }

  .top-bar,
  .sec-head {
    padding-left: 24px;
    padding-right: 24px;
  }

  .h-row {
    padding-left: 24px;
    padding-right: 24px;
  }

  .chips-row {
    padding-left: 24px;
    padding-right: 24px;
  }

  .promo-card {
    margin-left: 24px;
    margin-right: 24px;
  }

  .home-promo-grid {
    padding-left: 24px;
    padding-right: 24px;
  }

  .blog-mini {
    margin-left: 24px;
    margin-right: 24px;
  }


  .ai-box {
    margin-left: 24px;
    margin-right: 24px;
  }

  .products-wrap {
    padding: 0 24px;
  }

  .search-wrap {
    padding: 14px 24px;
  }

  .hero {
    padding: 32px 28px 0;
  }

  .hero-title {
    font-size: 30px;
  }

  .blog-card-img {
    min-height: 120px;
  }
}

/* ================================================
       ACCESSIBILITY
    ================================================ */

/* Minimum 44px hit area for interactive elements */
.icon-btn {
  min-width: 44px;
  min-height: 44px;
}

.nav-btn {
  min-height: 44px;
}

.chip {
  min-height: 36px;
}

.add-btn {
  min-width: 36px;
  min-height: 36px;
}

.heart-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
}

.send-btn {
  min-width: 44px;
  min-height: 44px;
}

/* Focus-visible outlines for keyboard navigation */
.nav-btn:focus-visible,
.icon-btn:focus-visible,
.chip:focus-visible,
.add-btn:focus-visible,
.heart-btn:focus-visible,
.send-btn:focus-visible,
.fab:focus-visible,
.btn-promo:focus-visible,
.hero-cta:focus-visible,
.qchip:focus-visible,
.ai-chip:focus-visible,
.drawer-close:focus-visible,
.drawer-send:focus-visible,
.ai-sum-btn:focus-visible {
  outline: 2px solid var(--primary-mid);
  outline-offset: 2px;
}

/* iOS safe area padding */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }

  .fab {
    bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .tab-panel {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* ================================================
   AI NAV BUTTON — ใช้ style เดียวกับ nav-btn อื่น
================================================ */
/* (special styling removed — #nav-help now inherits .nav-btn styles) */

/* ================================================
   NOTIFICATION FLYOUT
================================================ */
.noti-flyout {
  position: fixed;
  top: 68px;
  right: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(124, 58, 237, 0.10);
  z-index: 500;
  min-width: 240px;
  max-width: 300px;
  padding: 4px 0 8px;
  opacity: 0;
  transform: scale(0.92) translateY(-8px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.noti-flyout.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.noti-flyout-title {
  padding: 10px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.noti-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

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

.noti-item:hover {
  background: var(--surface-sage);
}

.noti-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.noti-item-body {
  flex: 1;
}

.noti-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.noti-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.noti-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ================================================
   EVENT MODAL (slide-up)
================================================ */
.hs-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .45);
  z-index: 10020;
  display: none;
}

.hs-overlay.open {
  display: block;
}

.event-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  z-index: 10021;
  padding: 0 0 32px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  display: none;
}

.event-modal.open {
  display: block;
  transform: translateY(0);
}

/* Center event-modal on desktop */
@media (min-width: 481px) {
  .event-modal {
    max-width: var(--shell-max-width);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .event-modal.open {
    transform: translateX(-50%) translateY(0);
  }
}

.event-modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 14px auto 0;
}

.event-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.event-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.event-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-sage);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-modal-body {
  padding: 20px;
}

.event-modal-img {
  height: auto;
  max-height: 300px;
  border-radius: var(--rad-card);
  background: var(--surface-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  margin-bottom: 16px;
  overflow: hidden;
}

.event-modal-img img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--rad-card);
}

.event-modal-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.event-modal-row strong {
  color: var(--text);
}

.event-modal-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-top: 12px;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 200px;
}

/* ================================================
     PRODUCT POPUP (FULL SCREEN)
   ================================================ */
.product-fullscreen-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-fullscreen-popup.open {
  transform: translateY(0);
}

.product-popup-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.product-popup-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-sage);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.product-popup-close:hover {
  background: var(--surface-sage2);
}

.product-popup-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-popup-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.events-fullscreen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.events-fullscreen-grid .event-card {
  width: 100% !important;
  margin: 0 0 12px !important;
}

/* Center popup within app shell on desktop */
@media (min-width: 481px) {
  .product-fullscreen-popup {
    max-width: var(--shell-max-width);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .product-fullscreen-popup.open {
    transform: translateX(-50%) translateY(0);
  }
}

/* ================================================
     SORT BAR + VIEW TOGGLE
   ================================================ */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 12px;
}

.sort-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

.view-toggle {
  margin-left: auto;
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border);
}

.view-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}

.view-btn.active {
  background: var(--primary);
  color: #fff;
}

.view-btn:hover:not(.active) {
  background: var(--surface-sage);
}

/* ================================================
     LIST VIEW MODE
   ================================================ */
.products-grid.list-view {
  grid-template-columns: 1fr !important;
  gap: 10px;
}

.products-grid.list-view .prod-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  gap: 14px;
  overflow: hidden;
}

.products-grid.list-view .prod-card .prod-img-circle {
  width: 56px;
  height: 56px;
  aspect-ratio: auto;
  margin: 0;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

.products-grid.list-view .prod-card .prod-card-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.products-grid.list-view .prod-card .prod-name {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.products-grid.list-view .prod-card .prod-cat {
  text-align: left;
  margin-bottom: 4px;
}

.products-grid.list-view .prod-card .stars {
  font-size: 10px;
}

.products-grid.list-view .prod-card .prod-card-right {
  flex: 0 0 76px;
  min-width: 0;
  max-width: 76px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.products-grid.list-view .prod-card .prod-price {
  max-width: 100%;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e74c3c;
}

.products-grid.list-view .prod-card .prod-price.sale del {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  display: block;
}

.products-grid.list-view .prod-card .prod-price.sale span {
  color: #e74c3c;
}

.products-grid.list-view .prod-card .prod-card-badge {
  display: none;
}

.products-grid.list-view .prod-card .btn-compare,
.products-grid.list-view .prod-card .btn-detail {
  display: none;
}

/* ================================================
     BADGE HOT
   ================================================ */
.badge-hot {
  background: #FF6B35;
  color: #fff;
}

/* ================================================
     RECOMMEND LIST VIEW
   ================================================ */
.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommend-row {
  background: var(--surface);
  border-radius: var(--rad-card);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.recommend-row:hover {
  transform: translateY(-1px);
}

.recommend-row-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--surface-sage);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}

.recommend-row-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recommend-row-info {
  flex: 1;
  min-width: 0;
}

.recommend-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-row-cat {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.recommend-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prod-card-info-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.recommend-row-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--rad-pill);
  background: var(--accent-light);
  color: var(--accent);
}

.recommend-row-right {
  flex-shrink: 0;
  text-align: right;
}

.recommend-row-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.recommend-row-price.sale del {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  display: block;
}

.recommend-row-price.sale span {
  color: #e74c3c;
}

/* ── Sale Price Styling ── */
.prod-price.sale del {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-right: 4px;
}

/* ── Image Cover Fix ── */
.prod-img-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}

.products-grid.list-view .prod-img-cover {
  border-radius: 12px;
}

.products-grid.list-view .prod-card .prod-card-info-bottom {
  justify-content: flex-start;
}

/* ── Event image cover ── */
.event-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================================================
   PRODUCT GALLERY CAROUSEL
   ================================================ */
.gallery-wrap {
  position: relative;
}

.gallery-main-img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .15s;
}

.gallery-dot.active {
  background: var(--primary);
}

.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  z-index: 2;
}

.gallery-prev {
  left: 8px;
}

.gallery-next {
  right: 8px;
}

/* ================================================
   HELP TAB BACKGROUND PRESETS
   ================================================ */
.help-bg-preset-1 {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.help-bg-preset-2 {
  background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
}

.help-bg-preset-3 {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
}

.help-bg-preset-4 {
  background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
}

.help-bg-preset-5 {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.help-bg-preset-6 {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

/* ================================================
   HAMBURGER MENU & INFO CARDS
   ================================================ */
.hs-hamburger-btn {
  background: transparent;
  box-shadow: none;
  font-size: 24px;
}

.hs-side-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--surface);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  font-family: 'Noto Sans Thai', sans-serif;
}

.hs-side-menu.open {
  transform: translateX(0);
}

.hs-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hs-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.hs-menu-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.hs-menu-title {
  font-family: 'Noto Sans Thai', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.hs-menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.hs-menu-item {
  padding: 10px 30px 10px 20px;
  display: flex;
  align-items: center;
  color: #f6fbf8;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 15px;
}

.hs-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hs-menu-header .icon-btn {
  color: #2c4a3e;
}

.hs-menu-credit {
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  text-align: center;
}

/* ================================================
   BRANCH LOCATOR
   ================================================ */
.hs-branch-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hs-branch-sheet.active {
  pointer-events: auto;
}

.hs-branch-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hs-branch-sheet.active .hs-branch-sheet-overlay {
  opacity: 1;
}

.hs-branch-sheet-content {
  position: relative;
  background: linear-gradient(180deg, rgba(248, 245, 240, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(102%);
  transition: transform 0.32s ease;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.hs-branch-sheet.active .hs-branch-sheet-content {
  transform: translateY(0);
}

.hs-branch-locator {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.hs-branch-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hs-branch-toolbar-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hs-branch-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-mid);
  margin-bottom: 4px;
}

.hs-branch-title {
  font-size: 24px;
  line-height: 1.1;
  color: var(--text);
}

.hs-branch-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.hs-branch-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hs-branch-search input:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(74, 122, 106, 0.16);
}

.hs-branch-nearme-btn {
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.hs-branch-nearme-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hs-branch-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
}

.hs-current-branch-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hs-current-branch-label,
.hs-branch-results {
  font-size: 12px;
  color: var(--text-muted);
}

.hs-branch-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--primary-mid);
}

.hs-branch-status.is-error {
  color: #b42318;
}

.hs-branch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.hs-branch-map-panel,
.hs-branch-list-panel {
  min-height: 0;
}

.hs-branch-list-panel {
  display: flex;
  overflow: hidden;
}

.hs-branch-map,
.hs-branch-map-empty {
  height: min(42vh, 340px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(44, 74, 62, 0.1);
  box-shadow: var(--shadow-lg);
  background: #dfe9e4;
}

.hs-branch-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  background:
    radial-gradient(circle at top left, rgba(232, 147, 106, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(228, 237, 233, 0.95), rgba(255, 255, 255, 0.95));
}

.hs-branch-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.hs-branch-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(44, 74, 62, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.hs-branch-item:hover,
.hs-branch-item.is-active {
  border: 2px solid #2C4A3E;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-sage) 100%);
  transform: translateY(-1px);
}

.hs-branch-item.is-expanded {
  padding-bottom: 16px;
  border-color: rgba(44, 74, 62, 0.38);
  background: linear-gradient(180deg, #ffffff 0%, rgba(232, 245, 233, 0.82) 100%);
  box-shadow: 0 16px 32px rgba(44, 74, 62, 0.1);
}

.hs-branch-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hs-branch-distance {
  flex-shrink: 0;
  border-radius: var(--rad-pill);
  padding: 5px 9px;
  background: var(--accent-light);
  color: #9a4f2f;
  font-size: 11px;
  font-weight: 700;
}

.hs-branch-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hs-branch-tags {
  font-size: 12px;
  color: var(--primary-mid);
  font-weight: 600;
}

.hs-branch-detail {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hs-branch-detail[hidden] {
  display: none;
}

.hs-branch-item.is-expanded .hs-branch-detail {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(44, 74, 62, 0.16);
}

.hs-branch-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hs-branch-chip,
.hs-branch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rad-pill);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
}

.hs-branch-chip {
  background: var(--surface-sage);
  color: var(--primary);
}

.hs-branch-link {
  color: #0057b8;
  background: rgba(0, 87, 184, 0.08);
}

.hs-branch-empty-list {
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed var(--border);
}

.hs-branch-popup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.hs-branch-popup-btn {
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.leaflet-control-attribution {
  font-size: 10px;
}

@media (min-width: 640px) {
  .hs-branch-sheet-content {
    padding: 20px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .hs-branch-toolbar-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hs-branch-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.9fr);
    align-items: stretch;
  }

  .hs-branch-map,
  .hs-branch-map-empty {
    height: 100%;
    min-height: 420px;
  }
}

@media (max-width: 639px) {
  .events-fullscreen-grid {
    gap: 10px;
  }

  .hs-branch-sheet-content {
    border-radius: 24px 24px 0 0;
    padding: 10px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* Compact header: hide eyebrow label to save vertical space */
  .hs-branch-eyebrow {
    display: none;
  }

  .hs-branch-locator {
    gap: 8px;
  }

  .hs-branch-toolbar {
    gap: 6px;
  }

  .hs-branch-toolbar-main {
    align-items: center;
    gap: 8px;
  }

  .hs-branch-title {
    font-size: 15px;
    line-height: 1.2;
  }

  /* Smaller close button on mobile */
  .hs-close-branch {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 16px;
    box-shadow: none;
  }

  /* Search + near-me side by side instead of stacked */
  .hs-branch-toolbar-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .hs-branch-search input {
    padding: 8px 12px;
    font-size: 13px;
  }

  .hs-branch-nearme-btn {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 12px;
  }

  .hs-branch-status-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .hs-current-branch-label,
  .hs-branch-results,
  .hs-branch-status {
    font-size: 11px;
  }

  .hs-branch-status {
    min-height: 0;
  }

  .hs-current-branch-wrap strong {
    font-size: 13px;
    line-height: 1.3;
  }

  /* Flip layout: list on top (scrollable), map fixed at bottom */
  .hs-branch-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    gap: 8px;
  }

  .hs-branch-list-panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
  }

  .hs-branch-map-panel {
    flex: none;
    height: 35vh;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.04);
  }

  .hs-branch-map,
  .hs-branch-map-empty {
    height: 100%;
    min-height: unset;
    border-radius: 16px;
  }

  .hs-branch-item {
    padding: 10px 12px;
    gap: 4px;
  }

  .hs-branch-item-head strong {
    font-size: 13px;
  }

  .hs-branch-meta,
  .hs-branch-tags {
    font-size: 11px;
  }

  .blog-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .blog-action-btn {
    min-height: 30px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .products-grid.list-view .prod-card {
    gap: 10px;
  }

  .products-grid.list-view .prod-card .prod-card-right {
    flex-basis: 76px;
    min-width: 0;
    max-width: 76px;
    overflow: hidden;
  }

  .products-grid.list-view .prod-card .prod-price {
    font-size: 13px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px;
  }

  .blog-card-img {
    aspect-ratio: 16 / 9;
  }

  .blog-card-body {
    padding: 10px;
  }

  .blog-excerpt {
    display: -webkit-box;
  }

  .blog-title {
    font-size: 16px;
  }

  .blog-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 4;
  }

  .detail-body {
    padding: 16px;
  }

  .detail-article-hero {
    margin: -16px -16px 16px;
  }

  .detail-article-cover {
    max-height: 220px;
  }

  .detail-article-title {
    font-size: 22px;
    padding: 16px 16px 0;
  }
}

/* ================================================
   EXIT CONFIRMATION MODAL
   ================================================ */
#hs-exit-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.hs-exit-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 20px;
  width: min(320px, 85vw);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.hs-exit-msg {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
  color: var(--text);
}

.hs-exit-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hs-exit-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hs-exit-btn--leave {
  background: var(--primary);
  color: #fff;
}

.hs-exit-btn--stay {
  background: var(--surface-sage);
  color: var(--primary);
}

/* ================================================
     ORB (Tap to chat) — v3.4.0
   ================================================ */
.orb-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 0 18px;
  position: relative;
  z-index: 1;
}

.orb {
  width: 208px;
  height: 208px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%,
      rgba(124, 58, 237, 0.28),
      rgba(124, 58, 237, 0.06) 55%,
      transparent 78%);
  border: 1px solid rgba(124, 58, 237, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  animation: orbFloat 4s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.orb::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.14), transparent);
  animation: orbPulse 2.4s ease-in-out infinite;
}

.orb:hover {
  transform: scale(1.04);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.25);
}

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

.orb-label {
  font-size: 15px;
  font-weight: 600;
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: var(--text);
}

.waveform {
  display: flex;
  gap: 3px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.wbar {
  width: 3px;
  border-radius: 3px;
  background: var(--primary);
  animation: wave 1.4s ease-in-out infinite;
}

.wbar:nth-child(1) {
  height: 7px;
  animation-delay: 0s;
}

.wbar:nth-child(2) {
  height: 14px;
  animation-delay: .1s;
}

.wbar:nth-child(3) {
  height: 10px;
  animation-delay: .2s;
}

.wbar:nth-child(4) {
  height: 20px;
  animation-delay: .3s;
}

.wbar:nth-child(5) {
  height: 13px;
  animation-delay: .4s;
}

.wbar:nth-child(6) {
  height: 8px;
  animation-delay: .5s;
}

.wbar:nth-child(7) {
  height: 18px;
  animation-delay: .6s;
}

@keyframes wave {

  0%,
  100% {
    transform: scaleY(1);
    opacity: .45;
  }

  50% {
    transform: scaleY(1.9);
    opacity: 1;
  }
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

@keyframes orbPulse {

  0%,
  100% {
    transform: scale(.88);
    opacity: .4;
  }

  50% {
    transform: scale(1.12);
    opacity: .9;
  }
}

/* ================================================
     EXPLORE ROOM GRID — v3.4.0
   ================================================ */
.room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rc, var(--primary));
  border-radius: 18px 18px 0 0;
}

.room-card:hover {
  background: var(--surface-sage);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.room-card:active {
  transform: scale(0.97);
}

.room-card--explore {
  min-height: 126px;
}

.room-card--soft {
  background: rgba(255, 255, 255, 0.9);
}

.room-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--rc, var(--accent));
  color: #fff;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.room-card-badge.is-blinking {
  animation: hubshopRoomCardBadgeBlink 1.1s ease-in-out infinite;
}

@keyframes hubshopRoomCardBadgeBlink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.96);
  }
}

.rc-icon {
  font-size: 28px;
  margin-bottom: 9px;
  display: block;
}

.rc-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.rc-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.explore-page {
  padding-top: 6px;
}

.explore-page-header {
  padding: 0 20px 14px;
}

.explore-page-title {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
}

.top-bar--help {
  gap: 10px;
}

.top-bar-brand--help {
  flex: 1;
}

.help-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-left: auto;
}

.detail-footer {
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.detail-footer .btn-promo {
  width: 100%;
  justify-content: center;
}

.faq-panel-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-panel-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-panel-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  font-size: 14px;
  color: var(--text);
}

.faq-panel-search input:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.faq-panel-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.faq-category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.faq-category-row::-webkit-scrollbar {
  display: none;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item.is-open {
  border-color: rgba(249, 115, 22, 0.35);
}

.faq-item-toggle {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.faq-item-question {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
}

.faq-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  flex-shrink: 0;
  font-size: 18px;
}

.faq-item-answer {
  padding: 0 16px 16px;
}

.faq-item-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.faq-item-answer-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.faq-item-answer-body p+p {
  margin-top: 8px;
}

.faq-empty {
  padding: 32px 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
}

/* ================================================
   CHAT-FIRST LAYOUT
   ================================================ */

.bottom-nav[data-chatfirst="hidden"] {
  display: none !important;
}

.tab-panel {
  padding-bottom: 0;
}

.top-bar--chatfirst {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
  z-index: 200;
  flex-shrink: 0;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
  vertical-align: middle;
  position: relative;
  flex-shrink: 0;
}

.online-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.35);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.tools-menu-btn {
  background: var(--primary-light);
  color: var(--primary);
  transition: background 0.2s, transform 0.15s;
}

.tools-menu-btn[aria-expanded="true"] {
  background: var(--primary);
  color: #fff;
  transform: rotate(45deg);
}

.account-btn {
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.account-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Tools Menu Popup ── */
.tools-menu-popup {
  position: fixed;
  top: 68px;
  right: var(--tools-menu-popup-right, 16px);
  width: min(320px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(124, 58, 237, 0.10);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92) translateY(-8px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tools-menu-popup.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.tools-menu-popup-inner {
  padding: 16px;
}

.tools-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tools-menu-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tools-menu-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-sage2);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s;
}

.tools-menu-close:hover {
  background: var(--border);
}

.tools-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.tools-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 100px;
  padding-bottom: 22px;
  padding: 14px 8px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--surface-sage);
  cursor: pointer;
  transition: background 0.18s, transform 0.14s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.tools-menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tool-color, var(--primary));
  border-radius: 10px 10px 0 0;
  opacity: 0.7;
}

.tools-menu-item:hover {
  background: var(--surface);
  border-color: var(--tool-color, var(--primary));
  transform: translateY(-2px);
}

.tools-menu-item:active {
  transform: scale(0.95);
}

.tools-menu-item-icon {
  font-size: 26px;
  line-height: 1;
}

.tools-menu-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.tools-menu-item-subtitle {
  position: absolute;
  bottom: 5px;
  left: 4px;
  right: 4px;
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-menu-item-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--tool-color, var(--primary));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tools-menu-item-badge--blink {
  animation: tmBadgeBlink 1.2s infinite;
}

@keyframes tmBadgeBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.tools-menu-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tools-menu-shortcut {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--rad-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.tools-menu-shortcut:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Tools Menu Backdrop ── */
.tools-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 489;
  background: transparent;
  pointer-events: none;
  transition: background 0.2s;
}

.tools-menu-backdrop.active {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.08);
}

/* iframe swallows clicks — disable when any menu is open */
.app-shell--menu-open iframe {
  pointer-events: none;
}

/* ── Tool Panel Slide-up ── */
.tab-panel--tool {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 400;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0 !important;
}

.tab-panel--tool.tool-open {
  transform: translateY(0);
}

.hubshop-tool-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}

@media (min-width: 481px) {
  .tab-panel--tool {
    max-width: var(--shell-max-width);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .tab-panel--tool.tool-open {
    transform: translateX(-50%) translateY(0);
  }
}

.tool-panel-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tool-panel-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.tool-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.13);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  flex-shrink: 0;
}

.tool-panel-close:hover {
  background: var(--surface-sage2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transform: scale(1.08);
}

/* ── Floating Pill Dock ── */
.pill-dock {
  position: absolute;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--rad-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(124, 58, 237, 0.08);
  padding: 3px 6px;
  z-index: 150;
  transition: opacity 0.2s, transform 0.2s;
}

.pill-dock.pill-dock--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  pointer-events: none;
}

.pill-dock-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: background 0.15s;
}

.pill-dock-btn:hover {
  background: var(--primary-light);
}

.pill-dock-btn svg {
  width: 20px;
  height: 20px;
}

.pill-dock-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   Highlight Article Ticker Ribbon and Reader Styles
   ========================================================================== */

.hubshop-highlight-ribbon {
  display: flex;
  align-items: center;
  height: 38px;
  background: var(--primary, #2C4A3E);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0 12px;
  font-family: 'Noto Sans Thai', 'Inter', sans-serif;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  position: relative;
  z-index: 100;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.hubshop-highlight-ribbon:hover {
  opacity: 0.95;
}

.hubshop-highlight-ribbon[data-theme="dark"] {
  background: var(--primary, #1a2f26);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.highlight-badge-wrap {
  flex-shrink: 0;
  margin-right: 10px;
  z-index: 2;
}

.highlight-badge {
  background: #ff4757;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0;
  box-shadow: 0 2px 5px rgba(255, 71, 87, 0.25);
  line-height: 1.2;
}

.highlight-ticker {
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.highlight-ticker-text {
  display: block;
  white-space: nowrap;
  font-size: 12.5px;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: opacity 0.3s ease;
}

.highlight-read-btn {
  background: #ffffff;
  color: var(--primary, #2C4A3E);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
  animation: hubshop-btn-blink 1.2s infinite alternate;
  letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes hubshop-btn-blink {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
  }
  100% {
    opacity: 0.8;
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .highlight-read-btn {
    animation: none;
  }
}
