/* ARVESSA — responsive finishing for the home page.
   Loaded after the original responsive styles and the desktop polish layer. */

@media (max-width: 1023px) {
  /* The legacy 1fr track keeps the intrinsic 1300px width of its widest child. */
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 72px;
  }

  main > section,
  main > section > .container,
  .main-calculator__wrapper,
  .calculator,
  .calculator__options,
  .calculator__offer,
  .calculator__offer-grid {
    min-width: 0;
  }

  main h2,
  .main-listing .cat-h1 {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .benefits__left h2 {
    max-width: 260px;
    font-size: 30px;
    line-height: 1.08;
  }

  .main-banner {
    isolation: isolate;
  }

  .main-banner__wrapper {
    min-height: 420px;
  }

  .main-banner__content {
    max-width: 300px;
    gap: 14px;
  }

  .main-banner__content .button {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    margin: 0;
  }

  .main-banner__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }

  .main-banner__catalog-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--color-grey-600);
    font-weight: 700;
    font-size: 14px;
  }

  .main-banner__image img {
    object-position: 65% center;
  }

  .main-banner__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .66) 33%, rgba(255, 255, 255, 0) 72%);
    pointer-events: none;
  }

  .main-calculator .calculator {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-calculator .calculator__options,
  .main-calculator .calculator__offer-wrapper {
    width: 100%;
    max-width: 760px;
  }

  .main-calculator .calculator__offer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  main {
    gap: 60px;
  }

  .main-banner {
    margin: -10px 0 -30px;
    overflow: hidden;
    background: #fff;
  }

  .main-banner__wrapper {
    z-index: 2;
    min-height: 280px;
    height: 280px;
    padding: 26px 5px 15px;
  }

  .main-banner__content {
    max-width: 265px;
    gap: 12px;
  }

  .main-banner__content h1 {
    font-size: clamp(42px, 11.8vw, 48px);
    line-height: .94;
  }

  .main-banner__content p {
    font-size: 14px;
    line-height: 1.3;
  }

  .main-banner__content .button {
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
  }

  .main-banner__catalog-link {
    min-height: 32px;
    font-size: 13px;
  }

  .main-banner__image {
    position: relative;
    top: auto;
    left: auto;
    z-index: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 750 / 514;
    overflow: hidden;
  }

  .main-banner__image picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .main-banner__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .main-banner__image::after {
    content: none;
  }

  .main-banner__sticker {
    display: block;
    top: calc(100% + 68.533vw - 53px);
    left: 15px;
    bottom: auto;
    z-index: 3;
  }

  .main-banner__sticker-1 {
    top: calc(100% + 68.533vw - 53px);
    right: 15px;
    bottom: auto;
    z-index: 3;
  }

  .benefits__item p,
  .obtain__item-content p {
    color: #65676c;
  }

  .benefits__left h2 {
    max-width: 260px;
    font-size: 30px;
    line-height: 1.08;
  }

  .obtain__list {
    gap: 16px;
  }

  .obtain__item-image {
    height: 138px;
  }

  .obtain__item-content {
    gap: 8px;
    padding: 16px 17px 18px;
  }

  .obtain__item-content span {
    font-size: 18px;
    line-height: 1.24;
  }

  .main-listing .cat-wrap {
    padding: 0 15px 12px;
  }

  .main-listing .cat-head {
    display: grid;
    gap: 5px;
  }

  .main-listing .cat-h1 {
    font-size: 28px;
    line-height: 1.12;
    letter-spacing: -.025em;
  }

  .main-listing .cat-count {
    font-size: 13px;
  }

  .main-listing .cat-sub {
    margin-top: 9px;
    font-size: 14px;
    line-height: 1.45;
  }

  .main-listing .cat-nav {
    margin-right: -15px;
    padding: 15px 15px 17px 0;
  }

  .main-listing .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .main-listing .cat-card {
    min-width: 0;
    border-radius: 14px;
  }

  .main-listing .cat-card__imgwrap {
    aspect-ratio: 1.2;
  }

  .main-listing .cat-badge {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .main-listing .cat-card__body {
    gap: 6px;
    padding: 11px 11px 12px;
  }

  .main-listing .cat-card__title {
    font-size: 15px;
    line-height: 1.25;
  }

  .main-listing .cat-card__tags {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 11px;
    line-height: 1.35;
  }

  .main-listing .cat-card__price {
    font-size: 17px;
    line-height: 1.15;
  }

  .main-listing .cat-card__price small {
    font-size: 12px;
  }

  .main-listing .cat-card__old {
    display: block;
    margin: 3px 0 0;
    font-size: 11px;
    line-height: 1.2;
  }

  .main-listing .cat-card__btn {
    min-height: 38px;
    padding: 9px 8px;
    border-radius: 9px;
    font-size: 12px;
  }

  .main-listing .cat-wrap > div:last-child a {
    max-width: 100%;
  }

  .main-calculator .calculator__options {
    gap: 19px;
    padding: 29px 15px 24px;
  }

  .main-calculator .calculator__options h2 {
    font-size: 28px;
    line-height: 1.13;
  }

  .main-calculator .calculator__options-list {
    gap: 10px;
  }

  .main-calculator .calculator__options-item {
    gap: 9px;
    padding: 15px;
    border-radius: 13px;
    box-shadow: 0 5px 18px rgba(17, 10, 7, .07);
  }

  .main-calculator .calculator__type,
  .main-calculator .calculator__size {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .main-calculator .calculator__type-item {
    min-width: 0;
    gap: 7px;
    padding: 12px 3px 9px;
    font-size: 12px;
    text-align: center;
  }

  .main-calculator .calculator__type-item svg {
    width: 36px;
    height: 36px;
  }

  .main-calculator .calculator__size-item {
    min-width: 0;
    gap: 7px;
    font-size: 11px;
  }

  .main-calculator .calculator__size-item input {
    width: 100%;
    min-width: 0;
    padding: 11px 3px;
    text-align: center;
  }

  .main-calculator .calculator__material {
    gap: 5px;
  }

  .main-calculator .calculator__options-total-wrapper {
    padding: 4px 0 0;
  }

  .main-calculator .calculator__total {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
  }

  .main-calculator .calculator__offer-wrapper {
    gap: 20px;
    padding: 24px 15px 28px;
  }

  .main-calculator .calculator__stickers {
    flex-wrap: wrap;
    gap: 7px;
  }

  .main-calculator .calculator__stickers .sticker {
    margin: 0;
    padding: 6px 10px;
  }

  .main-calculator .calculator__offer-grid {
    gap: 18px;
  }

  .main-calculator .calculator__offer-item {
    gap: 8px;
    padding: 14px 16px;
  }

  .main-calculator .calculator__offer-form {
    padding: 22px;
  }

  .stages__wrapper,
  .stages__left,
  .stages__right,
  .stages__descriptions,
  .stages__list {
    min-width: 0;
  }

  .stages__right {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .stages__description {
    gap: 12px;
  }

  .stages__description span {
    font-size: 56px;
  }

  .stages__list.h3 {
    display: flex;
    gap: 8px;
    width: calc(100% + 30px);
    margin: 0 -15px;
    padding: 3px 15px 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    font-size: 12px;
  }

  .stages__list::-webkit-scrollbar {
    display: none;
  }

  .stages__list li {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid #e5e1dd;
    border-radius: 999px;
    color: #62666a;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .stages__list li.is-active {
    border-color: var(--color-orange-200);
    background: var(--color-orange-100);
    color: var(--color-orange-300);
  }

  .messengers-button {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: none;
    width: 56px;
    height: 56px;
    box-shadow: 0 7px 22px rgba(32, 36, 40, .22);
  }

  .messengers-button::before,
  .messengers-button::after {
    content: none;
  }
}

@media (max-width: 375px) {
  .main-banner__content {
    max-width: 242px;
  }

  .main-banner__sticker-1 {
    max-width: 160px;
    font-size: 11px;
  }

  .main-listing .cat-grid {
    gap: 10px;
  }

  .main-listing .cat-card__body {
    padding: 10px;
  }
}
