/* ═══════════════════════════════════════════════════════
   MAKAY — Buy & Sell Locally  |  styles.css
   Single source of truth — no duplicate rules
   ═══════════════════════════════════════════════════════ */

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════════════════════
   NATIVE-APP LOCK — prevents ALL unwanted scroll, zoom,
   bounce, resize, text-select, and keyboard-layout-shift.
   Only elements that opt-in (overflow:auto/scroll) move.
   ══════════════════════════════════════════════════════ */

/* 1. Root shell — fully fixed, no scroll, no overflow */
html {
  height: 100%;
  width: 100%;
  overflow: hidden;
  /* Block pull-to-refresh and elastic overscroll at root */
  overscroll-behavior: none;
  /* Prevent iOS rubber-band on the document itself */
  -webkit-overflow-scrolling: auto;
  /* Kill pinch-zoom */
  touch-action: pan-x pan-y;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fafafa;
  color: #333;
  display: flex;
  flex-direction: column;
  /* Aggressive iOS fill — use inset:0 so nothing can leave a gap */
  position: fixed;
  inset: 0;
  width: 100%;
  /* Use dvh so the body never changes height when the keyboard appears */
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  /* Kill double-tap zoom and pinch-zoom everywhere by default */
  touch-action: pan-x pan-y;
  /* Prevent long-press text selection outside inputs */
  -webkit-user-select: none;
  user-select: none;
  /* Remove iOS callout (link preview on long-press) */
  -webkit-touch-callout: none;
}

/* 2. Allow text selection inside form fields */
input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 3. Scrollable containers must opt in explicitly —
      they get overscroll-behavior:contain so their scroll
      never bleeds out to the root or shifts anything else. */
.scrollable,
[data-scrollable],
.product-list,
.product-grid,
.category-items,
.subcategory-items,
.chat-messages,
.modal-body,
.sheet-body,
.plastay-items,
#homeContent,
#categoryContent,
#subcategoryContent,
#searchContent,
#plastayContent,
#chatContent,
#profileContent,
#notificationsContent,
#activityFeed,
.filter-panel-scroll,
.product-detail-scroll,
.brand-page-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* 4. Prevent zoom on input focus (iOS auto-zooms for <16 px fonts) */
input, textarea, select {
  font-size: max(1rem, 16px);
  /* allow normal vertical pan within inputs */
  touch-action: manipulation;
}

/* ══════════════════════════════════════════════════════ */

input, textarea, select {
  font-size: 1rem;
}
.material-symbols-rounded {
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 48;
  font-size: 22px;
}

