/* Страница-гайд «Максимальная цена» (/ru/max-price).
   Секции, контейнер, заголовки, кнопки и бейдж — из guide.css. Хедер и футер —
   из style.css языковой папки. Здесь только блоки этой страницы. */

.max-price{
  --mp-you: var(--g-blue);
  --mp-you-soft: #007aff0d;
  --mp-max: var(--g-green);
  --mp-track: #e5e5ea;
}

/* Появление блоков при скролле — как на остальных гайдах */
@keyframes mpRise{
  from{ opacity: 0; transform: translateY(18px); }
  to{ opacity: 1; transform: none; }
}

.max-price [data-reveal]{
  animation: mpRise .7s cubic-bezier(.2, .7, .2, 1) both;
}

@supports (animation-timeline: view()){
  .max-price [data-reveal]{
    animation: mpRise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

/* Подзаголовок под h2 секции */
.max-price__lead{
  margin: 12px 0 0;
  max-width: 44em;
  font-size: 17px;
  line-height: 1.55;
  color: var(--g-muted);
  text-wrap: pretty;
}

.max-price__center{
  text-align: center;
}

.max-price__lead.max-price__center{
  margin-inline: auto;
}

/* Цена — всегда в одну строку */
.max-price__price{
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------- */
/* 1. Первый экран: текст слева, карточка товара справа */

.max-price-hero{
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.max-price-hero__text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.max-price-hero__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Карточка «Продавцы в карточке» */
.max-price-card{
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-block);
  background: #ffffff;
  box-shadow: 0 30px 70px -30px #18181840;
}

.max-price-card__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--g-line);
}

.max-price-card__title{
  font-size: 15px;
  font-weight: 600;
}

.max-price-card__meta{
  font-size: 13px;
  color: var(--g-muted);
}

.max-price-card__list{
  margin: 0;
  padding: 8px 22px;
  list-style: none;
}

.max-price-seller{
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  transition: opacity .4s;
}

.max-price-seller + .max-price-seller{
  border-top: 1px solid var(--g-line-3);
}

.max-price-seller__avatar{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--g-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--g-muted);
}

.max-price-seller--you .max-price-seller__avatar{
  background: var(--mp-you);
  color: #ffffff;
}

.max-price-seller__info{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.max-price-seller__name{
  font-size: 15px;
  font-weight: 600;
}

.max-price-seller__note{
  font-size: 13px;
  color: var(--g-muted);
  transition: color .3s;
}

.max-price-seller__price{
  font-family: var(--g-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--g-muted);
}

.max-price-seller--you .max-price-seller__price{
  font-size: 20px;
  font-weight: 700;
  color: var(--mp-you);
}

/* Конкурент ушёл из карточки */
.max-price-card[data-rival="gone"] .max-price-seller--rival{
  opacity: .4;
}

.max-price-card[data-rival="gone"] .max-price-seller--rival .max-price-seller__name,
.max-price-card[data-rival="gone"] .max-price-seller--rival .max-price-seller__price{
  text-decoration: line-through;
}

.max-price-card[data-at-max] .max-price-seller--you .max-price-seller__note{
  color: var(--g-green-text);
}

/* Коридор мин.–макс. */
.max-price-card__range{
  padding: 20px 22px 22px;
  border-top: 1px solid var(--g-line);
  background: var(--g-bg-soft);
}

.max-price-card__limits{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--g-muted);
}

.max-price-card__limit-max{
  font-weight: 600;
  color: var(--g-green-text);
}

.max-price-bar{
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--mp-track);
}

.max-price-bar__fill{
  position: absolute;
  inset: 0 auto 0 0;
  width: 53%;
  border-radius: 5px;
  background: var(--mp-you);
}

.max-price-bar__cap{
  position: absolute;
  top: -6px;
  right: -1px;
  width: 2px;
  height: 22px;
  background: var(--mp-max);
}

.max-price-card__foot{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.max-price-card__caption{
  font-size: 13px;
  color: var(--g-muted);
}

.max-price .max-price-card__toggle{
  padding: 8px 14px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-button);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: var(--g-ink);
  transition: border-color .2s, color .2s;
}

.max-price .max-price-card__toggle:hover{
  border-color: var(--g-blue);
  color: var(--g-blue);
}

/* ---------------------------------------------------------------------------- */
/* 2. Когда бот считает, что вы один */

.max-price-cases{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.max-price-case{
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 12px 12px 24px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-block);
  background: #ffffff;
}

.max-price-case__card{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 10px;
  border-radius: var(--g-radius-card);
  background: var(--g-bg-soft);
  list-style: none;
}

.max-price-case__head{
  display: flex;
  justify-content: space-between;
  padding: 4px 4px 8px;
  font-size: 12px;
  color: var(--g-faint);
}

.max-price-row{
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 0 12px;
  border-radius: 10px;
}

.max-price-row--you{
  background: #ffffff;
}

.max-price-row__avatar{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  color: var(--g-faint);
}

.max-price-row--you .max-price-row__avatar{
  background: var(--mp-you);
  color: #ffffff;
}

