/* =========================================================================
   Rosbotanic — Header v1 (Variant A, 2026-07-04)
   Sticky-shrink, messenger balloon, search panel, sticky-CTA mobile
   Палитра: #FFF1D8 (пастель) / #CFC9E8 (лаванда) / #C0E3E0 (мята)
   Текст: #2E2A24 (тёплый графит) | Фон: #FFFFFF | Аксцент: #5C7F5A (олива)
   ========================================================================= */

/* --- Reset для нашей шапки --- */
.rb-header,
.rb-header * {
  box-sizing: border-box;
}

/* --- Шапка --- */
.rb-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(46, 42, 36, 0.08);
  transition: box-shadow 240ms ease, padding 240ms ease;
}

.rb-header[data-scrolled="true"] {
  box-shadow: 0 2px 12px rgba(46, 42, 36, 0.06);
}

.rb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 15px;
  max-width: 1280px;
  margin: 0 auto;
  transition: padding 240ms ease;
}

.rb-header[data-scrolled="true"] .rb-header__inner {
  padding: 10px 15px;
}

/* --- Логотип --- */
.rb-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #2E2A24;
  flex: 0 0 auto;
}

.rb-header__logo:hover,
.rb-header__logo:focus {
  text-decoration: none;
  color: #2E2A24;
}

.rb-logo-mark {
  width: 32px;
  height: 32px;
  transition: width 240ms ease, height 240ms ease;
}

.rb-header[data-scrolled="true"] .rb-logo-mark {
  width: 26px;
  height: 26px;
}

.rb-logo-text {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #2E2A24;
}

/* --- Меню --- */
.rb-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1 1 auto;
  justify-content: center;
}

.rb-nav a {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: #2E2A24;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
  transition: color 160ms ease;
}

.rb-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1.5px;
  background: #CFC9E8;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms ease;
}

.rb-nav a:hover::after,
.rb-nav a:focus::after,
.rb-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.rb-nav a:hover {
  color: #2E2A24;
  text-decoration: none;
}

/* --- Правая группа: иконки --- */
.rb-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.rb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #2E2A24;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  text-decoration: none;
  transition: background 160ms ease;
}

.rb-icon-btn:hover,
.rb-icon-btn:focus {
  background: #FFF1D8;
  outline: none;
  text-decoration: none;
  color: #2E2A24;
}

.rb-icon-btn:focus-visible {
  outline: 2px solid #CFC9E8;
  outline-offset: 2px;
}

.rb-icon-btn svg {
  width: 22px;
  height: 22px;
}

.rb-icon-btn sup {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #5C7F5A;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

/* --- Мессенджер-балун --- */
.rb-messenger {
  position: relative;
}

.rb-messenger__balloon {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #FFFFFF;
  border: 1px solid rgba(46, 42, 36, 0.10);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(46, 42, 36, 0.10);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

.rb-messenger__balloon[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s;
}

.rb-messenger__balloon a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #2E2A24;
  text-decoration: none;
  border-radius: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 140ms ease;
}

.rb-messenger__balloon a:hover,
.rb-messenger__balloon a:focus {
  background: #FFF1D8;
  color: #2E2A24;
  text-decoration: none;
}

.rb-messenger__balloon a .rb-msngr-badge {
  margin-left: auto;
  font-size: 11px;
  color: #7A6F60;
}

/* --- Поисковая панель --- */
.rb-search-panel {
  overflow: hidden;
  max-height: 0;
  border-top: 1px solid rgba(46, 42, 36, 0.06);
  transition: max-height 260ms ease;
  background: #FFFFFF;
}

.rb-search-panel[data-open="true"] {
  max-height: 96px;
}

.rb-search-panel__form {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 15px;
}

.rb-search-panel__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(46, 42, 36, 0.15);
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  color: #2E2A24;
  background: #FFFFFF;
  transition: border-color 160ms ease;
}

.rb-search-panel__input:focus {
  outline: none;
  border-color: #CFC9E8;
  box-shadow: 0 0 0 3px rgba(207, 201, 232, 0.35);
}

.rb-search-panel__submit {
  padding: 12px 24px;
  border: 1px solid #2E2A24;
  background: transparent;
  color: #2E2A24;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.rb-search-panel__submit:hover,
.rb-search-panel__submit:focus {
  background: #2E2A24;
  color: #FFFFFF;
}

/* --- Мобильная навигация (drawer) --- */
.rb-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #2E2A24;
  cursor: pointer;
  border-radius: 8px;
}

.rb-mobile-toggle svg {
  width: 24px;
  height: 24px;
}

.rb-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 88%;
  max-width: 360px;
  height: 100vh;
  background: #FFFFFF;
  box-shadow: -12px 0 40px rgba(46, 42, 36, 0.10);
  padding: 24px 20px;
  z-index: 200;
  transition: right 300ms ease;
  overflow-y: auto;
}

.rb-mobile-drawer[data-open="true"] {
  right: 0;
}

.rb-mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #2E2A24;
  cursor: pointer;
  margin-left: auto;
}

.rb-mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.rb-mobile-drawer__nav a {
  padding: 14px 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #2E2A24;
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 42, 36, 0.06);
}

.rb-mobile-drawer__nav a:hover,
.rb-mobile-drawer__nav a:focus {
  background: #FFF1D8;
  color: #2E2A24;
  text-decoration: none;
}

.rb-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(46, 42, 36, 0.35);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.rb-drawer-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 0s;
}

/* --- Sticky CTA (mobile) --- */
.rb-sticky-cta {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 90;
  padding: 14px 20px;
  background: #5C7F5A;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(46, 42, 36, 0.15);
  transition: background 160ms ease;
}

.rb-sticky-cta:hover,
.rb-sticky-cta:focus {
  background: #4a6c48;
  color: #FFFFFF;
  text-decoration: none;
}

.rb-sticky-cta svg {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
}

/* --- Скрыть штатные Mango-элементы --- */
#top,
.header:not(.rb-header),
.mango-menu-wrap {
  display: none !important;
}

/* --- Адаптив --- */
@media (max-width: 991px) {
  .rb-nav {
    display: none;
  }
  .rb-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .rb-logo-text {
    display: none;
  }
  .rb-sticky-cta {
    display: block;
  }
  body {
    padding-bottom: 72px;
  }
}

@media (max-width: 480px) {
  .rb-header__inner {
    padding: 12px;
    gap: 8px;
  }
  .rb-header__actions {
    gap: 0;
  }
  .rb-icon-btn {
    width: 36px;
    height: 36px;
  }
  .rb-icon-btn svg {
    width: 20px;
    height: 20px;
  }
}
