/* bcg-gift-assistant.css
   FINAL FIX:
   - Followup input + Ask button are ONE ROW and together span full width
   - Hide top search row after first success (.bcg-ga--final or .bcg-ga--has-results) ✅ UPDATED
   - Remove analysis subtitle completely
   - ✅ Product description: NOT bold + 2 sizes smaller than title (NEW)
   - ✅ Support both markup class names: __inputRow vs __row, __dot vs __pillDot (NEW)
*/

.bcg-ga,
.bcg-ga * { box-sizing: border-box; }

.bcg-ga {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  font-family: inherit;

  /* ✅ single source of truth */
  --bcg-ga-product-title-size: 14px;
  --bcg-ga-product-desc-size: 12px; /* 2 sizes smaller than 14px */
}

.bcg-ga__card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

/* TOP ROW (visible until success) */
/* ✅ supports both: .bcg-ga__row and .bcg-ga__inputRow */
.bcg-ga__row,
.bcg-ga__inputRow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid #efefef;
  border-radius: 14px;
  background: #fff;
}

.bcg-ga__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  background: #f6f7f8;
  border: 1px solid #ececec;
  border-radius: 999px;
  padding: 6px 10px;
  user-select: none;
}

/* ✅ supports both: .bcg-ga__pillDot and .bcg-ga__dot */
.bcg-ga__pillDot,
.bcg-ga__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.bcg-ga__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 16px;
  padding: 10px 6px;
  background: transparent;
}

.bcg-ga__btn,
.bcg-ga__followupBtn {
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.10);
  white-space: nowrap;
}

.bcg-ga__btn:hover,
.bcg-ga__followupBtn:hover { filter: brightness(1.05); }

.bcg-ga__btn:active,
.bcg-ga__followupBtn:active { transform: translateY(1px); }

/* ✅ After success, top row must be gone */
/* ✅ supports either class JS might add: .bcg-ga--final or .bcg-ga--has-results */
/* ✅ supports either top row class: .bcg-ga__row or .bcg-ga__inputRow */
.bcg-ga--final .bcg-ga__row,
.bcg-ga--final .bcg-ga__inputRow,
.bcg-ga--has-results .bcg-ga__row,
.bcg-ga--has-results .bcg-ga__inputRow {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* Status */
.bcg-ga__status {
  margin-top: 12px;
  background: #f6f7f8;
  border: 1px solid #ececec;
  color: #111;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}
.bcg-ga__status--error {
  background: #ffe9e9;
  border-color: #ffd0d0;
  color: #8a1f1f;
}

/* Results container */
.bcg-ga__results {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0 !important;
}

/* bubbles */
.bcg-ga__bubbleWrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 14px;
}
.bcg-ga__bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.25;
}
.bcg-ga__bubble--user {
  margin-left: auto;
  background: #111;
  color: #fff;
  border-bottom-right-radius: 8px;
}

/* analysis header */
.bcg-ga__analysisHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
}
.bcg-ga__analysisLogo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  flex: 0 0 auto;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.bcg-ga__analysisLogo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bcg-ga__analysisTitle {
  font-weight: 800;
  font-size: 16px;
  color: #111;
}

/* ✅ Remove subtitle always */
.bcg-ga__analysisSubtitle { display: none !important; }

/* intro line */
.bcg-ga__introLine {
  margin: 10px 0 14px;
  font-size: 14px;
  color: #111;
}

/* products */
.bcg-ga__products { width: 100%; margin-top: 6px; }

.bcg-ga__productRow {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.bcg-ga__productRow::-webkit-scrollbar { height: 10px; }
.bcg-ga__productRow::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 999px; }
.bcg-ga__productRow::-webkit-scrollbar-track { background: #f2f2f2; border-radius: 999px; }

.bcg-ga__productCard {
  scroll-snap-align: start;
  text-decoration: none !important;
  color: inherit !important;
  min-width: 320px;
  max-width: 320px;
  background: #fff;
  border: 1px solid #ededed;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bcg-ga__productImage {
  height: 220px;
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.bcg-ga__productImage img { width: 100%; height: 100%; object-fit: contain; }

.bcg-ga__productMeta { padding: 14px 14px 12px; }

.bcg-ga__productTitle {
  font-size: var(--bcg-ga-product-title-size);
  font-weight: 700;
  line-height: 1.25;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

/* ✅ Description: smaller + NOT bold */
.bcg-ga__productDesc {
  font-size: var(--bcg-ga-product-desc-size);
  font-weight: 400;                 /* not bold */
  line-height: 1.25;
  color: #374151;                   /* slightly softer than title */
  margin-top: 8px;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;

  min-height: 0;
}

.bcg-ga__productBottom {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.bcg-ga__merchant {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bcg-ga__price { font-size: 15px; font-weight: 800; color: #111; }

/* disclosure */
.bcg-ga__disclosure {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

/* ✅ FOLLOWUP AREA: FULL WIDTH */
.bcg-ga__followup {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee;

  width: 100% !important;
  max-width: none !important;

  margin-left: 0 !important;
  margin-right: 0 !important;

  float: none !important;
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
}

/* ✅ This is the normalized bar JS creates */
.bcg-ga__followupBar {
  width: 100% !important;

  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;

  gap: 12px !important;
}

.bcg-ga__followupInput {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;

  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

.bcg-ga__followupBtn {
  flex: 0 0 auto !important;
  height: 44px !important;
}

/* mobile */
@media (max-width: 640px) {
  .bcg-ga__card { padding: 14px; }
  .bcg-ga__productCard { min-width: 78vw; max-width: 78vw; }
  .bcg-ga__productImage { height: 240px; }
}


/* Additions to support persistent chat bubbles + safe product card link styling. */

.bcg-ga__bubbleWrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bcg-ga__bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.bcg-ga__bubble--user {
  margin-left: auto;
  background: #111;
  color: #fff;
  border-top-right-radius: 6px;
}

.bcg-ga__bubble--assistant {
  margin-right: auto;
  background: #f2f3f5;
  color: #111;
  border-top-left-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}

/* keep product cards from inheriting theme link styles */
.bcg-ga__productCard,
.bcg-ga__productCard:visited,
.bcg-ga__productCard:hover,
.bcg-ga__productCard:active {
  text-decoration: none !important;
  color: inherit !important;
}

/* === WP Rocket RUCSS SAFER PATCH (replace the old patch) === */

/* 1) Guarantee your intended image box wins */
.bcg-ga .bcg-ga__productImage {
  height: 220px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #fff !important;
}

.bcg-ga .bcg-ga__productImage img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

/* 2) If some products render without __productImage, clamp only common image wrappers INSIDE product cards */
.bcg-ga .bcg-ga__productCard :is(.image, .media, .thumb, .thumbnail, figure) {
  height: 220px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #fff !important;
}

.bcg-ga .bcg-ga__productCard :is(.image, .media, .thumb, .thumbnail, figure) img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

/* 3) Prevent theme styles from stretching images in cards */
.bcg-ga .bcg-ga__productCard img {
  max-width: 100% !important;
  height: auto !important;
}
