/* Approved home-page UX improvements. Loaded after the theme stylesheet. */

section[id] {
  scroll-margin-top: 84px;
}

.md-main-color-btn::after {
  content: none !important;
  display: none !important;
  -webkit-animation: none !important;
  animation: none !important;
}

/* Product cards: image -> name -> price -> key details -> actions. */
#products .catalog__container .container-flex {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 1.5vw, 26px);
  align-items: stretch;
  margin: 0;
}

#products .catalog__item {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 20px 22px;
  border: 1px solid rgba(165, 154, 136, 0.28);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(33, 29, 24, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  #products .catalog__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(33, 29, 24, 0.12);
  }
}

#products .catalog__item .item-slider {
  order: 1;
  width: calc(100% + 40px);
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  margin: 0 0 40px -20px;
  overflow: hidden;
}

#products .catalog__item .item-slider .swiper-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#products .catalog__item .item-slider .swiper-wrapper,
#products .catalog__item .item-slider .swiper-slide {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
}

#products .catalog__item .item-slider .swiper-slide img {
  display: block;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover;
  object-position: center;
}

#products .catalog__item .item-slider .slider-pagination {
  bottom: -28px;
}

#products .catalog__item .item-slider .slider-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 5px;
}

#products .catalog__item .item-name {
  order: 2;
  min-height: 56px;
  margin: 0 0 14px;
  padding: 0;
  color: #171512;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  pointer-events: auto;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#products .catalog__item .item-price {
  order: 3;
  justify-content: flex-start;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
}

#products .catalog__item .item-price .current-price {
  color: #2e2a24;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

#products .catalog__item .item-price .current-price span {
  font-size: 32px;
  font-weight: 700;
}

#products .catalog__item .item-price .old-price {
  color: #8f897f;
  font-size: 13px;
  line-height: 1.2;
}

#products .catalog__item .item-price .old-price span {
  font-size: 16px;
}

#products .catalog__item .item-text {
  order: 4;
  min-height: 0;
  margin: 0;
  padding: 15px 0 18px;
  border-top: 1px solid rgba(165, 154, 136, 0.24);
  color: #4e4942;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

#products .catalog__item .item-text p {
  margin: 0 0 6px;
}

#products .catalog__item .item-text p:last-child {
  margin-bottom: 0;
}

#products .catalog__item .item-text b {
  color: #24211d;
  font-weight: 600;
}

#products .catalog__item .item-order {
  order: 5;
  width: 100%;
  min-height: 52px;
  height: auto;
  margin: auto 0 0;
  padding: 12px 18px;
  border: 1px solid #a59a88;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.2;
}

#products .catalog__item .info-price {
  order: 6;
  margin: 14px 0 0;
  text-align: center;
}

#products .catalog__item .info-price .link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: #514a40;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