/* ── Logo ── */
.logo-icon {
  width: 22px; height: 22px;
  background: linear-gradient(45deg, #19378C, #4a7fd4);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: bold; font-size: 14px;
}
.logo-image { width: 22px; height: 22px; border-radius: 4px; object-fit: contain; }

/* ── Headers (shared) ── */
.header-home, .header-category, .header-subcategory,
.header-makay-table, .header-search, .header-plastay, .header-chat {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  color: #333;
  padding: 0 1rem;
  /* push content below the status bar / notch */
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  /* visual nav bar = 56px; total element height includes the safe-area top */
  height: calc(56px + env(safe-area-inset-top, 0px));
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}
.header-home.hidden, .header-category.hidden, .header-subcategory.hidden,
.header-makay-table.hidden, .header-search.hidden,
.header-plastay.hidden, .header-chat.hidden { display: none; }

/* Plastay header count badge */
.plastay-header-count {
  background: #eef1f9;
  color: #19378C;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.plastay-header-count.hidden { display: none; }

/* Chat fixed header elements */
.header-chat .chat-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #19378C;
  display: flex;
  flex-shrink: 0;
}
.chat-header-person {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef1f9;
}
.chat-header-text { min-width: 0; }
.chat-header-name {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-sub {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-price-fixed {
  font-size: 14px;
  font-weight: 700;
  color: #27ae60;
  flex-shrink: 0;
  margin-left: 8px;
}

.header-left  { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 0.4rem; }

/* Blurred brand image fills the gap between top of screen and banner */
#headerBannerBlur {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(56px + env(safe-area-inset-top, 0px));
  z-index: 998; /* behind header (1000) and header backdrop (999) */
  background-size: cover;
  background-position: center top;
  filter: blur(20px) brightness(0.65) saturate(1.5);
  transform: scale(1.1); /* overshoot to hide blur edges */
  transition: opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}
#headerBannerBlur.visible { opacity: 1; }

/* Transparent home header — fully clear so #headerBannerBlur shows through */
.header-home.transparent {
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}
.header-home.transparent .header-left,
.header-home.transparent .header-right { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.header-home.transparent .search-bar {
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.header-home.transparent .search-bar::placeholder { color: rgba(255,255,255,0.6); }
.header-home.transparent .search-icon { color: rgba(255,255,255,0.8); }

/* ── Header icon buttons (bell + messages) ─────────────────────────────── */
.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #555;
  transition: background 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.header-icon-btn .material-symbols-rounded { font-size: 19px; color: inherit; }
.header-icon-btn:active { background: rgba(0,0,0,0.07); }

/* Transparent state — frosted pill keeps icons legible on any banner image */
.header-home.transparent .header-icon-btn {
  color: #fff;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  padding: 4px;
}
.header-home.transparent .header-icon-btn:active { background: rgba(0,0,0,0.45); }

/* ── Expanded Search Header ── */
/* NOTE: height/padding-top are inherited from the shared .header-* rule above.
   Only override the horizontal/bottom padding here — never height or padding-top. */
/* ══════════════════════════════════════════════════════════
   ADVANCED SEARCH — all styles (migrated from advanced-search.js)
   ══════════════════════════════════════════════════════════ */

/* ── Search header ─────────────────────────────────────── */
.header-search {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: auto;
}
.search-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  /* push below notch/Dynamic Island — the shared header rule sets padding-top
     on the outer element but .header-search overrides it to 0/auto, so we
     re-apply safe-area clearance here on the inner row instead */
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px;
  width: 100%;
  box-sizing: border-box;
}
.search-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.search-back-btn:active { background: #f0f0f0; }
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap .search-icon-lead {
  position: absolute;
  left: 12px;
  color: #aaa;
  font-size: 20px;
  pointer-events: none;
  transition: color 0.2s;
}
.search-input-wrap:focus-within .search-icon-lead { color: #19378C; }
#searchInputExpanded {
  width: 100%;
  height: 42px;
  padding: 0 72px 0 40px !important;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e;
  background: #f7f8fc;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
#searchInputExpanded:focus {
  border-color: #19378C;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(25,55,140,0.08);
}
#searchInputExpanded::placeholder { color: #aaa; }
.search-clear-btn {
  position: absolute;
  right: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #aaa;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.search-clear-btn.visible { display: flex; }
.search-filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #19378C;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.search-filter-btn-wrap {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
}
.filter-count-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.filter-count-dot.visible { opacity: 1; }

/* ── Active filter chips strip ─────────────────────────── */
.active-filters-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 12px 10px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  max-height: 0;
  transition: max-height 0.25s ease, padding-bottom 0.25s;
}
.active-filters-strip.has-filters {
  max-height: 52px;
  padding-bottom: 10px;
}
.active-filters-strip::-webkit-scrollbar { display: none; }
.af-chip,
.af-clear-all { scroll-snap-align: start; }
.af-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px 5px 12px;
  background: #eef1f9;
  border: 1px solid #b8c4e0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #19378C;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.af-chip .af-remove {
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
  opacity: 0.7;
}
.af-clear-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #e74c3c;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Suggestions panel ─────────────────────────────────── */
#searchSuggestions {
  position: fixed;
  /* Initial fallback: 56px header + 10px top padding + 8px bottom padding + safe-area.
     _repositionSuggestions() corrects this precisely after each render. */
  top: calc(74px + env(safe-area-inset-top, 0px));
  left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 9000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0 calc(80px + env(safe-area-inset-bottom, 0px));
  display: none;
  flex-direction: column;
}
#searchSuggestions.visible { display: flex; }
.suggest-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
  padding: 16px 16px 6px;
}
.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  border-bottom: 1px solid #f8f8f8;
}
.suggest-item:active { background: #f5f7ff; }
.suggest-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.suggest-icon.history  { background: #f5f5f5; color: #999; }
.suggest-icon.trending { background: #fff3e0; color: #f57c00; }
.suggest-icon.match    { background: #eef1f9; color: #19378C; }
.suggest-text { flex: 1; font-size: 14px; color: #1a1a2e; line-height: 1.3; }
.suggest-text em { font-style: normal; color: #19378C; font-weight: 700; }
.suggest-meta { font-size: 11px; color: #aaa; margin-top: 1px; }
.suggest-arrow  { color: #ddd; font-size: 18px; flex-shrink: 0; }
.suggest-remove {
  color: #ccc;
  font-size: 18px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.suggest-remove:active { background: #f0f0f0; color: #e74c3c; }
.suggest-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }

/* ── Search empty state (no query typed yet) ───────────── */
.se-wrap { display: flex; flex-direction: column; }
.se-hero {
  text-align: center;
  padding: 30px 28px 26px;
}
.se-illustration {
  width: 132px; height: 132px;
  margin: 0 auto 18px;
}
.se-title {
  font-family: 'Nunito', 'Fredoka One', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  color: #1a1a2e;
  margin: 0 0 8px;
}
.se-subtitle {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #8a8f9c;
  max-width: 260px;
  margin: 0 auto 22px;
}
.se-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #19378C;
  color: #fff;
  border: none;
  padding: 13px 26px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(25,55,140,0.28);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.se-cta-btn:active { transform: scale(0.97); box-shadow: 0 4px 12px rgba(25,55,140,0.22); }
.se-cta-btn .material-symbols-rounded { font-size: 18px; }

.se-section { padding: 20px 0 4px; border-top: 8px solid #f7f8fc; }
.se-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 14px;
}
.se-section-title {
  font-family: 'Nunito', 'Fredoka One', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #1a1a2e;
}
.se-section-link {
  display: flex; align-items: center; gap: 1px;
  font-size: 0.75rem; font-weight: 600; color: #999;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.se-section-link .material-symbols-rounded { font-size: 16px; }

.se-cat-row {
  display: flex; gap: 0.8rem; overflow-x: auto;
  padding: 0 1rem 0.4rem;
  scroll-padding: 0 1rem;
  scroll-behavior: smooth;
}
.se-cat-row::-webkit-scrollbar { display: none; }
.se-cat-row .cat { opacity: 1; transform: none; }

.se-chip-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 4px;
}
.se-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: #f5f6fa;
  border: 1px solid #ececf3;
  border-radius: 20px;
  font-size: 0.82rem; font-weight: 600;
  color: #333;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.se-chip:active { background: #eef1f9; border-color: #b8c4e0; }
.se-chip .material-symbols-rounded { font-size: 15px; color: #aaa; }
.se-chip.recent .material-symbols-rounded { color: #999; }
.se-chip-remove {
  margin-left: 2px; color: #ccc; font-size: 14px;
  display: flex; align-items: center; border-radius: 50%;
}
.se-chip-remove:active { color: #e74c3c; }

/* ── Filter drawer (bottom sheet) ─────────────────────── */
#filterDrawer {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
#filterDrawer.open {
  background: rgba(0,0,0,0.5);
  pointer-events: all;
}
.filter-sheet {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: min(82vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  touch-action: pan-y;
}
#filterDrawer.open .filter-sheet { transform: translateY(0); }
.filter-sheet.dragging { transition: none !important; }
.filter-sheet-handle {
  width: 36px; height: 4px;
  background: #d8d8d8;
  border-radius: 4px;
  margin: 12px auto 0;
  cursor: grab;
  flex-shrink: 0;
}
.filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.filter-sheet-title { font-size: 16px; font-weight: 800; color: #1a1a2e; }
.filter-reset-btn {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.filter-reset-btn:active { background: #fff0f0; }
.filter-section { padding: 18px 20px 0; }
.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #aaa;
  margin-bottom: 10px;
}

/* Sort pills */
.sort-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.sort-pill {
  padding: 7px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.sort-pill.active { border-color: #19378C; background: #19378C; color: #fff; font-weight: 600; }

/* Condition pills */
.cond-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.cond-pill {
  padding: 7px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cond-pill.active { border-color: #19378C; background: #19378C; color: #fff; font-weight: 600; }

/* Price range */
.price-range-row { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; }
.price-input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  padding: 11px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fafafa;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.price-input:focus { border-color: #19378C; background: #fff; }
.price-sep { color: #aaa; font-size: 13px; flex-shrink: 0; white-space: nowrap; }

/* Category select */
.filter-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center / 20px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: #19378C; background-color: #fff; }

.filter-apply-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 22px 20px 0;
  padding: 16px;
  background: #19378C;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.filter-apply-btn:active { opacity: 0.85; }

/* ── Search idle/empty state ───────────────────────────── */
#searchIdleState { display: flex; flex-direction: column; padding: 0 0 80px; }
#searchIdleState.hidden { display: none; }

/* ══════════════════════════════════════════════════════════
   END ADVANCED SEARCH STYLES
   ══════════════════════════════════════════════════════════ */

/* ── Home header inline search bar ── */
.search-container { position: relative; display: flex; align-items: center; }
.search-bar {
  padding: 0.28rem 0.5rem; padding-right: 28px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  background: #f5f6fa;
  width: 130px; font-size: 0.8rem; outline: none;
  transition: all 0.3s ease;
  color: #333;
}
.search-bar:focus {
  width: 185px;
  box-shadow: 0 2px 8px rgba(25,55,140,0.15);
  border-color: #19378C;
  background: #fff;
}
.search-icon {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: #888; cursor: pointer; transition: color 0.2s ease;
}
.search-icon:hover { color: #19378C; }

.back-arrow { cursor: pointer; transition: transform 0.2s ease; }
.back-arrow:hover { transform: translateX(-2px); }

.post-goods-btn {
  background: #19378C; color: #fff; border: none;
  padding: 0.4rem 0.8rem; border-radius: 8px;
  font-size: 0.8rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.3rem;
  transition: background 0.2s ease;
}
.post-goods-btn:hover { background: #0f2460; }

/* ── Prevent iOS zoom on ALL form inputs app-wide ── */

/* ── Layout ── */
.main { flex: 1 1 0%; min-height: 0; position: relative; overflow: hidden; }

/* ── Home section ── */
#home {
  padding: 0;
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transform: translateX(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none; overflow-y: auto;
  padding-bottom: 0;
}
#home.active { opacity: 1; transform: translateX(0); pointer-events: all; z-index: 1; }

/* ── All other sections ── */
section:not(#home):not(#searchResults) {
  padding: 1rem;
  position: absolute; top: 0;
  left: 0; width: 100%; height: 100%;
  opacity: 0; transform: translateX(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none; overflow-y: auto;
  padding-top: calc(56px + env(safe-area-inset-top, 0px) + 1rem);
  padding-bottom: 0;
  box-sizing: border-box;
}
section:not(#home):not(#searchResults).active {
  opacity: 1; transform: translateX(0); pointer-events: all; z-index: 1;
}

/* ── Search Results section ── */
#searchResults {
  padding: 0 1rem 1rem;
  /* 62px = new search header base height (10px top + 42px input + 10px bottom) */
  padding-top: calc(62px + env(safe-area-inset-top, 0px));
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transform: translateX(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none; overflow-y: auto;
  padding-bottom: 0;
  box-sizing: border-box;
}
#searchResults.active { opacity: 1; transform: translateX(0); pointer-events: all; z-index: 1; }

.search-results-info { margin-bottom: 1rem; margin-top: 1rem; font-size: 0.9rem; color: #666; }
.search-results-info #searchQuery { color: #19378C; font-weight: 600; }
.search-results-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.4rem; align-items: start; }

/* ── Search: matched brand pinned above the results grid ── */
#searchBrandMatch { margin-bottom: 1rem; }
.search-brand-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #f4f7ff 0%, #eef1f9 100%);
  border: 1.5px solid #dde4f0; border-radius: 16px;
  padding: 12px 14px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.search-brand-card:active { transform: scale(0.98); }
.search-brand-card-logo {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden;
}
.search-brand-card-info { flex: 1; min-width: 0; }
.search-brand-card-name {
  font-size: 0.95rem; font-weight: 800; color: #1a1a2e;
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-brand-card-verified { font-size: 15px; color: #19378C; }
.search-brand-card-category {
  font-size: 0.72rem; font-weight: 600; color: #19378C;
  text-transform: capitalize; margin-top: 2px;
}
.search-brand-card-desc {
  font-size: 0.75rem; color: #888; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-brand-card-btn {
  flex-shrink: 0; background: #19378C; color: #fff; border: none;
  border-radius: 20px; padding: 8px 14px; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.search-brand-card-btn:active { opacity: 0.85; }

.search-result-item {
  background: #fff; border-radius: 12px; padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  opacity: 0; transform: translateY(20px);
  animation: fadeInUp 0.4s ease forwards;
}
.search-result-item:nth-child(1) { animation-delay: 0.1s; }
.search-result-item:nth-child(2) { animation-delay: 0.2s; }
.search-result-item:nth-child(3) { animation-delay: 0.3s; }
.search-result-item:nth-child(4) { animation-delay: 0.4s; }
.search-result-item:nth-child(n+5) { animation-delay: 0.5s; }
.search-result-item:hover { transform: translateY(-3px); }
/* Override fixed height inside search result cards so image fills proportionally */
.search-result-item .product-card-img-wrap {
  height: auto !important;
  aspect-ratio: 1 / 1;
}
.search-result-item .product-card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-result-name  { font-size: 0.8rem; font-weight: 500; margin-bottom: 0.2rem; line-height: 1.2; }
.search-result-price { font-size: 0.8rem; font-weight: 600; color: #19378C; }
.search-result-discount { background: #ff4d4f; color: #fff; font-size: 0.65rem; padding: 0.1rem 0.25rem; border-radius: 4px; margin-left: 0.25rem; }

.no-results { text-align: center; padding: 3rem 1rem; color: #666; }
.no-results.hidden { display: none; }
.no-results-icon { font-size: 4rem; color: #ddd; margin-bottom: 1rem; }
.no-results h3 { margin-bottom: 0.5rem; color: #333; }
.no-results p  { margin-bottom: 2rem; font-size: 0.9rem; }
.search-suggestions h4 { margin-bottom: 1rem; font-size: 0.9rem; color: #333; }
.suggestion-chips { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.suggestion-chip {
  padding: 0.4rem 0.8rem; background: #eef1f9; color: #19378C;
  border-radius: 16px; font-size: 0.8rem; cursor: pointer; transition: background 0.2s ease;
}
.suggestion-chip:hover { background: #19378C; color: #fff; }

/* ── Home content ── */
/* No padding-top here — the banner itself extends behind the transparent header */
.home-content { padding-top: 0; }

/* ── Brand Banner Carousel ── */
.banner-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0 0 1rem;
  /* Banner fills from very top (behind transparent header) + its own visual height */
  height: 256px;
}

.brand-banner-carousel {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.brand-banner-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  user-select: none;
}

.brand-banner-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04); /* slight over-scale so edges don't show on pan */
  transition: transform 6s ease;
}
.brand-banner-slide.active .brand-banner-bg {
  transform: scale(1); /* subtle Ken Burns */
}

.brand-banner-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px 44px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.28) 0%,
    transparent 35%,
    transparent 50%,
    rgba(0,0,0,0.65) 100%
  );
  pointer-events: none;
}

.brand-banner-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 2.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  flex-shrink: 0;
}

.brand-banner-icon {
  font-size: 32px !important;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.brand-banner-text {
  flex: 1;
  min-width: 0;
}

.brand-banner-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-banner-tagline {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-banner-cta {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* Dots */
.brand-banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.brand-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transition: all 0.3s ease;
  cursor: pointer;
}

.brand-banner-dot.active {
  width: 20px;
  border-radius: 3px;
  background: #fff;
}

/* Skeleton while brands load */
.skeleton-banner {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #e8e8e8 25%, #d4d4d4 50%, #e8e8e8 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}


.brands-container, .categories-container { margin: 1.5rem 0 1rem; padding: 0; }
.products-container { padding: 0 0 2rem; }
.section-title { font-weight: 600; font-size: 0.95rem; margin: 0 0 0.8rem; color: #222; padding: 0 1rem; display: flex; align-items: center; }
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 0.8rem;
}
.section-title-row .section-title { margin: 0; padding: 0 0 0 1rem; }
.section-see-more {
  font-size: 0.75rem; font-weight: 600; color: #19378C;
  background: none; border: none; padding: 0 1rem 0 0.5rem; margin: 0;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.section-see-more:active { opacity: 0.6; }

/* ── Local Brands label ── */
.local-brands-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Nunito', 'Fredoka One', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #19378C;
  padding: 0 1rem;
  margin: 0 0 0.8rem;
  width: 100%;
  position: relative;
}
.local-brands-verified-icon {
  font-size: 16px;
  color: #19378C;
  flex-shrink: 0;
}

/* ── Brand Shortcuts ── */
.brand-shortcuts {
  display: flex; gap: 0.8rem; overflow-x: auto;
  padding: 0 1rem 0.5rem;
  scroll-padding: 0 1rem;
  scroll-behavior: smooth;
}
.brand-shortcuts::-webkit-scrollbar { height: 3px; }
.brand-shortcuts::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }
.brand-shortcuts .brand {
  flex: 0 0 auto; text-align: center; min-width: 60px;
  opacity: 0; transform: translateX(20px); transition: 0.4s;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
}
.brand-shortcuts .brand.show { opacity: 1; transform: translateX(0); }
.brand-shortcuts .brand img {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  margin-bottom: 0.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  outline: 2.5px solid #e8f0fe;
  transition: outline-color 0.25s ease, transform 0.2s ease;
}
.brand-shortcuts .brand:active img { transform: scale(0.93); outline-color: #19378C; }
.brand-shortcuts .brand span {
  font-size: 0.68rem; font-weight: 600; white-space: nowrap;
  text-align: center; color: #2c3e50; width: 100%;
}

/* ── Category Shortcuts — rounded-rect tiles, NOT circles ── */
.category-shortcuts {
  display: flex; gap: 0.8rem; overflow-x: auto;
  padding: 0 1rem 0.5rem;
  scroll-padding: 0 1rem;
  scroll-behavior: smooth;
}
.category-shortcuts::-webkit-scrollbar { height: 3px; }
.category-shortcuts::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }
.category-shortcuts .cat {
  flex: 0 0 auto; text-align: center; min-width: 68px;
  opacity: 0; transform: translateX(20px); transition: 0.4s;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.category-shortcuts .cat.show { opacity: 1; transform: translateX(0); }
.category-shortcuts .cat img {
  width: 58px; height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  border: 2px solid #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-shortcuts .cat:active img { transform: scale(0.94); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.category-shortcuts .cat span {
  font-size: 0.68rem; font-weight: 600; white-space: nowrap;
  text-align: center; color: #2c3e50; width: 100%;
}

/* ── Product Cards ── */
.trending-container { margin-bottom: 1.5rem; }
.product-scroll {
  display: flex; gap: 0.4rem; overflow-x: auto;
  padding: 0 1rem 0.5rem;
  scroll-padding: 0 1rem;
  scroll-behavior: smooth;
}
.product-scroll::-webkit-scrollbar { height: 3px; }
.product-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

.product-grid-static { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.4rem; margin-bottom: 1.5rem; padding: 0 1rem; align-items: start; }

.product-card {
  background: #fff; border-radius: 0; padding: 0.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}
.product-scroll .product-card { flex: 0 0 160px; }
.product-card.show { opacity: 1; transform: translateY(0); }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 0; margin-bottom: 0.2rem; }

/* ── Image shimmer placeholder — holds space while image loads ── */
/* product-card-img-wrap: explicit height locks the space before image arrives */
.product-card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #ebebeb;
  width: 100%;
  height: 160px;         /* ~75% of total card height */
  border-radius: 0;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  position: relative;
  z-index: 1;
  /* hide broken-image icon while shimmer shows */
  color: transparent;
}
.product-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  border-radius: 0;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.product-card-img-wrap.loaded::after {
  opacity: 0;
  pointer-events: none;
}
@keyframes imgShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* card-img-wrap: brand cards */
.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #ebebeb;
  height: 160px;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%; height: 160px;
  object-fit: cover; display: block;
  transition: transform .3s;
  position: relative; z-index: 1;
  color: transparent;
}
.card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.card-img-wrap.loaded::after { opacity: 0; }

/* ── Product profile — shimmer skeleton background/overlay only.
   (Sizing/object-fit for the actual <img> now lives solely in the
   .product-gallery-main img rule below — no separate clamp here.) ── */
.product-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #ebebeb;
}
.product-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.product-img-wrap.loaded::after { opacity: 0; }

/* ── Gallery slide shimmer ── */
.gallery-slide {
  position: relative;
}
.gallery-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.gallery-slide.loaded::after { opacity: 0; }
.gallery-slide img {
  position: relative;
  z-index: 1;
  color: transparent;
}

/* ── Brand profile logo ring shimmer ── */
.bp-logo-ring {
  position: relative;
}
.bp-logo-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.bp-logo-ring.loaded::after { opacity: 0; }
.bp-logo-ring img, .bp-logo-ring span {
  position: relative;
  z-index: 3;
}

/* chat-item-avatar shimmer */
.chat-item-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ebebeb;
}
.chat-item-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ebebeb 25%, #d6d6d6 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
  border-radius: 10px;
}
.chat-item-avatar.loaded::after { opacity: 0; }
.chat-item-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  color: transparent;
}
.product-name     { font-size: 0.8rem; font-weight: 500; margin: 0 0 2px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price    { font-size: 1rem; font-weight: 900; color: #19378C; letter-spacing: -0.3px; }
.product-discount { background: #ff4d4f; color: #fff; font-size: 0.65rem; padding: 0.1rem 0.25rem; border-radius: 4px; margin-left: 0.25rem; }

.product-meta-tag {
  font-size: 0.68rem; color: #555; background: #eef1f9;
  border-radius: 4px; padding: 1px 6px; display: inline-block;
  margin: 0 0 3px; text-transform: capitalize; line-height: 1.5;
}
.product-seller-tag {
  font-size: 0.68rem; color: #19378C; font-weight: 600; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 2px;
}
.product-price-row { margin-top: auto; padding-top: 2px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }

/* ── Product Detail Page ── */
#productPage { padding: 0 !important; top: 0 !important; height: 100% !important; overflow-y: auto; }
.product-back-btn {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  /* pad top by safe-area so the back button clears the notch/Dynamic Island */
  padding: env(safe-area-inset-top, 0px) 16px 10px;
  /* ensure the button is always at least 44px tall below the safe area */
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  font-size: 24px; color: #333; cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  box-sizing: border-box;
}
.product-back-btn:active { opacity: 0.6; }
.product-page-content { padding: 0 0 calc(100px + env(safe-area-inset-bottom, 0px)); }
.product-details { padding: 16px 16px 0; }
.product-details h2 { font-size: 1.15rem; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; line-height: 1.3; }
.product-details .price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.product-details #productPrice { font-size: 1.3rem; font-weight: 700; color: #19378C; }
.product-details #productDescription { font-size: 0.9rem; color: #555; line-height: 1.6; margin-bottom: 8px; }
.product-detail-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.chip-condition { background: #f0f9ee; color: #2d7a2d; border: 1px solid #c8e6c9; }
.chip-category  { background: #eef1f9; color: #19378C; border: 1px solid #b8c4e0; text-transform: capitalize; }
.chip-brand     { background: #dde4f0; color: #19378C; border: 1px solid #b8c4e0; }

.purchase-section {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Primary row: Buy Now (grows) + Save icon-only button ── */
.product-action-row-primary {
  display: flex;
  gap: 8px;
}

.purchase-btn {
  flex: 1;
  background: #19378C;
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, transform 0.1s;
}
.purchase-btn:hover  { background: #0f2460; }
.purchase-btn:active { transform: scale(0.97); }

/* Plastay button */
.add-to-plastay-btn {
  flex-shrink: 0;
  background: #f0f2f8;
  color: #19378C;
  border: 1.5px solid #e0e6f5;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  min-width: 108px;
}
.add-to-plastay-btn:hover  { background: #dde3f5; border-color: #c5d2f0; }
.add-to-plastay-btn:active { transform: scale(0.97); }
/* Saved state */
.add-to-plastay-btn.saved {
  background: #19378C;
  color: #fff;
  border-color: #19378C;
}

/* ── Secondary row: Call + Make Offer ── */
.product-action-row-secondary {
  display: flex;
  gap: 8px;
}

.product-action-secondary-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e8e8e8;
  background: #fafafa;
  color: #555;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.product-action-secondary-btn:hover  { background: #eef1f9; border-color: #c5d2f0; color: #19378C; }
.product-action-secondary-btn:active { transform: scale(0.97); }

.product-action-offer-btn {
  border-color: #d4e6ff;
  background: #eef5ff;
  color: #19378C;
}
.product-action-offer-btn:hover { background: #dce9ff; border-color: #a8c8f0; }

/* ── Report Listing ── */
.product-action-row-report {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.product-report-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, background 0.15s;
}
.product-report-btn:hover  { color: #e74c3c; background: #fff0f0; }
.product-report-btn:active { transform: scale(0.97); }
.product-report-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Similar Listings Section ── */
#similarListingsSection {
  padding: 18px 0 8px;
  border-top: 1.5px solid #f0f0f0;
  margin-top: 8px;
}
.similar-listings-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a1a2e;
  padding: 0 16px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
/* Vertical 2-column grid, sitting at the bottom of the page where the
   user's natural scroll direction already continues downward — reuses the
   home screen's .product-card markup/styling exactly (see #productGrid). */
.similar-listings-scroll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  padding: 0 16px 12px;
}

/* ── Owner product page button variants ── */
.owner-product-sold-btn {
  background: linear-gradient(135deg, #27ae60, #229954) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.owner-product-delete-btn {
  background: #fff0f0 !important;
  color: #e74c3c !important;
  border-color: #ffd0d0 !important;
}
.owner-product-delete-btn:hover {
  background: #e74c3c !important;
  color: #fff !important;
  border-color: #e74c3c !important;
}

/* ── Category Page ── */
.category-container { display: flex; height: 100%; }
.category-left {
  width: 32%; border-right: 1px solid #e0e0e0;
  overflow-y: auto; background: #fafafa; padding: 0;
  min-height: 0;
  flex: 0 0 32%;
  align-self: stretch;
}
.category-left::-webkit-scrollbar { width: 3px; }
.category-left::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }
.category-left div { padding: 0.7rem; border-bottom: 1px solid #eee; cursor: pointer; transition: all 0.2s ease; font-weight: 500; font-size: 0.8rem; }
.category-left div:hover  { background: #f5f5f5; }
.category-left div.active { background: #e8f9e5; color: #19378C; font-weight: 600; }
.category-right {
  width: 68%; overflow-y: auto; padding: 0.8rem;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 0.6rem;
  background: #fff; align-content: start;
  min-height: 0;
  flex: 1 1 68%;
  align-self: stretch;
}
.category-right::-webkit-scrollbar { width: 4px; }
.category-right::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

/* Subcategory icon cards in right panel — keep circles here (small icons, not photos) */
.item-card {
  text-align: center; background: #fff; padding: 0.6rem 0.4rem;
  border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  transition: all 0.2s ease; cursor: pointer;
  opacity: 0; transform: translateY(20px); border: 1px solid #f0f0f0;
  position: relative;
}
.item-card.show   { opacity: 1; transform: translateY(0); }
.item-card:hover  { transform: translateY(-2px); }
.item-card img    { width: 55px; height: 55px; border-radius: 50%; object-fit: cover; }
.item-card span   { display: block; margin-top: 0.3rem; font-size: 0.7rem; font-weight: 500; }
.item-card-icon   { width: 40px; height: 40px; border-radius: 10px; background: #eef1f9; display: flex; align-items: center; justify-content: center; }
.item-card-icon .material-symbols-rounded { font-size: 20px; color: #19378C; }
.item-card-other  { border-style: dashed; border-color: #e0c090; color: #e67e22; }
.item-card-other .item-card-icon { background: #fff3e0; }
.item-card-other .item-card-icon .material-symbols-rounded { color: #e67e22; }
.sub-live-dot {
  position: absolute; top: 6px; right: 6px;
  background: #e74c3c; color: white; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Subcategory product grid */
.subcategory-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 10px 12px; margin-bottom: 1.5rem; }
.subcategory-grid-inner { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 12px 14px; margin-top: 8px; }
.subcategory-product {
  background: #fff; border-radius: 10px; padding: 0.35rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  opacity: 0; transform: translateY(20px);
}
.subcategory-product.show { opacity: 1; transform: translateY(0); transition: opacity 0.4s ease, transform 0.4s ease; }
.subcategory-product:hover { transform: translateY(-3px); }

/* ── Makay Table — grid only, no list view ── */
#makayTable { padding: 0; background: #f8f9fa; }

#userGoodsGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
}
@media (min-width: 480px) {
  #userGoodsGrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 16px; }
}

/* Same look as the home feed's .product-card — kept as its own class
   (not .product-card) purely so it keeps opening the edit form on click
   instead of the public product detail page. */
.user-good-card {
  background: #fff; border-radius: 0; padding: 0.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; overflow: hidden;
  opacity: 0; transform: translateY(20px);
}
.user-good-card.show { animation: fadeInUp 0.4s ease forwards; }
.user-good-card.show:nth-child(1) { animation-delay: 0.05s; }
.user-good-card.show:nth-child(2) { animation-delay: 0.10s; }
.user-good-card.show:nth-child(3) { animation-delay: 0.15s; }
.user-good-card.show:nth-child(4) { animation-delay: 0.20s; }
.user-good-card.show:nth-child(5) { animation-delay: 0.25s; }
.user-good-card.show:nth-child(6) { animation-delay: 0.30s; }
.user-good-card.show:nth-child(n+7) { animation-delay: 0.35s; }
.user-good-card:hover  { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.user-good-card.sold   { opacity: 0.75; }
.user-good-card.sold .product-card-img-wrap img { filter: grayscale(30%); }

.makay-table-empty { text-align: center; padding: 4rem 2rem; color: #95a5a6; grid-column: 1 / -1; }
.makay-table-empty p { font-size: 16px; margin: 0; line-height: 1.6; }

/* ── Post Modal ── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 540px) {
  .modal { align-items: center; padding: 20px; }
  .modal-content { border-radius: 16px !important; height: auto !important; max-height: 88vh !important; }
}
.modal.active { display: flex; }
.modal-content {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px;
  height: 90svh; max-height: 90svh;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.modal-header {
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0;
}
.modal-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.25rem 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}
.modal-close  { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; line-height: 1; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.5rem; border: 1px solid #ddd;
  border-radius: 8px; font-size: 0.9rem; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* Price + currency row — !important overrides .form-group width:100% */
.price-currency-row { display: flex; gap: 8px; align-items: stretch; }
.price-currency-row input[type="number"] { flex: 1; min-width: 0; width: auto !important; }
.price-currency-row select { width: 96px !important; min-width: 96px; flex-shrink: 0; padding-right: 4px; }

.req { color: #e74c3c; font-size: 12px; }
.condition-hint { font-size: 11px; color: #7f8c8d; margin-top: 4px; min-height: 16px; font-style: italic; }
select:disabled { background: #f8f9fa; color: #adb5bd; cursor: not-allowed; }

.image-upload { border: 2px dashed #ddd; border-radius: 8px; padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s ease; }
.image-upload:hover { border-color: #19378C; }
.image-upload input { display: none; }
.upload-text { color: #666; font-size: 0.9rem; }
.image-preview { width: 100%; max-width: 200px; height: 150px; object-fit: cover; border-radius: 8px; margin-top: 0.5rem; }

.form-actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.btn {
  flex: 1; padding: 0.7rem; border: none; border-radius: 8px;
  font-weight: 600; cursor: pointer; transition: background 0.2s ease;
  font-family: inherit; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn:active:not(:disabled) { opacity: 0.88; }
.btn-primary { background: #19378C; color: white; }
.btn-primary:hover:not(:disabled) { background: #0f2460; }
.btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #ddd; }
.btn-secondary:hover:not(:disabled) { background: #e0e0e0; }

/* Global button spinner - used by LayoutManager.btnLoading() everywhere */
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpinAnim 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn-secondary .btn-spinner,
.manage-btn-secondary .btn-spinner,
.manage-btn-success .btn-spinner,
.manage-btn-danger .btn-spinner,
.manage-btn-info .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: currentColor;
}
@keyframes btnSpinAnim { to { transform: rotate(360deg); } }

/* ── Manage / Edit Modal — now uses shared .modal + .modal-content styles ── */
/* Status badge used inside the manage modal header */
.manage-status-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.manage-status-badge.available { background: #e8f9e5; color: #2d7a2d; }
.manage-status-badge.sold      { background: #ffe6e6; color: #d63447; }

/* Legacy manage-info rows — still used in activity / other places */
.manage-info-row   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.manage-info-label { font-size: 0.8rem; color: #999; }
.manage-info-value { font-size: 0.85rem; font-weight: 600; color: #2c3e50; }

/* Legacy manage-form-group — kept for any other uses */
.manage-form-group { margin-bottom: 14px; }
.manage-form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; color: #555; }
.manage-form-group input,
.manage-form-group select,
.manage-form-group textarea {
  width: 100%; padding: 10px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: 'Inter', sans-serif;
  transition: border-color 0.3s ease; box-sizing: border-box;
}
.manage-form-group input:focus,
.manage-form-group select:focus,
.manage-form-group textarea:focus { outline: none; border-color: #19378C; }
.manage-form-group textarea { min-height: 80px; resize: vertical; }
.manage-form-group .price-currency-row input[type="number"] { flex: 1; min-width: 0; width: auto !important; }
.manage-form-group .price-currency-row select { width: 96px !important; min-width: 96px; flex-shrink: 0; }

.manage-actions    { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* Close button in manage modal header */
.manage-close {
  background: #f5f5f5; border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 1.2rem; color: #555;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.manage-close:hover { background: #e0e0e0; color: #222; }

/* manage-btn base + variants used in the Edit Post modal */
.manage-btn {
  flex: 1; min-width: calc(50% - 4px);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; border: none; border-radius: 10px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.manage-btn-primary   { background: #19378C; color: #fff; }
.manage-btn-primary:hover   { background: #0f2460; }
.manage-btn-success   { background: #e8f9e5; color: #2d7a2d; border: 1px solid #c3e6cb; }
.manage-btn-success:hover   { background: #2d7a2d; color: #fff; border-color: #2d7a2d; }
.manage-btn-danger    { background: #fff0f0; color: #d63447; border: 1px solid #ffcdd2; }
.manage-btn-danger:hover    { background: #d63447; color: #fff; border-color: #d63447; }
.manage-btn-secondary { background: #f5f5f5; color: #555; border: 1px solid #ddd; }
.manage-btn-secondary:hover { background: #e0e0e0; }

.manage-save-btn {
  flex: 1; background: #19378C; color: white; border: none;
  padding: 12px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: background 0.2s ease;
}
.manage-save-btn:hover { background: #0f2460; }
.manage-delete-btn {
  background: #fff0f0; color: #d63447; border: 1px solid #ffcdd2;
  padding: 12px 16px; border-radius: 10px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; gap: 4px;
}
.manage-delete-btn:hover { background: #d63447; color: white; border-color: #d63447; }

/* ── Purchase Modal ── */
.purchase-product-info { display: flex; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem; background: #f8f9fa; border-radius: 8px; }
.purchase-product-info img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.purchase-product-details h4 { margin-bottom: 0.5rem; font-size: 1rem; }
.purchase-price { font-weight: 600; color: #19378C; font-size: 1.1rem; }
.seller-info, .buyer-info { margin-bottom: 1.5rem; }
.seller-info h4, .buyer-info h4 { margin-bottom: 0.8rem; color: #333; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
.seller-contact { background: #eef1f9; padding: 1rem; border-radius: 8px; border-left: 4px solid #19378C; }
.seller-contact p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.info-text { color: #666; font-size: 0.85rem; margin-bottom: 1rem; padding: 0.8rem; background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 6px; }

/* ── Success Modal ── */
.success-modal { text-align: center; max-width: 450px; }
.success-icon  { font-size: 4rem; color: #28a745; margin-bottom: 1rem; }
.success-modal h3 { color: #28a745; margin-bottom: 1rem; }
.success-modal p  { margin-bottom: 1rem; line-height: 1.4; }
.success-details  { background: #f8f9fa; padding: 1rem; border-radius: 8px; margin: 1.5rem 0; text-align: left; }
.success-details h4 { margin-bottom: 0.8rem; color: #333; }
.success-details ul { margin-left: 1.2rem; }
.success-details li { margin-bottom: 0.5rem; font-size: 0.9rem; }

/* ── Plastay ── */
#plastay {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.plastay-items { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1rem; }
.plastay-item  { background: #fff; border-radius: 12px; padding: 0.8rem; display: flex; gap: 0.8rem; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.plastay-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.plastay-item-details  { flex: 1; }
.plastay-item-name     { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.2rem; }
.plastay-item-price    { color: #19378C; font-weight: 600; font-size: 0.8rem; }
.plastay-item-quantity { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.quantity-btn  { background: #f5f5f5; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-weight: 600; }
.quantity-btn:hover { background: #e0e0e0; }
.plastay-total { background: #fff; border-radius: 12px; padding: 1rem; text-align: center; }
.checkout-btn  { background: #19378C; color: #fff; border: none; padding: 0.8rem 2rem; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: 0.8rem; }
.checkout-btn:hover { background: #0f2460; }

/* ── Profile ── */
.profile-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.settings-icon    { cursor: pointer; padding: 0.5rem; border-radius: 50%; background: #f5f5f5; transition: 0.2s; }
.settings-icon:hover { background: #e0e0e0; }
.profile-avatar   { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; display: block; }
.profile-name     { text-align: center; font-weight: 600; font-size: 1.1rem; margin-bottom: 0.3rem; }
.profile-email    { text-align: center; color: #666; font-size: 0.9rem; margin-bottom: 2rem; }
.profile-menu     { margin-bottom: 2rem; }
.profile-menu-item { background: #fff; border-radius: 10px; padding: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: background 0.2s ease; }
.profile-menu-item:hover { background: #f8f9fa; }
.profile-menu-item-left   { display: flex; align-items: center; gap: 0.8rem; }
.profile-menu-item-icon   { width: 40px; height: 40px; background: #eef1f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #19378C; }
.profile-menu-item-details h4 { font-size: 0.9rem; margin-bottom: 0.2rem; }
.profile-menu-item-details p  { font-size: 0.75rem; color: #666; }
.activity-section  { margin-bottom: 2rem; }
.activity-item     { background: #fff; border-radius: 10px; padding: 0.8rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.8rem; }
.activity-icon     { width: 40px; height: 40px; background: #eef1f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #19378C; }
.activity-details h4 { font-size: 0.85rem; margin-bottom: 0.2rem; }
.activity-details p  { font-size: 0.75rem; color: #666; }

/* ── Settings ── */
#settings { 
  display: none;
  /* Settings uses an inline .settings-header div, NOT a fixed top header bar.
     So we only need safe-area clearance, not the full 56px header offset. */
  padding-top: calc(env(safe-area-inset-top, 0px) + 1.2rem) !important;
}
.settings-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.settings-back   { cursor: pointer; padding: 0.5rem; border-radius: 50%; background: #f5f5f5; transition: background 0.2s; }
.settings-back:hover { background: #e0e0e0; }

/* Group label */
.settings-group-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: #aaa; padding: 0 4px;
  margin: 1.2rem 0 0.4rem;
}
.settings-group-label:first-of-type { margin-top: 0; }

/* Settings card */
.settings-card {
  background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Row */
.settings-item-new {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; cursor: pointer;
  transition: background 0.15s;
}
.settings-item-new:hover  { background: #f8f9fa; }
.settings-item-new:active { background: #f0f0f0; }
.settings-item-separator  { border-top: 1px solid #f2f2f2; }

.settings-item-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-item-icon .material-symbols-rounded { font-size: 20px; }
.settings-item-body       { flex: 1; min-width: 0; }
.settings-item-body h4    { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 1px; }
.settings-item-body p     { font-size: 12px; color: #888; }
.settings-chevron         { color: #ccc; font-size: 20px !important; flex-shrink: 0; }

/* ── Settings Sub-Panels (slide-in from right) ── */
.settings-panel {
  position: fixed; inset: 0;
  background: #fafafa; z-index: 1500;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  /* always rendered, just off-screen */
  visibility: visible;
}
.settings-panel.active { transform: translateX(0); }

.settings-panel-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1rem;
  /* push below the notch when the panel is full-screen */
  padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.settings-panel-header h2 { font-size: 1.1rem; font-weight: 700; }

.settings-panel-body {
  flex: 1; overflow-y: auto;
  padding: 1.2rem 1rem;
  padding-bottom: 1.2rem;
}

/* Fade-up entrance for panel body content */
.settings-panel.active .settings-panel-body > * {
  animation: spFadeUp 0.35s ease both;
}
.settings-panel.active .settings-panel-body > *:nth-child(1) { animation-delay: 0.06s; }
.settings-panel.active .settings-panel-body > *:nth-child(2) { animation-delay: 0.10s; }
.settings-panel.active .settings-panel-body > *:nth-child(3) { animation-delay: 0.14s; }
.settings-panel.active .settings-panel-body > *:nth-child(4) { animation-delay: 0.18s; }
.settings-panel.active .settings-panel-body > *:nth-child(5) { animation-delay: 0.22s; }
.settings-panel.active .settings-panel-body > *:nth-child(6) { animation-delay: 0.26s; }
.settings-panel.active .settings-panel-body > *:nth-child(7) { animation-delay: 0.30s; }
.settings-panel.active .settings-panel-body > *:nth-child(8) { animation-delay: 0.34s; }

@keyframes spFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Info / Danger blocks */
.settings-info-block {
  background: #fff; border-radius: 14px;
  padding: 1.5rem 1rem; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.settings-info-block p { font-size: 0.88rem; color: #666; line-height: 1.6; }

.settings-danger-block {
  background: #fff5f5; border: 1.5px solid #ffc5c5;
  border-radius: 14px; padding: 1.5rem 1rem; text-align: center;
}
.settings-danger-block h3 { font-size: 1rem; color: #c0392b; margin-bottom: 0.6rem; }
.settings-danger-block p  { font-size: 0.85rem; color: #666; line-height: 1.6; }

/* Buttons */
.settings-action-btn {
  width: 100%; padding: 0.85rem;
  background: #19378C; color: #fff;
  border: none; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: background 0.2s, transform 0.1s;
}
.settings-action-btn:hover   { background: #0f2460; }
.settings-action-btn:active  { transform: scale(0.98); }
.settings-action-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.settings-danger-btn {
  width: 100%; padding: 0.85rem;
  background: #e74c3c; color: #fff;
  border: none; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: background 0.2s, transform 0.1s;
}
.settings-danger-btn:hover  { background: #c0392b; }
.settings-danger-btn:active { transform: scale(0.98); }

/* Edit Avatar */
.edit-avatar-wrap {
  display: flex; justify-content: center;
  position: relative; width: fit-content; margin: 0 auto;
}
.edit-avatar-img {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover; border: 3px solid #e0e0e0;
}
.edit-avatar-btn {
  position: absolute; bottom: 0; right: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: #19378C; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid #fff;
}

/* Form groups inside panels */
.settings-panel-body .form-group { margin-bottom: 1rem; }
.settings-panel-body .form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: #555; margin-bottom: 5px;
}
.settings-panel-body .form-group input,
.settings-panel-body .form-group select,
.settings-panel-body .form-group textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 0.9rem; font-family: inherit;
  background: #fff; outline: none;
  transition: border-color 0.2s;
}
.settings-panel-body .form-group input:focus,
.settings-panel-body .form-group select:focus,
.settings-panel-body .form-group textarea:focus { border-color: #19378C; }

/* Notification toggle row */
.edit-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; border-top: 1px solid #f0f0f0;
}
.edit-toggle-label { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.edit-toggle-sub   { font-size: 12px; color: #888; margin-top: 2px; }

/* iOS-style toggle */
.mk-toggle { position: relative; flex-shrink: 0; }
.mk-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.mk-toggle-track {
  display: block; width: 48px; height: 28px; border-radius: 14px;
  background: #ccc; cursor: pointer;
  transition: background 0.25s; position: relative;
}
.mk-toggle-track::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.mk-toggle input:checked + .mk-toggle-track { background: #19378C; }
.mk-toggle input:checked + .mk-toggle-track::after { transform: translateX(20px); }

/* Social pills (compact) */
.socials-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.social-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: #fff;
  text-decoration: none; transition: opacity 0.2s, transform 0.1s;
}
.social-pill:hover  { opacity: 0.85; text-decoration: none; }
.social-pill:active { transform: scale(0.96); }
.social-ig { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-tt { background: #010101; }
.social-fb { background: #1877f2; }
.social-wa { background: #25d366; }

/* Social full list */
.social-full-list { display: flex; flex-direction: column; gap: 12px; }
.social-full-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  text-decoration: none; color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}
.social-full-item:hover  { opacity: 0.92; text-decoration: none; transform: translateX(3px); }
.social-full-item:active { transform: scale(0.98); }
.social-full-ig { background: linear-gradient(135deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.social-full-tt { background: #010101; }
.social-full-fb { background: #1877f2; }
.social-full-wa { background: #25d366; }
.social-full-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.social-full-info  { flex: 1; }
.social-full-name  { display: block; font-weight: 700; font-size: 15px; }
.social-full-handle{ display: block; font-size: 12px; opacity: 0.8; }

/* Terms link cards */
.terms-link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; background: #fff; border-radius: 14px;
  margin-bottom: 10px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: background 0.15s, transform 0.15s;
}
.terms-link-card:hover  { background: #f4f6fb; text-decoration: none; transform: translateX(2px); }
.terms-link-card:active { transform: scale(0.98); }
.terms-link-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.terms-link-icon .material-symbols-rounded { font-size: 20px; }
.terms-link-body { flex: 1; }
.terms-link-body h4 { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 1px; }
.terms-link-body p  { font-size: 12px; color: #888; }

/* ══════════════════════════════════════════════
   MAKAY CONFIRM DIALOG  (replaces browser confirm)
══════════════════════════════════════════════ */
.mkd-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  transition: background 0.25s;
}
.mkd-overlay.mkd-visible { background: rgba(0,0,0,0.45); }

.mkd-box {
  background: #fff; border-radius: 20px;
  padding: 1.8rem 1.5rem 1.4rem;
  width: 100%; max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}
.mkd-overlay.mkd-visible .mkd-box { transform: scale(1) translateY(0); opacity: 1; }

.mkd-icon-wrap { margin-bottom: 0.8rem; }
.mkd-icon { font-size: 42px; color: #e74c3c; }

.mkd-title {
  font-size: 1.05rem; font-weight: 700;
  color: #1a1a1a; margin-bottom: 0.5rem;
}
.mkd-msg {
  font-size: 0.85rem; color: #666;
  line-height: 1.5; margin-bottom: 0;
}
.mkd-actions {
  display: flex; gap: 10px; margin-top: 1.4rem;
}
.mkd-btn {
  flex: 1; padding: 0.8rem;
  border: none; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.mkd-btn:active { transform: scale(0.97); }
.mkd-btn-cancel {
  background: #f0f0f0; color: #444;
}
.mkd-btn-cancel:hover { background: #e0e0e0; }
.mkd-btn-danger {
  background: #e74c3c; color: #fff;
}
.mkd-btn-danger:hover { background: #c0392b; }
.mkd-btn-warn {
  background: #f39c12; color: #fff;
}
.mkd-btn-warn:hover { background: #d68910; }
.mkd-btn-primary {
  background: #19378C; color: #fff;
}
.mkd-btn-primary:hover { background: #0f2460; }

/* ══════════════════════════════════════════════
   MAKAY TOAST  (replaces browser alert)
══════════════════════════════════════════════ */
.mkt-toast {
  position: fixed;
  bottom: 92px;
  left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 9500;
  padding: 12px 20px; border-radius: 50px;
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; max-width: 90vw;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.mkt-toast.mkt-show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.mkt-error   { background: #c0392b; color: #fff; }
.mkt-success { background: #19378C; color: #fff; }

/* ── Messages & Chat ── */
/* #messages layout is fully defined in index.html inline <style> block.
   Only override padding/overflow here — do NOT set height or top
   as those are handled by the canonical block. */
#messages { padding: 0 !important; overflow: hidden !important; }
.messages-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.messages-header h2 { font-size: 1.2rem; }
.no-messages       { text-align: center; padding: 3rem 1rem; color: #666; }
.no-messages-icon  { font-size: 4rem; color: #ddd; margin-bottom: 1rem; }
.message-item  { background: #fff; border-radius: 12px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid #19378C; }
.message-product { display: flex; gap: 0.8rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.message-product img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.message-product-info h4 { margin-bottom: 0.3rem; font-size: 0.9rem; }
.message-price        { color: #19378C; font-weight: 600; }
.message-buyer-info   { margin-bottom: 1rem; }
.message-buyer-info h4 { margin-bottom: 0.5rem; font-size: 0.9rem; color: #333; }
.message-buyer-info p  { margin-bottom: 0.3rem; font-size: 0.85rem; }
.message-actions { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.message-time    { font-size: 0.75rem; color: #999; text-align: right; }
/* chat-input-area defined in index.html canonical block */
/* ── Footer ── */
.footer {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  display: flex; justify-content: space-around; align-items: flex-start;
  padding-top: 0.3rem;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  /* Safe-area for notched devices; 0 on flat-bottom devices — no extra gap */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(224,224,224,0.5);
  position: fixed; bottom: 0; left: 0; right: 0;
  font-size: 0.85rem; z-index: 1001;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  /* GPU composite — eliminates subpixel gap on iOS */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  /* Extend background below bottom edge to kill any browser-rendered gap */
  margin-bottom: -1px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1px);
}
/* Bleed the footer background past the bottom of the viewport on all devices */
.footer::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 0; right: 0;
  height: 40px;
  background: inherit;
  pointer-events: none;
}
.footer.hidden-nav {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}
.footer a {
  text-decoration: none; color: #666; flex: 1; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; transition: all 0.2s ease;
  padding: 0.4rem 0.2rem; border-radius: 8px; margin: 0 0.2rem;
}
.footer a:hover, .footer a.active { color: #19378C; background: rgba(25,55,140,0.1); transform: translateY(-1px); }
.footer span.label { font-size: 0.65rem; margin-top: 0.2rem; font-weight: 500; }

/* ── Logout ── */
.logout-btn {
  background: #dc3545; color: #fff; border: none;
  padding: 0.8rem 2rem; border-radius: 8px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; font-size: 0.9rem; transition: background 0.2s ease;
  box-shadow: 0 2px 8px rgba(220,53,69,0.2);
}
.logout-btn:hover { background: #c82333; box-shadow: 0 4px 12px rgba(220,53,69,0.3); }

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 3000;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid #f3f3f3; border-top: 4px solid #19378C;
  border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem;
}
.loading-text { color: #666; font-size: 0.9rem; }

/* ── Guest nudge ── */
#guestUpgradeNudge { bottom: 64px !important; }

/* ── Animations ── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp  { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer  { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.slide-up      { opacity: 0; transform: translateY(20px); transition: opacity 0.4s ease, transform 0.4s ease; }
.slide-up.show { opacity: 1; transform: translateY(0); }

/* ── Multi-image Upload UI ── */
.image-upload-multi {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.image-upload-multi:hover { border-color: #19378C; }
.image-upload-multi input { display: none; }
.upload-text { color: #888; font-size: 0.85rem; line-height: 1.4; }

.image-preview-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.img-preview-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: visible;
  flex-shrink: 0;
}
.img-preview-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 2px solid #e0e0e0;
}
.img-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
}
.img-main-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(25,55,140,0.85);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
}

/* ── Post-form image previews (goods.js: preview-img-wrap/-img/-remove/-replace) ── */
.preview-img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: visible;
  flex-shrink: 0;
}
.preview-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 2px solid #e0e0e0;
}
.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
  padding: 0;
  background: #e74c3c;
  color: white;
}
.preview-remove:active { opacity: 0.8; }

/* ── Product Image Gallery (product detail page) ── */
.product-gallery {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f5f5f5;
  user-select: none;
}
.gallery-track {
  display: flex;
  /* No transition — switching photos is an instant jump to the next
     image, not a sliding animation. */
}
/* width (not just min-width) matters here: with flex-shrink:0 and no
   width set, a slide's size falls back to its *content's* natural size —
   for a wide/landscape photo, once its height locks to the container's
   height, its own natural width at that height can come out wider than
   the container. flex-shrink:0 then refuses to shrink it back down, so
   the slide itself renders wider than the visible viewport — the visible
   window (overflow:hidden on .product-gallery) just shows whatever falls
   in its first 100%, which is the slide's *left* portion, making the
   photo look left-anchored instead of centered even though object-position
   is centered *within the oversized slide*. Explicit width:100% removes
   any dependency on the image's own intrinsic size, so every slide is
   always exactly one viewport wide no matter the photo's shape. */
.gallery-slide {
  width: 100%;
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: zoom-in;
}
.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}
.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: 1px solid rgba(0,0,0,0.15);
}
.gallery-dot.active {
  background: #fff;
  transform: scale(1.3);
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  color: #333;
  transition: background 0.15s;
}
.gallery-arrow:hover { background: #fff; }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* ── Mark as Sold modal animations ── */
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Closed/sold chat items in list ── */
.chat-item-closed {
  opacity: 0.7;
}
.chat-item-closed:hover {
  background: #fafafa;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT DESCRIPTION — SEE MORE / SEE LESS  +  BRAND NAME OVERFLOW
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Description paragraph — always contained ───────────────────────────── */
.product-details #productDescription {
  /* Stay inside the 16px side padding of .product-details */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;

  /* Base readable style */
  font-size: 0.9rem;
  color: #555;
  line-height: 1.65;

  /* No bottom margin when collapsed — the button provides spacing */
  margin-bottom: 0;

  /* Prevent any word (URL, hash, etc.) from bursting the container */
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Collapsed: 4-line clamp with a soft fade so user knows there's more */
.product-details #productDescription.mk-desc-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Fade the last line away */
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
          mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Expanded: full text, no clamp, comfortable bottom gap before purchase btns */
.product-details #productDescription.expanded {
  display: block;          /* remove -webkit-box */
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-mask-image: none;
          mask-image: none;
  margin-bottom: 4px;
}

/* ── See more / See less button ─────────────────────────────────────────── */
.mk-desc-toggle-btn {
  /* Stays in normal document flow, directly after the <p> */
  display: block;           /* full-width so tap target is easy */
  width: 100%;
  box-sizing: border-box;

  /* Spacing: small top gap from the faded text, bigger bottom gap before chips */
  padding: 6px 0 10px;
  margin: 0;                /* .product-details already has 16px side padding */

  background: none;
  border: none;
  text-align: left;

  color: #19378C;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.15s;

  /* Chevron arrow via CSS — no icon font needed */
  display: flex;
  align-items: center;
  gap: 4px;
}

.mk-desc-toggle-btn::after {
  content: '▾';
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}

.mk-desc-toggle-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.mk-desc-toggle-btn:hover  { opacity: 0.7; }
.mk-desc-toggle-btn:active { opacity: 0.45; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT GALLERY REDESIGN — image card + side thumbnail rail + on-image chips
   ═══════════════════════════════════════════════════════════════════════════ */
.product-media {
  display: flex;
  gap: 8px;
  padding: 10px 10px 0;
  background: #fff;
}
.product-gallery-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
}
/* #productImages carries BOTH .product-img-wrap AND .product-gallery-main.
   .product-img-wrap alone no longer sets any height clamp (removed above —
   it used to, and that fought aspect-ratio:4/5 below, silently changing the
   box's real rendered shape depending on container width instead of
   staying a stable 4:5). This rule is now just a safety net in case a
   clamp like that ever gets reintroduced on .product-img-wrap elsewhere:
   aspect-ratio stays the only thing deciding this box's height, so every
   listing gets the same fixed box and object-fit:cover below always has
   one consistent shape to crop into. */
.product-img-wrap.product-gallery-main {
  min-height: 0;
  max-height: none;
}
/* Browser handles all cropping/centering natively — no JS, no backdrop
   layer. object-fit:cover scales the photo up just enough to fill the
   (now-stable) box, crops evenly off whichever pair of edges overflows,
   and object-position:center keeps it centered. */
.product-gallery-main img,
.product-gallery-main .gallery-slide img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  position: relative;
  z-index: 1;
  cursor: zoom-in;
}
.product-gallery-main .product-gallery,
.product-gallery-main .gallery-track,
.product-gallery-main .gallery-slide {
  height: 100%;
}
.gallery-badges {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 78%;
  z-index: 6;
}
.gallery-badges .product-detail-chip {
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border: none;
}
.gallery-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  z-index: 6;
  pointer-events: none;
}
.product-gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 60px;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.product-gallery-thumbs::-webkit-scrollbar { display: none; }
.product-gallery-thumbs .thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f0f0f0;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: border-color 0.15s, opacity 0.15s;
}
.product-gallery-thumbs .thumb.active { border-color: #19378C; opacity: 1; }
.product-gallery-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 6 slides (5 photos + 1 video) is the maximum a listing can have. At the
   default 60px thumb size, 6 of them (330px + gaps ≈ 400px) don't fit
   within the main gallery's height on most common phone widths (a 4:5
   aspect-ratio image is only ~330-380px tall in the 360-390px screen-width
   range) — meaning the 6th thumbnail, always the video since it's appended
   last, would sit below the fold and need a scroll to discover. Shrinking
   to 50px/6px-gap when there are 6 slides (330px total) fits comfortably
   even on the smallest common screens, so the video thumbnail is always
   visible without scrolling. Applied via JS in updateProductPage's thumb
   rendering, based on slides.length. */
.product-gallery-thumbs.compact { width: 50px; gap: 6px; }
.product-gallery-thumbs.compact .thumb { width: 50px; height: 50px; border-radius: 10px; }

/* Single-image listings: no thumbs to show — collapse the rail so the
   main photo goes full-width and is actually centered, instead of being
   shifted left by a reserved-but-empty 60px column + gap. */
.product-gallery-thumbs:empty { display: none; }
.product-media:has(.product-gallery-thumbs:empty) { gap: 0; }

/* ── Description, labeled ─────────────────────────────────────────────── */
.product-desc-section { padding: 4px 0 4px; }
.product-desc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}
.product-desc-header .label { font-weight: 700; font-size: 0.95rem; color: #1a1a2e; }
.product-desc-header .desc-chevron {
  font-size: 20px;
  color: #888;
  transition: transform 0.2s ease;
}
.product-desc-header .desc-chevron.rotated { transform: rotate(180deg); }

/* ── Brand name overflow — home UI ──────────────────────────────────────── */

/* Brand shortcut row circles */
.brand-shortcuts .brand span {
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* Hero banner brand name */
.brand-banner-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hero banner tagline */
.brand-banner-tagline {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Storefront tag on product cards */
.product-seller-tag {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Brand chip on product detail */
.chip-brand {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex !important;
  vertical-align: middle;
}

/* Global last-resort: any unhandled user text */
p, h1, h2, h3, h4, h5, h6, span, li, td, th {
  overflow-wrap: break-word;
}


/* ── Brand Page Header — transparent over hero, opaque on scroll ── */
#brandPageHeader {
  background: transparent !important;
  box-shadow: none !important;
  color: white !important;
}
#brandPageHeader .back-arrow,
#brandPageHeader span {
  color: white !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
#brandPageHeader.scrolled {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
  color: #333 !important;
}
#brandPageHeader.scrolled .back-arrow,
#brandPageHeader.scrolled span {
  color: #333 !important;
  text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════
   BRAND PROFILE PAGE STYLES (merged from brand-profile.html)
   ═══════════════════════════════════════════════════════ */

/* ── Brand Page Hero ── */
#brandPage { padding:0 !important; top:0 !important; overflow-y:auto !important; padding-bottom:0 !important; }
.bp-hero-cover { height:256px; background:linear-gradient(160deg,#19378C 0%,#0f2460 100%); position:relative; overflow:visible; }
.bp-hero-pattern { position:absolute; inset:0; background-image:radial-gradient(circle at 20% 50%,rgba(255,255,255,.06) 0%,transparent 60%),radial-gradient(circle at 80% 20%,rgba(255,255,255,.04) 0%,transparent 50%); }
.bp-logo-wrap { position:absolute; bottom:-70px; left:50%; transform:translateX(-50%); z-index:100; }
.bp-logo-ring { width:140px; height:140px; border-radius:36px; background:white; display:flex; align-items:center; justify-content:center; box-shadow:0 10px 36px rgba(0,0,0,.28); overflow:hidden; border:4px solid white; }
.bp-info { text-align:center; padding:84px 1.5rem 1.25rem; background:white; }
.bp-info h1 { font-size:1.5rem; font-weight:800; color:#1a1a2e; margin-bottom:.35rem; letter-spacing:-.3px; }
.bp-verified-badge { display:inline-flex; align-items:center; gap:4px; background:#dde4f0; color:#19378C; border:1px solid #b8c4e0; border-radius:20px; padding:4px 12px; font-size:11px; font-weight:700; margin-bottom:.8rem; letter-spacing:.3px; }
.bp-verified-badge .material-symbols-rounded { font-size:13px; }
.bp-category-tag { display:inline-block; background:#eef1f9; color:#19378C; border-radius:20px; padding:3px 12px; font-size:11px; font-weight:600; margin-bottom:.85rem; text-transform:capitalize; }
.bp-description { font-size:.87rem; color:#555; line-height:1.6; max-width:400px; margin:0 auto .4rem; overflow-wrap:break-word; }
.bp-desc-toggle { background:none; border:none; color:#19378C; font-size:.78rem; font-weight:600; cursor:pointer; margin:0 auto .75rem; padding:0; display:block; }
.bp-stats { display:flex; justify-content:center; border-top:1px solid #f0f0f0; padding-top:1rem; margin-top:.5rem; }
.bp-stat { flex:1; text-align:center; padding:0 .5rem; border-right:1px solid #f0f0f0; }
.bp-stat:last-child { border-right:none; }
.bp-stat-num { font-size:1.2rem; font-weight:800; color:#19378C; }
.bp-stat-label { font-size:.7rem; color:#888; margin-top:2px; }

/* ── Contact strip ── */
.bp-contact-strip { display:flex; gap:.6rem; padding:.75rem 1rem; background:white; border-top:1px solid #f0f0f0; overflow-x:auto; scrollbar-width:none; }
.bp-contact-strip::-webkit-scrollbar { display:none; }
.contact-btn { display:inline-flex; align-items:center; gap:6px; padding:.55rem 1.1rem; border-radius:24px; font-size:.8rem; font-weight:600; border:none; cursor:pointer; white-space:nowrap; text-decoration:none; transition:all .2s; flex-shrink:0; }
.contact-btn .material-symbols-rounded { font-size:17px; }
.btn-whatsapp { background:#25d366; color:white; }
.btn-whatsapp:hover { background:#1ebe5c; }
.btn-location { background:#eef1f9; color:#19378C; border:1.5px solid #b8c4e0; }
.btn-social { background:#f7f7f7; color:#444; border:1.5px solid #eee; }
.btn-social:hover { background:#eee; }
.btn-call { background:#19378C; color:white; }
.btn-call:hover { background:#0f2460; }

/* ── Button spinner ── */
.bp-btn-spinner { display:inline-block; width:13px; height:13px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:bpSpin .65s linear infinite; vertical-align:middle; flex-shrink:0; }
@keyframes bpSpin { to { transform:rotate(360deg); } }

/* ── Profile / home product card owner action buttons ── */
.product-owner-actions { display:none; gap:5px; padding:5px 8px 8px; }
.product-card.owner-active .product-owner-actions { display:flex; }
.owner-btn { flex:1; padding:5px 8px; border:none; border-radius:8px; font-size:0.72rem; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:3px; transition:opacity .15s; white-space:nowrap; }
.owner-btn:active { opacity:.7; }
.owner-btn-sold   { background:#eef9f0; color:#27ae60; border:1px solid #c8e6c9; }
.owner-btn-delete { background:#fff0f0; color:#e74c3c; border:1px solid #f5c6cb; }

/* ── Live badge on brand / home product cards ── */
/* ── Live badge on product cards ── */
.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(17,17,17,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 3px 8px 3px 6px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 4;
  border: 1px solid rgba(255,255,255,0.15);
}
.live-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  flex-shrink: 0;
  animation: liveDotPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255,59,48,0.7);
}
@keyframes liveDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,48,0.7); }
  70%  { box-shadow: 0 0 0 5px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}
.product-card.live-good {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.product-card.live-good:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.subcategory-product.live-good {
  box-shadow: 0 0 0 1.5px rgba(255,59,48,0.22), 0 2px 6px rgba(0,0,0,0.06);
  border-radius: 10px;
}

/* ── Owner manage strip ── */
.bp-manage-strip { background:#fff3cd; border-top:2px solid #ffc107; padding:.75rem 1rem; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.bp-manage-strip p { font-size:.8rem; color:#856404; font-weight:600; flex:1; }
.bp-manage-btn { padding:.5rem 1rem; border:none; border-radius:8px; font-size:.78rem; font-weight:600; cursor:pointer; background:#19378C; color:white; }

/* ── Tabs ── */
.bp-tab-bar { display:flex; background:white; border-top:1px solid #f0f0f0; border-bottom:1px solid #f0f0f0; overflow-x:auto; scrollbar-width:none; position:sticky; top:0; z-index:50; }
.bp-tab-bar::-webkit-scrollbar { display:none; }
.bp-tab-btn { flex:1; min-width:80px; padding:.75rem .5rem; text-align:center; font-size:.8rem; font-weight:600; color:#888; border:none; background:none; cursor:pointer; border-bottom:2px solid transparent; transition:all .2s; white-space:nowrap; }
.bp-tab-btn.active { color:#19378C; border-bottom-color:#19378C; }

/* ── Brand products grid ── */
.bp-products-section { padding:1rem; }
.bp-products-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; align-items:start; }
/* Same look as the home feed's .product-card — kept as its own class so
   its click handler (opens the in-page product overlay, not the public
   detail page) stays untouched. */
.brand-product-card {
  background: #fff; border-radius: 0; padding: 0.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; overflow: hidden;
  opacity:0; transform:translateY(16px);
}
.brand-product-card.show { opacity:1; transform:translateY(0); transition:opacity .35s,transform .35s; }
.brand-product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.brand-product-card.live-good { box-shadow: 0 0 0 1.5px rgba(255,59,48,0.25), 0 2px 8px rgba(0,0,0,.07); }

.brand-product-card:hover .card-img-wrap img { transform:scale(1.04); }
.card-discount-badge { position:absolute; top:8px; right:8px; background:#f39c12; color:white; font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px; }

/* "Sold" overlay badge — same placement/weight as .card-discount-badge,
   used on the seller's own goods cards (Makay table) since the home
   feed never shows sold items. */
.sold-badge {
  position: absolute; top: 8px; right: 8px;
  background: #e74c3c; color: white;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.4px;
  z-index: 4;
}
.sold-overlay { position:absolute; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; }
.sold-overlay span { background:#e74c3c; color:white; padding:5px 14px; border-radius:20px; font-size:12px; font-weight:700; }
.card-body { padding: 0; display: flex; flex-direction: column; flex: 1; }
.card-name { font-size: 0.8rem; font-weight: 500; color: #1a1a2e; margin: 0 0 2px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-price-row { margin-top: auto; padding-top: 2px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.card-price { font-size: 1rem; font-weight: 900; color: #19378C; letter-spacing: -0.3px; }
.card-meta { font-size:.7rem; color:#aaa; margin-top:3px; text-transform:capitalize; }
.card-owner-actions { display:none; gap:6px; padding:6px 8px 4px; }
.brand-product-card.owner-active .card-owner-actions { display:flex; }
.bp-empty-state { text-align:center; padding:3rem 1.5rem; color:#aaa; grid-column:1/-1; }
.bp-empty-state .material-symbols-rounded { font-size:56px; opacity:.25; display:block; margin-bottom:.75rem; }

/* ── Edit brand modal ── */
#bpEditModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,0.45);
  align-items: flex-end;
  justify-content: center;
  transition: background 0.28s ease;
}
#bpEditModal.open { display: flex; }

/* Mobile: slide up from bottom, same as notifications panel */
.bp-edit-sheet {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(1.5rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -6px 32px rgba(0,0,0,0.18);
}
#bpEditModal.open .bp-edit-sheet { transform: translateY(0); }

/* Drag handle — same as notif panel mobile handle */
.bp-edit-head {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 24px 1.25rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.bp-edit-head::before {
  content: '';
  display: block;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: #e0e0e0;
}
.bp-edit-title { font-weight: 800; font-size: 1rem; color: #1a1a2e; }
.bp-edit-sub   { font-size: .75rem; color: #888; margin-top: 2px; }
.bp-edit-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.bp-edit-close:hover { background: #f5f5f5; color: #333; }
.bp-edit-body  { padding: 1rem 1.25rem; }
.bp-edit-group { margin-bottom: 1rem; }
.bp-edit-group label { display: block; font-size: .82rem; font-weight: 600; color: #444; margin-bottom: .4rem; }
.bp-edit-group input, .bp-edit-group textarea, .bp-edit-group select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid #e0e4ed;
  border-radius: 10px;
  font-size: .9rem;
  font-family: Inter, sans-serif;
  outline: none;
  background: #fafbfd;
  transition: border-color 0.15s;
}
.bp-edit-group input:focus, .bp-edit-group textarea:focus, .bp-edit-group select:focus {
  border-color: #19378C;
}
.bp-edit-group textarea { resize: vertical; min-height: 90px; }
.bp-edit-social { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.bp-edit-logo-area {
  border: 2px dashed #c8d4e8;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: #fafbfd;
}
.bp-edit-logo-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.bp-edit-error {
  display: none;
  background: #fff0f0;
  border: 1px solid #ffc0c0;
  color: #c0392b;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .83rem;
  margin-bottom: 1rem;
}
.bp-edit-submit {
  width: 100%;
  padding: .95rem;
  background: linear-gradient(135deg, #19378C, #0f2460);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(25,55,140,.3);
  transition: opacity 0.15s;
}
.bp-edit-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Desktop: show as centered modal */
@media (min-width: 601px) {
  #bpEditModal { align-items: center; }
  .bp-edit-sheet {
    border-radius: 20px;
    max-height: 85dvh;
    box-shadow: 0 8px 48px rgba(0,0,0,0.22);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s ease;
  }
  #bpEditModal.open .bp-edit-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  .bp-edit-head::before { display: none; }
  .bp-edit-head { padding-top: 1.25rem; }
}


/* ═══════════════════════════════════════════════════════
   BRAND SIGNUP PAGE STYLES (merged from brand-signup.html)
   ═══════════════════════════════════════════════════════ */

/* ── Brand Signup Section ── */
#brandSignup { padding:0 !important; top:0 !important; overflow-y:auto !important; padding-bottom:0 !important; background:#f5f7fa; }
.bs-hero { margin-top:56px; background:linear-gradient(135deg,#19378C 0%,#0f2460 100%); padding:2.5rem 1.5rem 2rem; text-align:center; color:white; }
.bs-hero-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(255,255,255,.15); backdrop-filter:blur(6px); border:1px solid rgba(255,255,255,.25); border-radius:20px; padding:5px 14px; font-size:12px; font-weight:600; margin-bottom:1rem; letter-spacing:.5px; }
.bs-hero h1 { font-size:1.6rem; font-weight:800; margin-bottom:.6rem; line-height:1.2; }
.bs-hero p { font-size:.9rem; opacity:.85; max-width:300px; margin:0 auto; line-height:1.5; }
.bs-perks { display:flex; gap:.6rem; padding:1rem 1rem 0; overflow-x:auto; scrollbar-width:none; }
.bs-perks::-webkit-scrollbar { display:none; }
.bs-perk-card { background:white; border-radius:12px; padding:.9rem 1rem; min-width:130px; flex-shrink:0; text-align:center; box-shadow:0 2px 8px rgba(0,0,0,.06); border:1.5px solid #eef0f5; }
.bs-perk-icon { width:40px; height:40px; border-radius:12px; background:linear-gradient(135deg,#e8f0ff,#c8d8ff); display:flex; align-items:center; justify-content:center; margin:0 auto .5rem; }
.bs-perk-icon .material-symbols-rounded { font-size:20px; color:#19378C; }
.bs-perk-card h4 { font-size:.78rem; font-weight:700; color:#1a1a2e; margin-bottom:3px; }
.bs-perk-card p { font-size:.7rem; color:#666; line-height:1.3; }
.bs-form-card { background:white; margin:1rem; border-radius:16px; padding:1.5rem; box-shadow:0 2px 12px rgba(0,0,0,.07); border:1px solid #eef0f5; }
.bs-section-head { font-size:1rem; font-weight:700; margin-bottom:1.25rem; color:#1a1a2e; display:flex; align-items:center; gap:8px; }
.bs-section-head .material-symbols-rounded { font-size:20px; color:#19378C; }
.bs-form-group { margin-bottom:1.1rem; }
.bs-form-group label { display:block; font-size:.82rem; font-weight:600; color:#444; margin-bottom:.4rem; }
.bs-form-group input,.bs-form-group textarea,.bs-form-group select { width:100%; padding:.7rem .9rem; border:1.5px solid #e0e4ed; border-radius:10px; font-size:.9rem; font-family:Inter,sans-serif; background:#fafbfd; color:#1a1a2e; outline:none; transition:border-color .2s,box-shadow .2s; }
.bs-form-group input:focus,.bs-form-group textarea:focus { border-color:#19378C; box-shadow:0 0 0 3px rgba(25,55,140,.1); }
.bs-form-group textarea { resize:vertical; min-height:90px; }
.bs-form-hint { font-size:.73rem; color:#888; margin-top:.3rem; }
.bs-logo-area { border:2px dashed #c8d4e8; border-radius:12px; padding:1.5rem; text-align:center; cursor:pointer; transition:all .2s; background:#fafbfd; position:relative; }
.bs-logo-area:hover { border-color:#19378C; background:#eef1f9; }
.bs-logo-area input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.bs-logo-preview-wrap { display:none; flex-direction:column; align-items:center; gap:.5rem; }
.bs-logo-preview-wrap img { width:80px; height:80px; border-radius:16px; object-fit:cover; box-shadow:0 4px 12px rgba(0,0,0,.12); }
.bs-social-row { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.bs-section-divider { height:1px; background:#eef0f5; margin:.5rem 0 1.25rem; }
.bs-cat-grid { display:grid; grid-template-columns:repeat(2,1fr); }
.bs-cat-tile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:.9rem .5rem; cursor:pointer; border:1px solid #eef0f5; transition:all .18s; font-size:.78rem; font-weight:600; color:#444; text-align:center; }
.bs-cat-tile:hover { background:#eef1f9; color:#19378C; }
.bs-cat-tile.selected { background:#19378C; color:#fff; border-color:#19378C; }
.bs-cat-icon { font-size:22px; color:#19378C; transition:color .18s; }
.bs-cat-tile.selected .bs-cat-icon { color:#fff; }
.bs-subcat-grid { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.bs-subcat-chip { display:flex; align-items:center; gap:5px; padding:.45rem .85rem; border:1.5px solid #dde2ef; border-radius:20px; font-size:.78rem; font-weight:500; cursor:pointer; transition:all .18s; background:#fafbfd; color:#555; user-select:none; }
.bs-subcat-chip:hover { border-color:#19378C; color:#19378C; background:#eef1f9; }
.bs-subcat-chip.selected { background:#19378C; color:#fff; border-color:#19378C; }
.bs-submit-btn { width:100%; padding:.95rem; background:linear-gradient(135deg,#19378C,#0f2460); color:white; border:none; border-radius:12px; font-size:1rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:all .2s; box-shadow:0 4px 14px rgba(25,55,140,.3); margin-top:.5rem; }
.bs-submit-btn:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(25,55,140,.4); }
.bs-submit-btn:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.bs-error-msg { display:none; background:#fff0f0; border:1px solid #ffc0c0; color:#c0392b; padding:.75rem 1rem; border-radius:8px; font-size:.83rem; margin-top:.75rem; }
.bs-error-msg.visible { display:block; }
.bs-info-card { text-align:center; padding:3rem 1.5rem; }
.bs-info-card .material-symbols-rounded { font-size:56px; color:#ddd; display:block; margin-bottom:1rem; }
.bs-info-card h2 { color:#1a1a2e; margin-bottom:.5rem; font-size:1.2rem; }
.bs-info-card p { color:#888; font-size:.88rem; margin-bottom:1.5rem; line-height:1.5; }
.bs-info-btn { display:inline-flex; align-items:center; gap:8px; padding:.8rem 2rem; background:#19378C; color:white; border:none; border-radius:10px; font-size:.9rem; font-weight:600; cursor:pointer; text-decoration:none; }
.bs-info-btn:hover { background:#0f2460; }
.bs-success-screen { display:none; text-align:center; padding:3rem 1.5rem; }
.bs-success-screen .bs-success-circle { width:90px; height:90px; border-radius:50%; background:linear-gradient(135deg,#27ae60,#1e8449); display:flex; align-items:center; justify-content:center; margin:0 auto 1.5rem; box-shadow:0 8px 24px rgba(39,174,96,.3); }
.bs-success-screen .bs-success-circle .material-symbols-rounded { font-size:44px; color:white; }
.bs-success-screen h2 { font-size:1.4rem; font-weight:800; color:#1a1a2e; margin-bottom:.75rem; }
.bs-success-note { background:#eef1f9; border:1px solid #b8c4e0; border-radius:10px; padding:1rem; margin:1.5rem 0; font-size:.82rem; color:#19378C; line-height:1.5; }


/* ── Plastay items ── */
.plastay-item { display:flex; align-items:center; gap:.75rem; background:white; border-radius:12px; padding:.75rem; margin-bottom:.75rem; box-shadow:0 2px 8px rgba(0,0,0,.06); cursor:pointer; transition:transform .2s; }
.plastay-item:hover { transform:translateY(-2px); }
.plastay-item-img { width:64px; height:64px; border-radius:10px; object-fit:cover; flex-shrink:0; }
.plastay-item-info { flex:1; min-width:0; }
.plastay-item-name { font-weight:600; font-size:.9rem; color:#2c3e50; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plastay-item-cond { font-size:.75rem; color:#888; margin-top:2px; }
.plastay-item-price { font-size:.95rem; font-weight:700; color:#19378C; margin-top:4px; }
.plastay-remove-btn { background:none; border:none; cursor:pointer; color:#e74c3c; padding:6px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.plastay-remove-btn:hover { background:#fff0f0; }

/* ── Shared slideUp animation ── */
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }


/* ── Profile Page (merged from profile.css) ── */
/* Profile Page */

/* Unauthenticated Profile */

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: #666;
  font-size: 2rem;
}

.profile-message {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.create-account-btn {
  background: linear-gradient(135deg, #0057b8 0%, #00a8ff 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 2rem;
  box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
  transition: all 0.3s ease;
  min-width: 200px;
}

.create-account-btn:hover {
  background: linear-gradient(135deg, #004494 0%, #0080cc 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 87, 184, 0.4);
}

.guest-features {
  margin-top: 1rem;
}

.guest-feature-item {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #e8f4fd 0%, #d3e8fc 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0057b8;
  font-size: 1.2rem;
}

.feature-text h4 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #333;
}

.feature-text p {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.3;
}

/* Profile Menu List */

.profile-me

/* ═══════════════════════════════════════════════════════
   Stock & Colors — Patch D additions
   ═══════════════════════════════════════════════════════ */

/* ── Restock / info button in manage modal ── */
.manage-btn-info {
  background: #19378C;
  color: #fff;
  font-weight: 700;
}
.manage-btn-info:active { opacity: 0.82; }

/* ── Product detail stock chip area ── */
#productStockInfo {
  padding: 0 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Extra owner buttons spacing on product page ── */
.purchase-section .add-to-plastay-btn + .add-to-plastay-btn {
  margin-top: 8px;
}
#productEditBtn,
#productRestockBtn {
  background: #f0f3fa;
  color: #19378C;
  border: 1.5px solid #c8d4ef;
}

/* ═══════════════════════════════════════════════════════
   Stock Mode Toggle — Unlimited / Single / Multi picker
   ═══════════════════════════════════════════════════════ */

.stock-mode-toggle {
  display: flex;
  gap: 6px;
  background: #f0f2f7;
  border-radius: 12px;
  padding: 4px;
}

.stock-mode-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.stock-mode-btn.active {
  background: #fff;
  color: #19378C;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.stock-mode-btn:not(.active):active {
  background: #e8ebf4;
}

/* ═══════════════════════════════════════════════════════
   Context Menu — 3-dot dropdown (brand page + cards)
   ═══════════════════════════════════════════════════════ */

.mk-ctx-menu {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  min-width: 210px;
  overflow: hidden;
  animation: ctxFadeIn 0.15s ease;
  border: 1px solid rgba(0,0,0,0.07);
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.93) translateY(-6px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.mk-ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.mk-ctx-menu-item:active,
.mk-ctx-menu-item:hover {
  background: #f4f6fb;
}

.mk-ctx-menu-item.danger { color: #e74c3c; }

.mk-ctx-menu-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 2px 0;
}

/* ── 3-dot button on browse cards ── */
.product-card-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  background: rgba(0,0,0,0.42);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.product-card:hover .product-card-menu-btn,
.product-card-menu-btn:focus {
  opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
  .product-card-menu-btn { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════════
   Unified Post / Edit Goods page (#postGoods)
   One full-screen page for creating AND editing a listing — personal or
   branded. See index.html #postGoods and nav.js#openGoodsForm().
   ══════════════════════════════════════════════════════════════════════ */

/* #postGoods inherits the app's generic section top/side padding
   (header offset + 1rem) — see "All other sections" rule in this file. */
#postGoods { background: #f6f7fb; min-height: 100%; padding-bottom: 0 !important; }
.pg-form { max-width: 560px; margin: 0 auto; }

/* ── Header ── */
.header-goods-form {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  padding: 0 0.9rem;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; gap: 10px;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  border-bottom: 1px solid #eef0f5;
  height: calc(56px + env(safe-area-inset-top, 0px));
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}
.header-goods-form.hidden { display: none; }
.pg-back-btn {
  background: #f5f6fa; border: none; border-radius: 50%;
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #333; transition: background 0.15s;
}
.pg-back-btn:active { background: #e9ebf3; }
.pg-back-btn .material-symbols-rounded { font-size: 20px; }
.pg-header-titles { flex: 1; min-width: 0; text-align: center; }
.pg-header-title { font-size: 1.02rem; font-weight: 800; color: #14213d; line-height: 1.2; letter-spacing: -0.01em; }
.pg-header-subtitle { font-size: 0.72rem; color: #9295a3; margin-top: 1px; }

/* ── Page container ── */

/* ── Owner badge: "Posting as: X" ── */
.pg-owner-badge {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid #e4e7f3;
  color: #19378C; font-size: 0.85rem; font-weight: 700;
  border-radius: 14px; padding: 11px 14px; margin: 0 0 14px;
  box-shadow: 0 1px 2px rgba(20,33,61,0.04);
}
.pg-owner-badge .material-symbols-rounded {
  font-size: 17px; background: #eef1fb; color: #19378C;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Status strip (edit mode only) ── */
.pg-status-strip { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.pg-status-date { font-size: 11.5px; color: #a3a6b3; font-weight: 600; }

/* ── Cards ── */
.pg-card {
  background: #fff; border: 1px solid #eef0f5; border-radius: 18px;
  padding: 1.25rem; margin: 0 0 1rem;
  box-shadow: 0 1px 3px rgba(20,33,61,0.03);
}
.pg-field { margin-bottom: 1.1rem; }
.pg-field:last-child { margin-bottom: 0; }
.pg-field label {
  display: block; margin-bottom: 0.4rem; font-weight: 700;
  font-size: 0.82rem; color: #14213d; letter-spacing: -0.01em;
}
.pg-field label .req { color: #e0524f; font-weight: 700; }
.pg-field input,
.pg-field textarea,
.pg-field select {
  width: 100%; padding: 0.72rem 0.85rem; border: 1.5px solid #e7e9f0;
  border-radius: 12px; font-size: 0.9rem; font-family: inherit; color: #1a1a2e;
  background: #fbfbfd; box-sizing: border-box; transition: border-color 0.15s, background 0.15s;
}
.pg-field input::placeholder,
.pg-field textarea::placeholder { color: #b3b6c2; }
.pg-field input:focus,
.pg-field textarea:focus,
.pg-field select:focus {
  outline: none; border-color: #19378C; background: #fff;
  box-shadow: 0 0 0 3px rgba(25,55,140,0.08);
}
.pg-field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.pg-field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.2rem;
}
.pg-field select:disabled { color: #b3b6c2; background-color: #f5f5f8; cursor: not-allowed; }

.pg-row { display: flex; gap: 12px; }
.pg-row .pg-field { flex: 1; min-width: 0; }

/* Slightly bolder than a regular field so a typed price is easy to read,
   without standing out as an oversized element on the page. */
.pg-field #itemPrice {
  font-weight: 600;
}
.pg-field .price-currency-row select {
  font-weight: 600;
}

.pg-field-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.pg-field-header label { margin: 0; }
.pg-photo-count { font-size: 0.78rem; color: #9295a3; font-weight: 600; }
.pg-hint-line { font-size: 0.78rem; color: #9295a3; margin-bottom: 0.85rem; line-height: 1.4; }

.condition-hint { font-size: 0.75rem; color: #9295a3; margin-top: 0.4rem; line-height: 1.4; }

/* ── Photo grid ── */
.image-upload-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-photo-add {
  width: 78px; height: 78px; border-radius: 14px;
  border: 1.5px dashed #c7cef0; background: #f6f7ff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; flex-shrink: 0; transition: background 0.15s;
  font-size: 0.62rem; font-weight: 700; color: #19378C; text-align: center;
}
.pg-photo-add:active { background: #eceffd; }
.pg-photo-add .material-symbols-rounded { font-size: 23px; }
.image-upload-grid .image-preview-strip {
  display: contents; /* let preview tiles sit in the same flex row as Add Photo */
}
.image-upload-grid .preview-img-wrap {
  width: 78px; height: 78px; border-radius: 14px; flex-shrink: 0;
}

.pg-tips {
  display: flex; gap: 9px; align-items: flex-start;
  background: #fffbf0; border: 1px solid #f7ecc9; border-radius: 12px;
  padding: 11px 13px; margin-top: 14px;
  font-size: 0.78rem; color: #7a6a2f; line-height: 1.45;
}
.pg-tips .material-symbols-rounded { font-size: 16px; color: #e6a917; flex-shrink: 0; margin-top: 1px; }
.pg-tips strong { color: #4a3f16; }

/* ── Video upload tile (post-goods form) ── */
.pg-video-preview-wrap {
  position: relative;
  width: 78px; height: 78px; border-radius: 14px; flex-shrink: 0;
  overflow: visible;
}
.pg-video-thumb {
  width: 78px; height: 78px; object-fit: cover;
  border-radius: 14px; border: 2px solid #e0e0e0; display: block;
  background: #10131f;
}
.pg-video-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; font-size: 28px; pointer-events: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

/* ── Voice description recorder (post-goods form) ── */
.pg-voice-recorder {
  display: flex; align-items: center; gap: 12px;
  background: #f6f7ff; border: 1.5px dashed #c7cef0; border-radius: 14px;
  padding: 12px 16px;
}
.pg-voice-recorder.is-recording { background: #fff3f3; border-color: #f0b8bc; }
.pg-voice-record-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  border: none; background: #19378C; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.pg-voice-record-btn:active { transform: scale(0.94); }
.pg-voice-record-btn.recording { background: #d63b45; animation: pgVoicePulse 1.4s ease-in-out infinite; }
.pg-voice-record-btn .material-symbols-rounded { font-size: 20px; }
@keyframes pgVoicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214,59,69,0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(214,59,69,0); }
}
.pg-voice-hint { font-size: 0.85rem; font-weight: 600; color: #555; font-variant-numeric: tabular-nums; }

.pg-voice-preview-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #f6f7ff; border: 1.5px solid #c7cef0; border-radius: 14px;
  padding: 10px 12px 10px 10px;
}
.pg-voice-play-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: none; background: #19378C; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pg-voice-play-btn .material-symbols-rounded { font-size: 18px; }
.pg-voice-label { flex: 1; font-size: 0.82rem; font-weight: 600; color: #333; }
.pg-voice-preview-wrap .preview-remove { position: static; flex-shrink: 0; background: #fff; color: #777; border: 1px solid #e2e5f0; }

/* ── Voice Description — compact icon (product page, next to price) ── */
.product-audio-icon-btn {
  margin-left: auto;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: #e8ebfa;
  color: #19378C;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.product-audio-icon-btn:active { transform: scale(0.94); }
.product-audio-icon-btn .material-symbols-rounded { font-size: 21px; }
.product-audio-icon-btn.playing {
  background: #19378C; color: #fff;
  animation: productAudioPulse 1.6s ease-in-out infinite;
}
@keyframes productAudioPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(25,55,140,0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(25,55,140,0); }
}

/* ── Gallery video slide + thumbnail (product page) ── */
.gallery-slide-video { background: #000; }
.gallery-slide-video video { width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
.gallery-video-playbtn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  opacity: 0; pointer-events: none; /* hidden until the video is actually ready — see .is-ready below */
  transition: opacity 0.2s ease;
}
.gallery-video-playbtn .material-symbols-rounded { font-size: 30px; }
.gallery-video-playbtn:active { transform: translate(-50%, -50%) scale(0.94); }

/* Loading spinner — shown until the video reports it can actually play,
   with an 8s JS safety-net fallback (see updateProductPage) in case the
   browser never fires the loading events at all. */
.gallery-video-spinner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2; pointer-events: none;
  opacity: 1; transition: opacity 0.2s ease;
}
.gallery-video-spinner .btn-spinner {
  width: 30px; height: 30px; border-width: 3px;
  border-color: rgba(255, 255, 255, 0.25); border-top-color: #fff;
}

.gallery-slide-video.is-ready .gallery-video-spinner { opacity: 0; }
.gallery-slide-video.is-ready .gallery-video-playbtn { opacity: 1; pointer-events: auto; }
/* While actually playing, the button gets out of the way — tapping the
   video itself (its own onclick, above) pauses it instead. */
.gallery-slide-video.is-playing .gallery-video-playbtn { opacity: 0; pointer-events: none; }
.thumb-video { position: relative; background: #10131f; }
.thumb-video video { width: 100%; height: 100%; object-fit: cover; }
.thumb-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; font-size: 20px; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}


/* ── Stock mode / management row ── */
.pg-manage-row { display: flex; gap: 8px; }

/* ── Submit button — last element in the normal document flow, not sticky ── */
.pg-submit-row {
  padding: 0.4rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
.pg-submit-btn {
  width: 100%; border: none; border-radius: 12px;
  background: linear-gradient(90deg, #19378C, #2c52c4);
  color: #fff; font-weight: 700; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.85rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(25,55,140,0.25);
  transition: transform 0.1s, box-shadow 0.1s;
}
.pg-submit-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(25,55,140,0.2); }
.pg-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
