/* Single listing: custom title bar (mobile) */
@media (max-width: 991px) {

  /* topbar wrapper */
  #lh-listing-topbar{
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    margin-bottom: 0!important;
  }

  /* admin bar offsets */
  body.admin-bar #lh-listing-topbar{ top: 32px; }
  @media (max-width: 782px){
    body.admin-bar #lh-listing-topbar{ top: 46px; }
  }

  /* inner layout: centered title, back pinned left */
  #lh-listing-topbar .lh-listing-topbar-inner{
    display:flex;
    align-items:center;
    justify-content:center;   /* title centered */
    position:relative;
    padding: 10px 14px;
    min-height: 44px;
  }

  /* back button: NO circle, just purple arrow */
  #lh-listing-topbar .lh-listing-back{
    position:absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;

    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    padding: 0;
    font-size: 0; /* hide any inner text/icon */
  }

  #lh-listing-topbar .lh-listing-back::before{
      content: "←";
      font-size: 26px;      /* было 22 */
      line-height: 1;
      font-weight: 800;
      color: #6a2ea0;
      display:block;
      transform: translateY(-1px);
  }

  #lh-listing-topbar .lh-listing-back:active{
    opacity: .7;
  }

  /* title: centered, slightly larger like in your reference */
  #lh-listing-topbar .lh-listing-title{
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: #222;

    /* ❌ убираем ellipsis */
    overflow: visible;
    text-overflow: clip;
    white-space: normal;

    /* ✅ разрешаем перенос */
    word-break: break-word;
    overflow-wrap: anywhere;

    /* центрируем текст как раньше */
    text-align: center;

    /* сохраняем место под стрелку */
    max-width: calc(100% - 90px);
  }

  /* optional: tighten spacing under admin bar */
  body.admin-bar #lh-listing-topbar .lh-listing-topbar-inner{
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (max-width: 991px){

  /* убрать верхний gap после topbar */
  #lh-listing-topbar + #primary,
  #lh-listing-topbar + .content-area{
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* если внутри есть .container */
  #lh-listing-topbar + #primary > .container{
    padding-top: 0 !important;
  }

  /* убрать лишний отступ у самой карточки */
  #primary .rtin-slider-box{
    margin-top: 0 !important;
  }
  /* TOPBAR: Clear all + Sort icon (listing-category) */
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions h2.rtin-title.rtcl-result-count{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Clear all */
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-clear-all{
  margin-left: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #6f3cc3;
  white-space: nowrap;
}
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-clear-all:hover{
  text-decoration: underline;
}

/* Sort icon button */
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-sort-wrap{
  margin-left:auto;
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:10px;
  cursor:pointer;
  user-select:none;
}
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-sort-wrap i{
  font-size:16px;
  color:#6f3cc3;
}

/* Invisible select over the icon */
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-sort-overlay{
  position:absolute;
  inset:0;
  opacity:0.0001;
}
body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-sort-overlay select{
  width:100%;
  height:100%;
  cursor:pointer;
}

/* Mobile: match reference (Clear all on right) */
@media (max-width: 991px){
  body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions h2.rtin-title.rtcl-result-count{
    justify-content: space-between;
  }
  body.tax-rtcl_category .listing-archive-top.rtcl-listings-actions .lh-clear-all{
    margin-left:auto;
  }
}
}
@media (max-width: 991px){

  /* модалка поверх всего, включая нижнее меню */
  #classima-mail-to-seller{
    z-index: 9999999 !important;
  }

  /* прижать к верху и дать скролл */
  #classima-mail-to-seller .modal-dialog{
    margin: 14px 12px !important;
    width: calc(100% - 24px) !important;
    max-width: 640px !important;
  }

  /* если у тебя был centered — убираем эффект */
  #classima-mail-to-seller .modal-dialog.modal-dialog-centered{
    min-height: 0 !important;
    align-items: flex-start !important;
  }

  #classima-mail-to-seller .modal-content{
    max-height: calc(100dvh - 28px) !important;
    overflow: auto !important;
  }
}
@media (max-width: 991px){

  /* Контейнер ввода */
  #rtcl-user-chat-wrap .rtcl-chat-send-wrapper{
    position: relative !important;
  }

  /* Само поле */
  #rtcl-user-chat-wrap .rtcl-chat-send-wrapper textarea{
    width: 100% !important;
    box-sizing: border-box !important;

    padding-right: 54px !important;  /* ← место под send */
    min-height: 40px !important;
    max-height: 140px !important;    /* совпадает с maxH в JS */
    overflow-y: hidden;              /* JS будет переключать при необходимости */
    resize: none !important;
  }

  /* Если send-кнопка/иконка внутри и перекрывает — прижмём вправо */
  #rtcl-user-chat-wrap .rtcl-chat-send-wrapper .rtcl-chat-send,
  #rtcl-user-chat-wrap .rtcl-chat-send-wrapper button.rtcl-chat-send{
    position: absolute !important;
    right: 10px !important;
    bottom: 8px !important;
    z-index: 2 !important;
  }

}
@media (max-width: 991px){

  /* MODAL chat: input row must allow textarea to grow */
  #rtcl-chat-modal .rtcl-chat-send-wrap{
    display:flex !important;
    align-items:flex-end !important;  /* кнопка внизу */
    gap:8px !important;
    height:auto !important;
  }

  #rtcl-chat-modal .rtcl-chat-send-wrap textarea{
    flex: 1 1 auto !important;
    min-width: 0 !important;

    line-height: 20px !important;
    min-height: 40px !important;     /* старт 2 строки */
    max-height: 120px !important;    /* ~6 строк, фактически 5 комфортно */
    height: auto !important;

    overflow-y: hidden !important;   /* пока растём — без скролла */
    resize: none !important;
  }

  #rtcl-chat-modal .rtcl-chat-send-wrap .rtcl-chat-send{
    flex: 0 0 auto !important;
    align-self:flex-end !important;
  }
}
/* Скрываю PRICING UNIT в листинге */
.rtcl-cf-select{
  display:none !important;
}