/* Объявления: закреплённый баннер сверху сайта и страница объявления.
   Подключается из announcements.php только там, где виден баннер или открыта страница объявления.

   Размеры в единицах сайта: main.css сжимает всю страницу (html { zoom: .75 }) на экранах до 1600 px
   и возвращает zoom: 1 на телефонах (до 750 px), поэтому «десктопные» значения здесь в 1,33 раза крупнее
   привычных: на ноутбуке они выглядят как 56 px у баннера и 16 px у текста. */

:root {
  --nest-notice-h: 72px;
  --nn-ink: #303439;
  --nn-ink-soft: #666E7B;
  --nn-green: #599E31;
  --nn-green-ink: #3D6A24;
  --nn-green-deep: #2D5A1C;
  --nn-mint: #ECF2E9;
  --nn-yellow: #F5D814;
  --nn-olive: #46400F;
  --nn-ease: cubic-bezier(.16, 1, .3, 1);
}

@media (max-width: 750px) {
  :root { --nest-notice-h: 52px; }
}

/* ========== Баннер ========== */
/* body и html с overflow: hidden — sticky не работает, поэтому fixed плюс распорка в потоке.
   Слой 1040: выше .instructions .section-title (1000), ниже лайтбокса fancybox (1050), .modal-window (10000) и меню (100000) */
.nest-notice-spacer {
  height: var(--nest-notice-h);
  /* одноразовое сворачивание пустого блока при закрытии баннера: страница плавно поднимается */
  transition: height .4s var(--nn-ease);
}

.nest-notice[hidden],
.nest-notice-spacer[hidden] { display: none; }

/* закрытый баннер: якорные переходы больше не отступают под него */
html.nest-notice-off { scroll-padding-top: 0; }

.nest-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  height: var(--nest-notice-h);
  background: var(--nn-green-deep) linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 65%);
  color: #fff;
  font-family: "Manrope", sans-serif;
  box-shadow: 0 10px 36px rgba(24, 48, 14, .24);
  transition: transform .4s var(--nn-ease), opacity .3s ease;
}

.nest-notice.is-closing {
  opacity: 0;
  transform: translateY(-100%);
}

.nest-notice-spacer.is-closing { height: 0; }

.nest-notice--adminbar { top: 32px; }

@media (max-width: 782px) {
  .nest-notice--adminbar { top: 46px; }
}

@media (max-width: 600px) {
  .nest-notice--adminbar { top: 0; }
}

.nest-notice__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  box-sizing: border-box;
  width: min(1560px, calc(100% - 54px));
  height: 100%;
  margin: 0 auto;
}

.nest-notice__link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Круглая кнопка «Закрыть»: тихая, чтобы не отвлекать; зона нажатия шире видимого круга */
.nest-notice__close {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: background-color .3s var(--nn-ease), transform .3s var(--nn-ease);
}

.nest-notice__close[hidden] { display: none; }

.nest-notice__close::before {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  bottom: -6px;
  left: -6px;
}

.nest-notice__close svg {
  width: 20px;
  height: 20px;
  opacity: .9;
}

.nest-notice__close:hover { background: rgba(255, 255, 255, .28); }
.nest-notice__close:active { transform: scale(.92); }

/* глобальный :focus-visible из main.css даёт зелёный outline !important — на тёмном баннере меняем только его цвет на белый */
.nest-notice__close:focus-visible {
  outline-color: #fff !important;
}

.nest-notice__link:hover,
.nest-notice__link:focus { color: inherit; }

/* main.css даёт глобальный зелёный :focus-visible (outline !important); на тёмном баннере и у плиток добавляем кольцо тенью */
.nest-notice__link:focus-visible {
  box-shadow: inset 0 0 0 3px #fff;
}

.nest-notice__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  color: var(--nn-yellow);
}

.nest-notice__icon svg { width: 26px; height: 26px; }

.nest-notice__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nest-notice__label {
  flex: none;
  padding: 9px 16px;
  border-radius: 26px;
  background: #fff;
  color: var(--nn-green-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nest-notice__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: pretty;
}

.nest-notice__cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 26px;
  border-radius: 18px;
  background: var(--nn-yellow);
  color: var(--nn-olive);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 4px 0 rgba(251, 243, 155, .3), 0 1px 0 rgba(251, 243, 155, .6), inset 0 0 22px rgba(255, 255, 255, .35);
  transition: transform .4s var(--nn-ease), box-shadow .4s var(--nn-ease);
}