.max-price-row__info{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.max-price-row__name{
  overflow: hidden;
  font-size: 14px;
  color: var(--g-faint);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.max-price-row--you .max-price-row__name{
  font-weight: 600;
  color: var(--g-ink);
}

.max-price-row__tag{
  font-size: 12px;
  font-weight: 600;
  color: var(--g-muted);
}

.max-price-row__price{
  font-size: 14px;
  font-weight: 700;
  color: var(--g-green-text);
}

.max-price-case__empty{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 116px;
  border: 1px dashed #d9d9e3;
  border-radius: 10px;
  font-size: 13px;
  color: var(--g-faint);
}

.max-price-case__body{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px;
}

.max-price-case__title{
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--g-ink);
}

.max-price-case__text{
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--g-muted);
}

/* ---------------------------------------------------------------------------- */
/* 3. Где настроить: таблица «Управление товарами» */

.max-price-table{
  margin-top: 40px;
  overflow: hidden;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-block);
  background: #ffffff;
  box-shadow: 0 24px 60px -34px #18181833;
}

.max-price-table__head{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--g-line);
}

.max-price-table__title{
  font-size: 15px;
  font-weight: 600;
}

.max-price-cities{
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--g-pill);
}

.max-price .max-price-cities__button{
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--g-muted);
  transition: background .2s, color .2s, box-shadow .2s;
}

.max-price .max-price-cities__button[aria-pressed="true"]{
  background: #ffffff;
  color: var(--g-ink);
  box-shadow: 0 1px 3px #0000001a;
}

.max-price-table__scroll{
  overflow-x: auto;
}

.max-price-table__grid{
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}

.max-price-table__grid th,
.max-price-table__grid td{
  padding: 16px;
  border-bottom: 1px solid var(--g-line-3);
  font-size: 15px;
  text-align: left;
  vertical-align: middle;
}

.max-price-table__grid th:first-child,
.max-price-table__grid td:first-child{
  width: 38%;
  padding-left: 20px;
}

.max-price-table__grid thead th{
  padding-block: 12px;
  border-bottom-color: var(--g-line);
  font-size: 13px;
  font-weight: 400;
  color: var(--g-muted);
}

.max-price-table__grid tbody th{
  font-weight: 500;
}

.max-price-table__grid td{
  color: var(--g-muted);
}

/* Колонка «Макс. цена» — подсвечена рамкой */
.max-price-table__grid .max-price-table__max{
  padding-block: 8px;
  border-inline: 2px solid var(--mp-you);
  background: #007aff0a;
}

.max-price-table__grid thead .max-price-table__max{
  padding-block: 12px;
  border-top: 2px solid var(--mp-you);
  background: #007aff14;
  font-weight: 600;
  color: var(--mp-you);
}

.max-price-table__grid tbody tr:last-child .max-price-table__max{
  border-bottom: 2px solid var(--mp-you);
}

.max-price-table__input{
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--g-line-2);
  border-radius: 6px;
  background: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--g-ink);
}

.max-price-table__input:focus{
  border-color: var(--mp-you);
  outline: 2px solid #007aff33;
}

.max-price-table__input[aria-invalid="true"]{
  border-color: var(--g-red);
}

.max-price-table__note{
  margin: 0;
  padding: 14px 20px;
  background: #fcfcfe;
  font-size: 13px;
  color: var(--g-muted);
}

.max-price-table__note[data-state="warn"]{
  color: var(--g-red-text);
}

/* ---------------------------------------------------------------------------- */
/* 4. Важно знать */

.max-price-facts{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.max-price-fact{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.max-price-fact__value{
  font-family: var(--g-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--g-ink);
}

.max-price-fact__value--red{
  color: var(--g-red);
}

.max-price-fact__value--green{
  color: var(--g-green);
}

.max-price-fact__title{
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--g-ink);
}

.max-price-fact__text{
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--g-muted);
}

/* ---------------------------------------------------------------------------- */
/* 5. FAQ — стили общие, в guide.css (.guide-faq) */

/* ---------------------------------------------------------------------------- */
/* 6. Финальный блок */

.max-price-final-section{
  border-top: 1px solid var(--g-line);
}

.max-price-final{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.max-price-final__title{
  flex: 1 1 420px;
  max-width: 22em;
  text-wrap: balance;
}

/* ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce){
  .max-price *,
  .max-price *::before,
  .max-price *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media screen and (max-width: 1280px){
  .max-price-fact__value{
    font-size: 38px;
  }
}

@media screen and (max-width: 1024px){
  .max-price-hero{
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .max-price-cases{
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
  .max-price-facts{
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media screen and (max-width: 600px){
  .max-price-hero__actions .guide__cta{
    width: 100%;
  }
  .max-price-card__head,
  .max-price-card__range{
    padding-inline: 16px;
  }
  .max-price-card__list{
    padding-inline: 16px;
  }
  .max-price-seller{
    gap: 10px;
  }
  .max-price-seller__price,
  .max-price-seller--you .max-price-seller__price{
    font-size: 16px;
  }
  .max-price-cities{
    width: 100%;
  }
  .max-price .max-price-cities__button{
    flex: 1 1 0;
  }
  .max-price-fact__value{
    font-size: 34px;
  }

  .max-price-final .guide__cta{
    width: 100%;
  }
}
