/* Public product catalog */
.catalog-shell {
  width: 100%;
  max-width: none;
  border: 1px solid #e7ece6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(24, 62, 45, .045);
  padding: clamp(1.25rem, 2.4vw, 2.125rem);
}
.catalog-wrapper {
  margin: 26px 0 0;
  padding-bottom: 0;
  scroll-margin-top: 100px;
}

.catalog-content {
  padding: 0 0 48px;
}
.catalog-toolbar,
.catalog-filter-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.catalog-toolbar { flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.catalog-toolbar h1 {
  margin: 0 0 5px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  color: #0f4c36;
}
.catalog-toolbar-heading p {
  margin: 0;
  color: #66776c;
  font-size: clamp(.88rem, 1.3vw, 1rem);
}
.catalog-search-wrap { position: relative; display: block; width: min(100%, 720px); }
.catalog-search-wrap i {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  color: #6c8072;
  pointer-events: none;
}
.catalog-search-input {
  width: 100%;
  height: 50px;
  padding: 10px 18px 10px 47px;
  border: 1px solid #d7e2d8;
  border-radius: 999px;
  outline: none;
  background: #fff;
  color: #1b3d2e;
  font: inherit;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.catalog-search-input:focus { border-color: #2e7651; box-shadow: 0 0 0 3px rgba(46, 118, 81, .14); }
.catalog-filter-row { align-items: center; margin: 22px 0 20px; padding-bottom: 18px; border-bottom: 1px solid #dce6df; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.catalog-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 5px 9px 5px 6px;
  border: 1px solid #dbe7de;
  border-radius: 999px;
  background: #f8fbf8;
  color: #285840;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 62, 45, .035);
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.catalog-filter:hover { border-color: #a9cbb2; background: #f0f7f1; transform: translateY(-1px); }
.catalog-filter.active { border-color: #d4e8d8; background: #e5f3e7; color: #164d35; }
.catalog-filter:focus-visible { outline: 3px solid #a9c9a4; outline-offset: 2px; }
.catalog-filter-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #d5e4d8; border-radius: 50%; color: #1c5b3e; background: #fff; font-size: 17px; }
.catalog-filter.active .catalog-filter-icon { border-color: #1d6143; color: #fff; background: #14563a; }
.catalog-filter-label { white-space: nowrap; }

.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.catalog-empty {
  grid-column: 1 / -1;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  border: 1px dashed #cadbcd;
  border-radius: 14px;
  background: #fff;
  color: #64786a;
  text-align: center;
}
.catalog-empty i { font-size: 25px; color: #6f9b76; }

.catalog-grid .product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e9df;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(27, 67, 41, .035);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  height: 100%;
}
.catalog-grid .product-card:hover { transform: translateY(-2px); border-color: #c4d9c6; box-shadow: 0 8px 20px rgba(27, 67, 41, .09); }
.product-media {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8faf7;
}
.catalog-grid .product-img {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.catalog-grid .product-img-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #84978b; font-size: 12px;
}
.catalog-grid .product-img-placeholder i { font-size: 38px; line-height: 1; color: #a8bdae; }
.catalog-featured-badge {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff;
  color: #276340;
  box-shadow: 0 2px 10px rgba(20, 55, 36, .1);
  font-size: 11px;
  font-weight: 700;
}
.catalog-grid .product-body { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: 0; padding: 17px 18px 18px; }
.catalog-grid .product-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.catalog-grid .product-name { min-width: 0; margin: 0; color: #1d4b36; font-size: 16px; font-weight: 700; line-height: 1.3; }
.catalog-grid .product-desc {
  min-height: 40px;
  margin: 0 0 14px;
  color: #697b70;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-grid .product-price-row { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; margin-top: auto; }
.catalog-grid .product-price { color: #183e2d; font-size: 20px; font-weight: 700; line-height: 1.2; }
.catalog-grid .product-unit { color: #7b8b7f; font-size: 13px; }
.catalog-grid .product-stock {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.catalog-grid .product-stock i { font-size: 12px; line-height: 1; }
.catalog-grid .product-stock.in-stock { background: #e5f1e5; color: #276440; }
.catalog-grid .product-stock.out-of-stock { background: #f2f3f0; color: #67746a; }

.discounted-stock-section { margin-top: 34px; padding-top: 30px; border-top: 1px solid #dfe9df; }
.discounted-stock-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.discounted-stock-title-wrap { display: flex; align-items: center; gap: 13px; min-width: 0; }
.discounted-stock-heading-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #fff2d9; color: #a05a0a; font-size: 18px; }
.discounted-stock-heading h2 { margin: 2px 0 0; color: #1d4b36; font-size: clamp(20px, 2.2vw, 25px); line-height: 1.2; }
.discounted-stock-notice { display: flex; flex: 0 1 520px; align-items: center; gap: 16px; min-width: 500px; padding: 12px 17px; border: 1px solid #f0dfbd; border-radius: 12px; background: linear-gradient(110deg, #fffdfa, #fff9ed); }
.discounted-stock-notice-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-right: 1px solid #eddcb8; color: #b76908; font-size: 17px; }
.discounted-stock-notice-icon i { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #b76908; color: #fff; font-size: 15px; font-weight: 800; }
.discounted-stock-notice p { display: flex; flex-direction: column; gap: 2px; margin: 0; color: #66766a; font-size: 13px; line-height: 1.45; text-align: left; }
.discounted-stock-notice p span { white-space: nowrap; }
.discounted-stock-notice p span:first-child { color: #8b520d; font-weight: 600; }
.discounted-stock-kicker { color: #a05a0a; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.discounted-stock-grid { align-items: stretch; }
.catalog-grid .discounted-stock-card { border-color: #dfd1ae; background: #fff; }
.discounted-stock-media { aspect-ratio: 16 / 9; background: linear-gradient(145deg, #f7faf5, #eef5ec); }
.discounted-media-badge { background: #fff3d9; color: #8b520d; }
.discounted-stock-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #31694b; }
.discounted-stock-placeholder i { font-size: 52px; line-height: 1; color: #4a805e; }
.discounted-stock-placeholder span { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.catalog-grid .discounted-condition { min-height: 40px; }
.discounted-inquiry-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 13px; padding: 10px 14px; border: 0; border-radius: 9px; background: #245f43; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s; }
.discounted-inquiry-btn:hover { background: #194b34; }
.discounted-inquiry-btn:focus-visible { outline: 3px solid #a9c9a4; outline-offset: 2px; }
.feed-use-panel { grid-column: span 2; display: flex; flex-direction: column; min-height: 100%; padding: 22px; border: 1px solid #dce8dc; border-radius: 14px; background: linear-gradient(145deg, #f9fcf7, #eef6ec); color: #284c38; }
.feed-use-panel-head { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.feed-use-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #dceedd; color: #2c6943; font-size: 18px; }
.feed-use-kicker { color: #6b806f; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.feed-use-panel h3 { margin: 2px 0 0; color: #183e2d; font-size: 19px; }
.feed-use-grid { display: grid; flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(7rem, 1fr); gap: 12px; }
.feed-use-card { display: flex; align-items: center; gap: 12px; min-height: 0; padding: 16px; border: 1px solid #dae7d9; border-radius: 11px; background: rgba(255, 255, 255, .78); }
.feed-use-card > i { display: grid; flex: 0 0 33px; width: 33px; height: 33px; place-items: center; border-radius: 9px; background: #e4f1e2; color: #2f6e48; font-size: 15px; }
.feed-use-card div { display: flex; flex-direction: column; gap: 3px; }
.feed-use-card strong { color: #244c36; font-size: 13px; }
.feed-use-card span { color: #64786a; font-size: 12.5px; line-height: 1.5; }
.feed-use-panel > p { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #d9e7d8; color: #65796b; font-size: 13px; line-height: 1.5; }

/* ── CATALOG PAGINATION ── */
.catalog-products-wrap .pagination-bar {
  margin-top: 32px;
  padding-top: 16px;
}

/* ── CONTACT ── */
.contact-wrapper {
  margin: clamp(2rem, 4vw, 3rem) 0 36px;
}

.contact-header-wrap {
  margin-bottom: 22px;
}

.contact-wrapper h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  margin-bottom: 0;
  color: var(--text-dark);
}

/* Contact Cards Stack */
.contact-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  justify-content: space-between;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: stretch;
}

.contact-details-column,
.contact-map-column { min-width: 0; }

.contact-details-column { display: flex; flex-direction: column; }

.contact-card-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fbfdfb;
  border: 1.5px solid #e5ece6;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.contact-card-item:hover {
  background: #f2f7f3;
  border-color: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 90, 61, 0.08);
}

.contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eaf5ec;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.contact-card-item:hover .contact-card-icon {
  background: var(--green-dark);
  color: #fff;
}

.contact-card-info {
  flex: 1;
  min-width: 0;
}

.contact-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 3px;
}

.contact-card-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  word-break: break-word;
  transition: color 0.2s;
}

.contact-card-item:hover .contact-card-value {
  color: var(--green-dark);
}

.contact-card-arrow {
  color: #a0aec0;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s, color 0.2s;
}

.contact-card-item:hover .contact-card-arrow {
  color: var(--green-dark);
  transform: translateX(2px);
}

/* Fallback contact-link if referenced */
.contact-link {
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* Map Container */
.contact-map-container {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: #f8faf8;
}

.contact-map-frame {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* ── CHAT WIDGET ── */
.chat-popup {
  display: none;
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  width: min(388px, calc(100vw - 48px));
  height: min(560px, calc(100dvh - 116px - env(safe-area-inset-bottom)));
  max-height: 560px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(15, 50, 35, 0.2), 0 4px 14px rgba(15, 23, 42, 0.08);
  border: 1px solid #dfe8e2;
  overflow: hidden;
  z-index: 999;
  flex-direction: column;

  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.chat-popup.open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-header {
  flex-shrink: 0;
  background: var(--green-dark, #1e4d3a);
  color: #fff;
  min-height: 72px;
  padding: 14px 16px 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.chat-avatar-status {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.chat-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-hdr-btn {
  all: unset;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.15s, transform 0.15s;
}

.chat-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.chat-hdr-btn.chat-close-x {
  font-size: 14px;
  margin-left: 2px;
}

.chat-hdr-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.chat-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.chat-body input,
.chat-body textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 10px;
  outline: none;
}

.chat-body input:focus,
.chat-body textarea:focus {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(30, 77, 58, 0.09);
}

.chat-body textarea {
  resize: none;
  height: 80px;
}

.btn-send {
  width: 100%;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* ── CHAT THREAD (replies for account-less visitors) ── */
.chat-thread {
  flex: 1;
  padding: 18px 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-empty {
  text-align: center;
  color: #888;
  font-size: 13px;
  padding: 24px 8px;
}

.chat-thread-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.chat-thread-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.chat-thread-item.is-latest {
  min-height: 100%;
  border-bottom: none;
  padding-bottom: 0;
}

.chat-thread-item.is-latest .chat-thread-footer {
  margin-top: auto;
  padding-top: 8px;
  padding-bottom: 14px;
  position: sticky;
  bottom: -14px;
  z-index: 12;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 10px, #ffffff 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-thread-item.is-latest .chat-thread-reply {
  margin-top: 0;
  padding-top: 0;
  position: static;
  background: none;
}

.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 7px 0 9px;
  color: #718078;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5ece7;
}

.chat-date-divider span {
  padding: 4px 9px;
  border: 1px solid #e2eae5;
  border-radius: 999px;
  background: #f7faf8;
  white-space: nowrap;
}

.chat-menu-overlay {
  all: unset;
  position: absolute;
  inset: 72px 0 0;
  z-index: 80;
  display: block;
  background: rgba(16, 42, 31, 0.16);
  backdrop-filter: blur(1.5px);
  cursor: default;
  animation: chatBackdropIn 0.16s ease-out;
}

.chat-pinned-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border-left: 3px solid var(--green-dark, #1e4d3a);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--green-dark, #1e4d3a);
  margin-bottom: 6px;
}

.chat-pinned-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-msg-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  overflow: visible;
}

.chat-msg-wrap.mine {
  justify-content: flex-end;
}

.chat-msg-wrap.amfe {
  justify-content: flex-start;
}

.chat-swipe-arrow {
  position: absolute;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-dark, #1e4d3a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 2;
}

.chat-swipe-arrow.visible {
  opacity: 1;
}

.chat-swipe-arrow.ready {
  background: #16734d;
  box-shadow: 0 0 0 4px rgba(22, 115, 77, 0.14);
}

.chat-bubble-container {
  max-width: 82%;
  position: relative;
  transition: transform 0.15s ease-out;
  touch-action: pan-y;
}

/* The dismiss overlay sits above the thread. Lift only the active bubble above
   it so the reaction and message-action buttons receive pointer events. */
.chat-bubble-container.menu-open {
  z-index: 100;
}

.chat-msg-mine {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-msg-amfe {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-msg-bubble-wrap {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.chat-msg-mine .chat-msg-bubble-wrap {
  justify-content: flex-end;
}

.chat-msg-amfe .chat-msg-bubble-wrap {
  justify-content: flex-start;
}

.chat-msg-bubble {
  position: relative;
  display: inline-block;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
  cursor: pointer;
}

.chat-msg-mine .chat-msg-bubble {
  background: var(--green-dark, #1e4d3a);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chat-msg-amfe .chat-msg-bubble {
  background: #edf4f0;
  color: #173529;
  border: 1px solid #dce8e1;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-amfe-prefix {
  font-weight: 700;
  font-size: 12px;
  color: var(--green-dark, #1e4d3a);
}

.chat-msg-actions-hover {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.chat-msg-wrap:hover .chat-msg-actions-hover {
  opacity: 1;
  pointer-events: auto;
}

.chat-action-trigger-btn {
  all: unset;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #64748b;
  transition: all 0.15s;
}

.chat-action-trigger-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.1);
}

.chat-msg-quote {
  background: rgba(0, 0, 0, 0.06);
  border-left: 3px solid var(--green-dark, #1e4d3a);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.3;
}

.chat-msg-mine .chat-msg-quote {
  background: rgba(255, 255, 255, 0.16);
  border-left-color: #fff;
  color: #f8fafc;
}

.chat-msg-quote-sender {
  font-weight: 600;
  margin-bottom: 1px;
}

.chat-msg-quote-body {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

/* Messenger-style reaction pill shown beside the selected message. */
.chat-reaction-picker {
  position: absolute;
  bottom: calc(100% + 10px);
  z-index: 105;
  width: max-content;
  max-width: calc(100vw - 64px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 32px rgba(15, 50, 35, 0.2), 0 2px 8px rgba(15, 23, 42, 0.08);
  border: 1px solid #dce7df;
  border-radius: 999px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 1px;
  animation: chatPopIn 0.15s ease-out;
}

.chat-msg-wrap.mine .chat-reaction-picker {
  right: -4px;
}

.chat-msg-wrap.amfe .chat-reaction-picker {
  left: -4px;
}

@keyframes chatPopIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.chat-emoji-btn {
  all: unset;
  width: 33px;
  height: 33px;
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.15s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-emoji-btn:hover,
.chat-emoji-btn:active {
  transform: scale(1.22) translateY(-2px);
  background: #edf5f0;
}

.chat-emoji-btn:focus-visible {
  outline: 2px solid var(--green-dark, #1e4d3a);
  outline-offset: 2px;
}

/* Bottom action sheet kept separate from reactions for large, reliable targets. */
.chat-message-action-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #dce7df;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -14px 36px rgba(15, 50, 35, 0.14);
  backdrop-filter: blur(10px);
  animation: chatSheetIn 0.2s ease-out;
}

.chat-action-sheet-handle {
  display: block;
  width: 34px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #cbd8d0;
}

.chat-action-sheet-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}

.chat-sheet-action {
  all: unset;
  min-width: 0;
  padding: 5px 3px;
  border-radius: 12px;
  color: #244f3c;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.chat-sheet-action:hover {
  background: #edf5f0;
}

.chat-sheet-action:active {
  transform: scale(0.96);
}

.chat-sheet-action:focus-visible {
  outline: 2px solid var(--green-dark, #1e4d3a);
  outline-offset: 1px;
}

.chat-sheet-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #edf5f0;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.chat-sheet-action.danger {
  color: #b4232d;
}

.chat-sheet-action.danger .chat-sheet-action-icon {
  background: #fff0f1;
}

@keyframes chatBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Reactions pill on bubble */
.chat-reactions-pill {
  position: absolute;
  bottom: -9px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #dce5df;
  border-radius: 12px;
  padding: 1px 5px;
  box-shadow: 0 2px 6px rgba(15, 50, 35, 0.12);
  z-index: 5;
}

.chat-msg-wrap.mine .chat-reactions-pill,
.chat-msg-mine .chat-reactions-pill {
  right: 8px;
  left: auto;
}

.chat-msg-wrap.amfe .chat-reactions-pill,
.chat-msg-amfe .chat-reactions-pill {
  left: 8px;
  right: auto;
}

.chat-msg-bubble-wrap.has-reactions + .chat-msg-time {
  margin-top: 11px;
}

.chat-reaction-chip {
  all: unset;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
  line-height: 1;
}

.chat-reaction-chip .reaction-count {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.chat-msg-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}

.chat-msg-mine .chat-msg-time {
  justify-content: flex-end;
}

.chat-msg-amfe .chat-msg-time {
  justify-content: flex-start;
}

.chat-msg-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  font-size: 11px;
}

.chat-msg-status.status-seen {
  color: var(--green-dark, #1e4d3a);
  font-weight: 600;
}

.chat-msg-status.status-sent {
  color: #94a3b8;
}

.chat-msg-status i {
  font-size: 12px;
  margin-right: 2px;
}

.chat-msg-pinned-tag {
  font-size: 10px;
  color: #c99a3d;
  font-weight: 600;
}

.chat-msg-pending {
  font-size: 11.5px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
}

.chat-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fff1f2;
  color: #9f1239;
  font-size: 11px;
  line-height: 1.4;
}

.chat-inline-error i {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Reply preview banner */
.chat-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border-left: 3px solid var(--green-dark, #1e4d3a);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  margin-top: 4px;
}

.chat-reply-banner-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-reply-banner-content .reply-sender {
  font-weight: 600;
}

.chat-reply-close-btn {
  all: unset;
  cursor: pointer;
  font-size: 15px;
  color: #64748b;
  padding: 0 4px;
  line-height: 1;
}

.chat-reply-close-btn:hover {
  color: #0f172a;
}

/* Reply Input Capsule */
.chat-thread-reply {
  margin-top: 4px;
  margin-bottom: 2px;
}

.chat-input-pill {
  display: flex;
  align-items: center;
  min-height: 42px;
  background: #ffffff;
  border: 1.5px solid #dce5df;
  border-radius: 24px;
  padding: 2px 4px 2px 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-input-pill:focus-within {
  background: #fff;
  border-color: var(--green-dark, #1e4d3a);
  box-shadow: 0 0 0 3px rgba(30, 77, 58, 0.1);
}

.chat-input-pill input {
  all: unset;
  flex: 1;
  font-size: 12.5px;
  font-family: inherit;
  color: #0f172a;
  padding: 8px 0;
}

.chat-send-icon-btn {
  all: unset;
  cursor: pointer;
  color: var(--green-dark, #1e4d3a);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.chat-send-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chat-send-icon-btn:not(:disabled):hover {
  transform: scale(1.1);
}

.chat-send-icon-btn:focus-visible,
.chat-action-trigger-btn:focus-visible {
  outline: 2px solid var(--green-dark, #1e4d3a);
  outline-offset: 2px;
}

.chat-back-link {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
}

/* ── FLOATING BUTTON ── */
.chat-fab {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  right: 1rem;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 12px 16px;
  border-radius: 50px;

  background: #2d5a3d;
  color: white;
  border: none;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.chat-fab:hover {
  transform: scale(1.05);
}

/* ── RESPONSIVE ── */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .catalog-wrapper { margin-top: 20px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .discounted-stock-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .discounted-stock-notice { flex-basis: auto; width: 100%; min-width: 0; margin-top: 4px; }
  .discounted-stock-grid { grid-template-columns: 1fr; }
  .discounted-stock-grid .feed-use-panel { grid-column: auto; }

  .contact-layout { grid-template-columns: 1fr; }
  .contact-map-container, .contact-map-frame { min-height: 320px; height: 320px; }

  .chat-popup {
    right: max(20px, env(safe-area-inset-right));
    width: min(398px, calc(100vw - 40px));
    height: min(580px, calc(100dvh - 116px - env(safe-area-inset-bottom)));
    max-height: 580px;
  }
}

@media (max-width: 767.98px) {
  .catalog-wrapper { margin-top: 20px; }
  .catalog-toolbar { gap: 16px; }
  .catalog-search-wrap { width: 100%; }
  .catalog-filter-row { display: block; margin-top: 18px; }
  .catalog-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; width: 100%; overflow: visible; }
  .catalog-filters::-webkit-scrollbar { display: none; }
  .catalog-filter { width: 100%; min-width: 0; min-height: 42px; gap: 3px; padding: 4px; font-size: clamp(9.5px, 3vw, 11.5px); justify-content: flex-start; }
  .catalog-filter-icon { flex: 0 0 clamp(26px, 8vw, 31px); width: clamp(26px, 8vw, 31px); height: clamp(26px, 8vw, 31px); font-size: clamp(12px, 4vw, 14px); }
  .catalog-filter-label { min-width: 0; overflow: hidden; text-overflow: clip; }
  .catalog-grid { grid-template-columns: 1fr; gap: 16px; }
  .catalog-grid .product-body { padding: 16px; }
  .discounted-stock-section { margin-top: 27px; padding-top: 24px; }
  .discounted-stock-title-wrap { align-items: flex-start; }
  .discounted-stock-heading { flex-direction: column; gap: 14px; }
  .discounted-stock-notice { flex-basis: auto; width: 100%; min-width: 0; padding: 11px 13px; }
  .discounted-stock-notice p span { white-space: normal; }
  .discounted-stock-grid { grid-template-columns: 1fr; }
  .discounted-stock-grid .feed-use-panel { grid-column: auto; padding: 20px; }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-map-container, .contact-map-frame { min-height: 260px; height: 260px; }

  .chat-fab {
    width: 3rem;
    height: 3rem;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .chat-fab .chat-text { display: none; }

  .chat-popup {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: calc(100vw - max(26px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 2px)));
    height: min(520px, calc(100dvh - 92px - env(safe-area-inset-bottom)));
    max-height: 520px;
    border-radius: 18px;
  }

  .chat-header {
    min-height: 64px;
    padding: 11px 12px 11px 14px;
  }

  .chat-thread {
    padding: 14px 12px 12px;
    gap: 11px;
    overscroll-behavior: contain;
  }

  .chat-thread-item.is-latest .chat-thread-footer {
    bottom: -12px;
    padding-bottom: 12px;
  }

  .chat-bubble-container { max-width: 86%; }

  .chat-message-action-sheet {
    max-height: min(220px, 38dvh);
    overflow-y: auto;
  }

}

@media (max-width: 479.98px) {
  .feed-use-grid { grid-template-columns: 1fr; }

  .chat-header-left { gap: 9px; }
  .chat-avatar-status { width: 36px; height: 36px; }
  .chat-title { font-size: 15px; }
  .chat-header-actions { gap: 4px; }
  .chat-hdr-btn { width: 32px; height: 32px; }
  .chat-msg-bubble { font-size: 13px; padding: 8px 11px; }
  .chat-bubble-container { max-width: 88%; }
  .chat-reaction-picker { max-width: calc(100vw - 40px); padding: 5px; }
  .chat-emoji-btn { width: 30px; height: 30px; font-size: 18px; }
  .chat-input-pill { min-height: 44px; }
  .chat-input-pill input { min-width: 0; font-size: 16px; }
}

@media (max-width: 359.98px) {
  .chat-popup {
    right: max(8px, env(safe-area-inset-right));
    width: calc(100vw - max(18px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 2px)));
  }

  .chat-header { padding-inline: 10px; }
  .chat-title { font-size: 14px; }
  .chat-avatar-status { width: 32px; height: 32px; }
  .chat-hdr-btn { width: 30px; height: 30px; }
  .chat-thread { padding-inline: 10px; }
  .chat-action-sheet-grid { gap: 1px; }
  .chat-sheet-action { font-size: 10px; }
}

@media (max-height: 600px) {
  .chat-popup {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(388px, calc(100vw - 18px));
    height: auto;
    max-height: none;
  }

  .chat-header { min-height: 58px; }
}