.nest-notice__cta svg {
  width: 22px;
  height: 22px;
  transition: transform .4s var(--nn-ease);
}

.nest-notice__link:hover .nest-notice__cta,
.nest-notice__link:focus-visible .nest-notice__cta {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 rgba(251, 243, 155, .3), 0 1px 0 rgba(251, 243, 155, .6), inset 0 0 22px rgba(255, 255, 255, .5);
}

.nest-notice__link:hover .nest-notice__cta svg,
.nest-notice__link:focus-visible .nest-notice__cta svg {
  transform: translateX(5px);
}

@media (max-width: 1050px) {
  .nest-notice__label { display: none; }
  .nest-notice__text { font-size: 18px; line-height: 1.25; }
}

@media (max-width: 750px) {
  .nest-notice__inner { gap: 10px; width: 100%; padding: 0 14px; }
  .nest-notice__link { gap: 12px; }
  .nest-notice__icon { display: none; }
  .nest-notice__close { width: 32px; height: 32px; }
  .nest-notice__close svg { width: 16px; height: 16px; }
  .nest-notice__text { font-size: 13px; line-height: 1.3; }
  .nest-notice__cta { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 12px; box-shadow: 0 3px 0 rgba(251, 243, 155, .3), inset 0 0 14px rgba(255, 255, 255, .35); }
  .nest-notice__cta svg { width: 18px; height: 18px; }
  .nest-notice__cta-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* .sorting-date в main.css имеет z-index 10000 и при прокрутке проходила бы поверх баннера */
.sorting-row .sorting-date { z-index: 1020; }

/* ========== Страница объявления ========== */
/* section.nest-ann: main.css подключается позже и на телефоне обнуляет отступы секций */
section.nest-ann {
  padding-bottom: 120px;
}

.nest-ann ::selection {
  background: #CFE5C1;
  color: #1D3A10;
}

.nest-ann a:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--nn-green);
}

