/* ECONEXO conversations block on EcoFarma product pages.
   Blue accent per the mockup; scoped so it doesn't clash with the store theme. */

/* Scoped reset — the store theme injects its own product-page CSS around this
   block, so we neutralise inherited spacing/borders/list styles on our elements. */
.econexo-block, .econexo-block * { box-sizing: border-box; }
.econexo-block h2, .econexo-block h3, .econexo-block p { margin: 0; padding: 0; border: 0; font-family: inherit; }
.econexo-block .thread { list-style: none; }
.econexo-block a { box-shadow: none; }

.econexo-block {
  margin: 26px 0; background: #fff; border: 1px solid #dfe5ee; border-radius: 20px; overflow: hidden;
  font-family: inherit; color: #1f2430; box-shadow: 0 10px 26px rgba(23, 43, 77, .05); max-width: 100%;
}

/* ---- Header ---- */
.econexo-block .ex-head {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 22px 24px; border-bottom: 1px solid #e6eaf0; background: linear-gradient(90deg, #fff, #faf9ff);
}
.econexo-block .ex-titlewrap { display: flex; gap: 16px; align-items: center; min-width: 0; }
.econexo-block .ex-logo-img { flex: 0 0 auto; height: 44px; width: auto; display: block; }
.econexo-block .ex-logo { font-weight: 800; font-size: 24px; letter-spacing: -1px; white-space: nowrap; line-height: 1; }
.econexo-block .ex-logo .eco { color: #ffc72b; }
.econexo-block .ex-logo .nexo { color: #263aa2; }
.econexo-block .ex-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: #1a2340; line-height: 1.25; }
.econexo-block .ex-sub { margin: 4px 0 0; font-size: .82rem; color: #6b7488; line-height: 1.5; }

/* Header CTA — solid pill, single line, never clips */
.econexo-block .ex-all {
  flex: 0 0 auto !important; display: inline-flex !important; align-items: center; justify-content: center; gap: 6px;
  border: 0 !important; border-radius: 999px !important; padding: 11px 20px !important; background: linear-gradient(90deg, #1f4fd0, #2f67c8) !important;
  color: #fff !important; font-weight: 700 !important; font-size: .8rem !important; line-height: 1 !important; text-decoration: none !important; white-space: nowrap !important;
  box-shadow: 0 6px 14px rgba(38, 58, 162, .22); transition: transform .15s ease, box-shadow .15s ease; width: auto !important; text-transform: none !important; letter-spacing: normal !important;
}
.econexo-block .ex-all::after { content: "→"; font-weight: 800; }
.econexo-block .ex-all:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(38, 58, 162, .3); }

/* ---- Thread rows ---- */
.econexo-block .thread {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 16px; padding: 18px 24px;
  border-bottom: 1px solid #edf0f4; align-items: center;
}
.econexo-block .thread:last-child { border-bottom: 0; }
.econexo-block .tavatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #2f67c8; color: #fff; font-weight: 700; font-size: 1.05rem;
}
.econexo-block .thread-main { min-width: 0; }
.econexo-block .thread h3 { font-size: 1rem; margin: 0 0 5px; line-height: 1.4; }
.econexo-block .thread h3 a { color: #1a2340; text-decoration: none; }
.econexo-block .thread h3 a:hover { color: #2654d8; text-decoration: underline; }
.econexo-block .meta { font-size: .72rem; color: #687386; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.econexo-block .meta-badge { color: #2654d8; font-weight: 700; white-space: nowrap; }
.econexo-block .preview {
  font-size: .8rem; color: #616b7b; margin: 6px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Right side: stats + CTA, vertically stacked and aligned */
.econexo-block .thread-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.econexo-block .stats { font-size: .72rem; color: #667085; line-height: 1.6; white-space: nowrap; text-align: right; }
.econexo-block .stats .stat-replies, .econexo-block .stats .stat-fresh { display: block; }

/* Per-thread CTA — solid pill, single line */
.econexo-block .reply {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; white-space: nowrap !important;
  border: 0 !important; border-radius: 999px !important; padding: 9px 16px !important; background: #1f4fd0 !important; color: #fff !important;
  font: inherit; font-size: .74rem !important; font-weight: 700 !important; line-height: 1 !important; text-decoration: none !important; width: auto !important;
  box-shadow: 0 4px 10px rgba(31, 79, 208, .2); transition: transform .15s ease, background .15s ease; text-transform: none !important; letter-spacing: normal !important; max-width: none !important;
}
.econexo-block .reply::after { content: "→"; font-weight: 800; }
.econexo-block .reply:hover { background: #163da8 !important; color: #fff !important; transform: translateY(-1px); }

/* ---- Tablet (≤820px) ---- */
@media (max-width: 820px) {
  .econexo-block .ex-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .econexo-block .ex-all { align-self: flex-start; }
  .econexo-block .thread { grid-template-columns: 42px minmax(0, 1fr); gap: 12px 14px; padding: 16px; }
  .econexo-block .thread-side {
    grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 2px; padding-top: 10px; border-top: 1px dashed #eef1f6;
  }
  .econexo-block .stats { text-align: left; display: flex; gap: 14px; }
  .econexo-block .stats .stat-replies, .econexo-block .stats .stat-fresh { display: inline; }
  .econexo-block .preview { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---- Phone (≤480px) ---- */
@media (max-width: 480px) {
  .econexo-block { border-radius: 16px; margin: 18px 0; }
  .econexo-block .ex-head { padding: 16px; }
  .econexo-block .ex-logo { font-size: 21px; }
  .econexo-block .ex-logo-img { height: 38px; }
  .econexo-block .ex-title { font-size: 1.02rem; }
  .econexo-block .ex-all { align-self: stretch; }
  .econexo-block .thread { padding: 14px; grid-template-columns: 38px minmax(0, 1fr); gap: 10px 12px; }
  .econexo-block .tavatar { width: 38px; height: 38px; font-size: .95rem; }
  .econexo-block .thread h3 { font-size: .95rem; }
  .econexo-block .thread-side { flex-direction: column; align-items: stretch; gap: 10px; }
  .econexo-block .stats { text-align: left; }
  .econexo-block .reply { align-self: stretch; padding: 12px 16px; font-size: .8rem; }
}

/* ---- "¿No encuentras tu duda?" ask block ---- */
.econexo-block .ex-ask {
  display: flex; align-items: center; gap: 18px; margin: 4px 18px 18px; padding: 20px 24px;
  background: #f1f2fb; border: 1px solid #e3e5f4; border-radius: 16px;
}
.econexo-block .ex-ask .ask-ico {
  flex: 0 0 54px; width: 54px; height: 54px; display: grid; place-items: center;
}
.econexo-block .ex-ask .ask-ico img { width: 54px; height: 54px; object-fit: contain; display: block; }
.econexo-block .ex-ask .ask-text { flex: 1 1 auto; min-width: 0; }
.econexo-block .ex-ask .ask-text h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; color: #1a2340; }
.econexo-block .ex-ask .ask-text p { margin: 0; font-size: .84rem; color: #5b6472; line-height: 1.5; }
.econexo-block .ex-ask .ask-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 12px 22px; background: linear-gradient(90deg, #1f4fd0, #2f67c8) !important;
  color: #fff !important; font-weight: 700 !important; font-size: .82rem; line-height: 1; text-decoration: none !important;
  box-shadow: 0 6px 14px rgba(38, 58, 162, .22); transition: transform .15s ease, box-shadow .15s ease;
}
.econexo-block .ex-ask .ask-btn::after { content: "→"; font-weight: 800; }
.econexo-block .ex-ask .ask-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(38, 58, 162, .3); color: #fff !important; }

@media (max-width: 820px) {
  .econexo-block .ex-ask { flex-direction: column; align-items: flex-start; gap: 12px; margin: 4px 16px 16px; padding: 18px; }
  .econexo-block .ex-ask .ask-btn { align-self: stretch; justify-content: center; }
}