@media only screen and (min-width: 769px) and (max-width: 1200px) {
  #products .catalog__container .container-flex {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only screen and (max-width: 768px) {
  /* The original theme's mobile header/menu is intentionally preserved. */

  .side-fixed-links {
    display: none !important;
  }

  body.page {
    padding-bottom: 56px !important;
  }

  section[id] {
    scroll-margin-top: 72px;
  }

  .catalog__container .container-flex {
    display: block;
    margin: 0;
  }

  .catalog__item {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 24px;
    padding: 0 18px 24px;
  }

  .catalog:not(.md-all-items-visible) .catalog__item:nth-child(n + 5) {
    display: none;
  }

  .catalog__item .item-slider {
    width: calc(100% + 36px);
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0 0 52px -18px;
  }

  .catalog__item .item-slider .swiper-container,
  .catalog__item .item-slider .swiper-container .swiper-wrapper,
  .catalog__item .item-slider .swiper-container .swiper-slide,
  .catalog__item .item-slider .swiper-container .swiper-slide img {
    width: 100%;
    height: 100%;
  }

  .catalog__item .item-status {
    left: auto;
    right: 8px;
    width: auto;
  }

  .catalog__item .item-price {
    margin-bottom: 16px;
  }

  .catalog__item .item-price .current-price {
    justify-content: flex-start;
    font-size: 26px;
    line-height: 1.2;
  }

  .catalog__item .item-price .old-price {
    justify-content: flex-start;
  }

  .catalog__item .item-name {
    min-height: 0;
    margin-bottom: 14px;
    font-size: 18px;
    line-height: 1.3;
  }

  .catalog__item .item-text {
    min-height: 0;
    font-size: 14px;
    line-height: 1.5;
  }

  .catalog__item .item-order {
    width: 100%;
    min-height: 48px;
  }

  #products .catalog__item {
    padding: 0 16px 20px;
    border-radius: 16px;
  }

  #products .catalog__container .container-flex {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin: 0;
  }

  #products .catalog__item .item-slider {
    width: calc(100% + 32px);
    height: auto !important;
    margin: 0 0 40px -16px;
  }

  #products .catalog__item .item-name {
    min-height: 0;
    margin-bottom: 12px;
    font-size: 19px;
  }

  #products .catalog__item .item-price {
    margin-bottom: 14px;
  }

  #products .catalog__item .item-price .current-price {
    font-size: 15px;
  }

  #products .catalog__item .item-price .current-price span {
    font-size: 30px;
  }

  #products .catalog__item .item-text {
    padding: 14px 0 17px;
    font-size: 14px;
  }

  #products .catalog__item .item-order {
    width: 100%;
    min-height: 50px;
    font-size: 15px;
  }

}

/* Inline calculation block placed directly after the original quiz. */
.quick-calculation {
  position: relative;
  z-index: 2;
  padding: clamp(72px, 7vw, 128px) 0;
  overflow: visible;
  background: #f5f3ef;
  scroll-margin-top: 88px;
}

.quick-calculation__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  gap: clamp(34px, 5vw, 84px);
  align-items: center;
  padding: clamp(38px, 4vw, 68px);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(171, 158, 136, 0.24), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(171, 158, 136, 0.12), transparent 35%),
    #11110f;
  box-shadow: 0 28px 70px rgba(30, 27, 22, 0.15);
}

.quick-calculation__card::after {
  content: none;
  display: none;
}

.quick-calculation__content,
.quick-calculation__form {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.quick-calculation__form {
  z-index: 3;
}

.quick-calculation__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #c1b49f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.quick-calculation__eyebrow span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #afa28d;
  box-shadow: 0 0 0 5px rgba(175, 162, 141, 0.14);
}