.nest-ann__title {
  max-width: 1300px;
  margin: 36px 0 52px;
  color: var(--nn-ink);
  font-size: 50px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.nest-ann__card {
  padding: 72px 96px 84px;
  border: 2px solid rgba(255, 255, 255, .33);
  border-radius: 30px;
  background: #FEFEFE;
  box-shadow: 0 24px 80px rgba(67, 67, 67, .14);
}

/* Текст объявления: то, что набрано в редакторе, выглядит так же, как письмо */
.nest-ann__content {
  color: var(--nn-ink);
  font-size: 22px;
  line-height: 1.7;
}

.nest-ann__content > p,
.nest-ann__content > ul,
.nest-ann__content > ol {
  max-width: 900px;
  margin: 0 0 26px;
}

.nest-ann__content > ul,
.nest-ann__content > ol { padding-left: 1.3em; }
.nest-ann__content > ul > li { list-style: disc; margin-bottom: 10px; }
.nest-ann__content > ol > li { list-style: decimal; margin-bottom: 10px; }

.nest-ann__content strong { font-weight: 700; }

.nest-ann__content a:not([class]) {
  color: var(--nn-green-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.nest-ann__content h2 {
  max-width: 1100px;
  margin: 84px 0 22px;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.nest-ann__content h3 {
  max-width: 1100px;
  margin: 52px 0 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
}

.nest-ann__content img { max-width: 100%; height: auto; border-radius: 20px; }

/* Бланк письма */
.ann-letterhead {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 0 0 52px;
  padding-bottom: 42px;
  border-bottom: 1px solid rgba(48, 52, 57, .12);
}

.ann-letterhead__logo { flex: none; }

.ann-letterhead__text { flex: 1 1 auto; min-width: 0; }

.ann-letterhead img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 0;
}

.ann-letterhead .ann-letterhead__org {
  max-width: none;
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ann-letterhead .ann-letterhead__req {
  max-width: none;
  margin: 0;
  color: var(--nn-ink-soft);
  font-size: 17px;
  line-height: 1.6;
}

.nest-ann__content > .ann-doctype {
  max-width: 1060px;
  margin-bottom: 30px;
  color: var(--nn-green-ink);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.35;
}

.nest-ann__content > .ann-salutation {
  margin-bottom: 36px;
  font-size: 26px;
  font-weight: 500;
}

/* Официальное заявление */
.ann-statement {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  margin: 0 0 52px;
  padding: 48px 52px;
  border-radius: 30px;
  background: var(--nn-mint);
}

.ann-statement::before {
  content: "";
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D5A1C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5c0 4.5 3 8 7 10 4-2 7-5.5 7-10V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / 40px no-repeat;
  box-shadow: 0 10px 30px rgba(89, 158, 49, .22);
}

.ann-statement p {
  margin: 0;
  font-size: 27px;
  line-height: 1.55;
}

.ann-statement strong {
  display: block;
  margin-top: 14px;
  color: var(--nn-green-deep);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.25;
}

.nest-ann__content > .ann-next {
  padding: 32px 38px;
  border: 1px solid rgba(48, 52, 57, .14);
  border-radius: 30px;
}

/* Рекомендуемая замена */
.ann-swap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: start;
  gap: 72px;
  margin-top: 58px;
  padding-top: 58px;
  border-top: 1px solid rgba(48, 52, 57, .12);
}

.ann-swap__text > p {
  max-width: 900px;
  margin: 0 0 26px;
}

.ann-swap__text > p:last-child { margin-bottom: 0; }

.ann-swap__text > .ann-swap__lead {
  display: flex;
  gap: 22px;
  margin-bottom: 30px;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.5;
}

.ann-swap__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--nn-green-deep);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.ann-products {
  position: relative;
  display: grid;
  gap: 20px;
}

/* Плитка как карточка каталога: название слева, бутылка справа, уходящая за край */
.ann-product {
  position: relative;
  display: block;
  height: 230px;
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  color: var(--nn-ink);
  text-decoration: none;
  box-shadow: 0 14px 44px rgba(67, 67, 67, .13), 0 0 0 1px rgba(48, 52, 57, .06);
  transition: transform .45s var(--nn-ease), box-shadow .45s var(--nn-ease);
}

.ann-products--mix .ann-product { height: 200px; }

.ann-product:hover,
.ann-product:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 22px 54px rgba(67, 67, 67, .18), 0 0 0 1px rgba(89, 158, 49, .35);
  color: var(--nn-ink);
}

.nest-ann a.ann-product:focus-visible {
  border-radius: 30px;
  box-shadow: 0 22px 54px rgba(67, 67, 67, .18), 0 0 0 3px #fff, 0 0 0 6px var(--nn-green);
}

/* картинка якорится справа внизу и выступает за верх плитки, как в карточках каталога */
.nest-ann__content a .ann-product__img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  height: 112%;
  border-radius: 0;
}

.ann-product__meta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  box-sizing: border-box;
  max-width: 62%;
  height: 100%;
  padding: 28px 30px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.ann-product__go {
  color: var(--nn-green-ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ЭкоФус + Силиплант — баковая смесь: плюс между плитками */
.ann-products--mix::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background:
    linear-gradient(var(--nn-green-deep), var(--nn-green-deep)) center / 18px 3px no-repeat,
    linear-gradient(var(--nn-green-deep), var(--nn-green-deep)) center / 3px 18px no-repeat,
    var(--nn-yellow);
  box-shadow: 0 0 0 5px #fff, 0 8px 20px rgba(67, 67, 67, .2);
}

/* Финал и подпись */
.ann-closing {
  margin-top: 84px;
  padding: 54px 58px;
  border-radius: 30px;
  background: var(--nn-green-deep) linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%);
  color: #fff;
}

.ann-closing p {
  max-width: 1000px;
  margin: 0;
  color: #DCEAD2;
  font-size: 24px;
  line-height: 1.6;
}