.quick-calculation__title {
  max-width: 560px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.quick-calculation__text {
  max-width: 540px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  line-height: 1.55;
}

.quick-calculation__advantages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.quick-calculation__advantages > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.quick-calculation__advantages b {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.quick-calculation__advantages span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.quick-calculation__form {
  width: 100%;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quick-calculation__form-title {
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-calculation__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-calculation .form-select,
.quick-calculation .form-input,
.quick-calculation .form-btn {
  width: 100%;
  min-width: 0;
  height: 58px;
  margin: 0;
  border-radius: 14px;
  font-size: 15px;
}

.quick-calculation .form-input,
.quick-calculation .form-select {
  border: 1px solid rgba(165, 154, 136, 0.24);
  background-color: #fff;
}

.quick-calculation .form-input:focus,
.quick-calculation .form-select:focus-within {
  border-color: #b2a58f;
  box-shadow: 0 0 0 3px rgba(178, 165, 143, 0.16);
  outline: none;
}

.quick-calculation .form-select span.current {
  max-width: calc(100% - 28px);
  overflow: hidden;
  line-height: 58px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-calculation .form-select .list {
  z-index: 100;
  top: calc(100% + 6px);
  width: 100%;
  max-height: none;
  margin-top: 0;
  overflow: hidden;
  padding: 4px 0;
  border: 1px solid rgba(165, 154, 136, 0.3);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(17, 17, 15, 0.18);
}

.quick-calculation .form-select.open {
  z-index: 90;
  border-radius: 14px;
}

.quick-calculation .md-standart-form .form-select .list .option {
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(165, 154, 136, 0.14);
  color: #25221e;
  font-size: 14px;
  line-height: 44px;
}

.quick-calculation .md-standart-form .form-select .list .option:last-child {
  border-bottom: 0;
}

.quick-calculation .md-standart-form .form-select .list .option:hover,
.quick-calculation .md-standart-form .form-select .list .option.focus,
.quick-calculation .md-standart-form .form-select .list .option.selected.focus {
  background: #f2efe9;
}

.quick-calculation .form-btn {
  justify-content: center;
  border-color: #a99d88;
  background: #a99d88;
}

.quick-calculation .form-btn span {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.quick-calculation .form-checkbox {
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  margin-top: 16px;
}

.quick-calculation .form-checkbox p {
  color: rgba(255, 255, 255, 0.56);
}

.quick-calculation .form-checkbox p span {
  color: rgba(255, 255, 255, 0.78);
}

@media (hover: hover) {
  .quick-calculation .form-btn:hover {
    border-color: #bcaf99;
    background: #bcaf99;
  }
}

@media only screen and (max-width: 1180px) {
  .quick-calculation__card {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .quick-calculation__content {
    max-width: 760px;
  }

  .quick-calculation__form {
    max-width: 780px;
  }
}

@media only screen and (max-width: 768px) {
  /* The portrait belonged to the old consultation composition and took almost
     a full screen on phones. Keep the form, contacts and messengers compact. */
  .get-consultation__person,
  .get-consultation.md-style-2 .get-consultation__person {
    display: none !important;
  }

  .get-consultation__container {
    min-height: 0;
    padding: 11.25vw 3.125vw !important;
    overflow: visible;
  }

  .get-consultation.md-style-2 .get-consultation__container {
    padding: 7.8125vw !important;
  }

  .quick-calculation {
    padding: 54px 0;
    scroll-margin-top: 68px;
  }

  .quick-calculation__card {
    display: block;
    padding: 34px 22px 24px;
    border-radius: 20px;
  }

  .quick-calculation__card::after {
    right: -180px;
    top: -185px;
  }

  .quick-calculation__content {
    margin-bottom: 28px;
  }

  .quick-calculation__eyebrow {
    align-items: flex-start;
    margin-bottom: 15px;
    font-size: 10px;
  }

  .quick-calculation__eyebrow span {
    margin-top: 2px;
  }

  .quick-calculation__title {
    margin-bottom: 14px;
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1.08;
  }

  .quick-calculation__text {
    font-size: 14px;
    line-height: 1.5;
  }

  .quick-calculation__advantages {
    gap: 8px;
    margin-top: 22px;
  }

  .quick-calculation__advantages > div {
    padding: 12px;
  }

  .quick-calculation__advantages b {
    font-size: 13px;
  }

  .quick-calculation__advantages span {
    font-size: 11px;
  }

  .quick-calculation__form {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .quick-calculation__form-title {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .quick-calculation__fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .quick-calculation .form-select,
  .quick-calculation .form-input,
  .quick-calculation .form-btn {
    height: 52px;
    border-radius: 12px;
    font-size: 14px;
  }

  .quick-calculation .form-select span.current {
    line-height: 52px;
  }

  .quick-calculation .form-select .list {
    max-height: none;
    padding: 3px 0;
    border-radius: 12px;
  }

  .quick-calculation .form-select.open {
    border-radius: 12px;
  }

  .quick-calculation .md-standart-form .form-select .list .option {
    min-height: 42px;
    padding: 0 14px;
    line-height: 42px;
  }

  .quick-calculation .form-btn span {
    font-size: 15px;
  }

  .quick-calculation .form-checkbox {
    align-items: flex-start;
    margin-top: 14px;
  }

  .quick-calculation .form-checkbox p {
    padding-top: 1px;
    font-size: 11px;
    line-height: 1.35;
  }
}

@media only screen and (max-width: 380px) {
  .quick-calculation__card {
    padding-right: 16px;
    padding-left: 16px;
  }

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