.ann-closing strong {
  display: block;
  margin-bottom: 16px;
  color: #fff;
  font-size: 37px;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.ann-sign { margin-top: 52px; }

.ann-sign p { max-width: none; margin: 0; line-height: 1.55; }

.nest-ann__content .ann-sign .ann-sign__name {
  margin-top: 8px;
  font-size: 29px;
  font-weight: 700;
}

.nest-ann__download {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 64px;
  padding: 18px 32px;
  border: 2px solid var(--nn-green-ink);
  border-radius: 21px;
  color: var(--nn-green-ink);
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .3s var(--nn-ease), color .3s var(--nn-ease);
}

.nest-ann__download:hover,
.nest-ann__download:focus-visible {
  background: var(--nn-green-ink);
  color: #fff;
}

/* Ниже ~1250 px контейнер сайта упирается в края окна: на странице объявления оставляем поля */
@media (min-width: 751px) and (max-width: 1250px) {
  .nest-ann .container { box-sizing: border-box; padding: 0 32px; }
}

@media (max-width: 1100px) {
  .nest-ann__card { padding: 56px 52px 64px; }
  .ann-swap { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
}

@media (max-width: 900px) {
  .ann-swap { grid-template-columns: 1fr; gap: 36px; }
  .ann-products--mix { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 750px) {
  section.nest-ann { padding-bottom: 64px; }
  .nest-ann .container { width: auto; max-width: none; margin: 0 16px; }
  .nest-ann__title { margin: 20px 0 24px; font-size: 26px; }
  .nest-ann__card { padding: 28px 20px 36px; border-radius: 24px; box-shadow: 0 14px 44px rgba(67, 67, 67, .14); }
  .nest-ann__content { font-size: 17px; line-height: 1.65; }
  .nest-ann__content > p,
  .nest-ann__content > ul,
  .nest-ann__content > ol { margin-bottom: 20px; }
  .nest-ann__content h2 { margin: 48px 0 16px; font-size: 24px; }
  .nest-ann__content h3 { margin: 36px 0 12px; font-size: 20px; }
  .ann-letterhead { gap: 16px; margin-bottom: 28px; padding-bottom: 24px; }
  .ann-letterhead img { width: 64px; }
  .ann-letterhead .ann-letterhead__org { margin-bottom: 6px; font-size: 11.5px; letter-spacing: .03em; }
  .ann-letterhead .ann-letterhead__req { font-size: 12.5px; line-height: 1.55; }
  .nest-ann__content > .ann-doctype { margin-bottom: 20px; font-size: 19px; }
  .nest-ann__content > .ann-salutation { margin-bottom: 24px; font-size: 18px; }
  .ann-statement { flex-direction: column; gap: 18px; margin-bottom: 32px; padding: 24px 20px; border-radius: 24px; }
  .ann-statement::before { width: 48px; height: 48px; border-radius: 16px; background-size: 28px; }
  .ann-statement p { font-size: 18px; }
  .ann-statement strong { margin-top: 10px; font-size: 24px; }
  .nest-ann__content > .ann-next { padding: 20px; border-radius: 22px; }
  .ann-swap { gap: 28px; margin-top: 36px; padding-top: 36px; }
  .ann-swap__text > p { margin-bottom: 20px; }
  .ann-swap__text > .ann-swap__lead { gap: 12px; margin-bottom: 22px; font-size: 18px; }
  .ann-swap__num { width: 36px; height: 36px; border-radius: 12px; font-size: 18px; }
  .ann-products { gap: 14px; }
  .ann-product,
  .ann-products--mix .ann-product { height: 160px; border-radius: 22px; }
  .nest-ann a.ann-product:focus-visible { border-radius: 22px; }
  .ann-product__meta { max-width: 66%; gap: 8px; padding: 18px; font-size: 18px; }
  .ann-product__go { font-size: 11.5px; }
  .ann-products--mix::after { width: 36px; height: 36px; margin: -18px 0 0 -18px; background-size: 14px 2.5px, 2.5px 14px, auto; box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(67, 67, 67, .2); }
  .ann-closing { margin-top: 48px; padding: 28px 20px; border-radius: 24px; }
  .ann-closing strong { margin-bottom: 12px; font-size: 22px; }
  .ann-closing p { font-size: 17px; }
  .ann-sign { margin-top: 36px; }
  .nest-ann__content .ann-sign .ann-sign__name { font-size: 20px; }
  .nest-ann__download { box-sizing: border-box; width: 100%; justify-content: center; margin-top: 40px; padding: 14px 20px; border-radius: 16px; font-size: 16px; }
}

@media print {
  .nest-notice,
  .nest-notice-spacer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nest-notice,
  .nest-notice-spacer,
  .nest-notice__close,
  .nest-notice__cta,
  .nest-notice__cta svg,
  .ann-product,
  .nest-ann__download { transition: none; }
  .nest-notice__link:hover .nest-notice__cta svg,
  .nest-notice__link:focus-visible .nest-notice__cta svg,
  .ann-product:hover,
  .ann-product:focus-visible { transform: none; }
}
