/*
 * Новый дизайн: шапка, футер и главная страница.
 * Подключается после app.css и перекрывает его легаси-правила для header/footer.
 * Брейкпоинты: десктоп > 1199, планшет 768–1199 (шапка — мобильная с 1023), мобильный ≤ 767.
 */

/* ===== Общее ===== */

.site-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.site-header,
.site-footer,
.home-section {
  font-family: "Open", "Open Sans", Arial, sans-serif;
}

.site-header a,
.site-footer a,
.home-section a {
  text-decoration: none;
  color: inherit;
}

/* ===== Шапка ===== */

.site-header {
  position: relative;
  z-index: 50;
  background: #fff;
  color: #000;
}

/* Невидимый эталон ширины для my_zoom() */
.site-header .zoom-probe {
  display: block;
  height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

.site-header__top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
  position: relative;
}

.site-header__top-inner::after {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 0;
  height: 1px;
  background: #e8e8e8;
}

.site-header__address,
.site-header__top-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.1;
  transition: color 0.2s;
}

.site-header__top-link {
  letter-spacing: -0.04em;
}

.site-header__address img,
.site-header__top-link img {
  flex-shrink: 0;
}

.site-header__top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header .site-header__phone {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  transition: color 0.2s;
}

.site-header__address:hover,
.site-header__top-link:hover,
.site-header .site-header__phone:hover {
  color: #f31b1b;
}

.site-header__main {
  display: flex;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-header__logo {
  flex-shrink: 0;
  display: block;
  width: 193px;
}

.site-header__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header__center {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}

.site-header .header-nav {
  display: block;
  margin: 0;
}

.site-header .header-nav__item {
  margin-right: 27px;
}

.site-header .header-nav__item:last-child {
  margin-right: 0;
}

.site-header .header-nav__link {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #000;
}

.site-header .header-nav__link:hover,
.site-header .header-nav__item--active .header-nav__link {
  color: #f31b1b;
}

/* Поиск показывается вместо меню по клику на лупу */
.site-header .header-search {
  display: none;
  width: 100%;
  max-width: 618px;
  margin: 0;
}

.site-header--search .header-nav {
  display: none;
}

.site-header--search .header-search {
  display: block;
}

.site-header .header-search input {
  width: 100%;
  height: 34px;
  border: 0;
  border-bottom: 1px solid #000;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-header__icons {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 14px;
  border-left: 1px solid #e8e8e8;
}

.site-header .site-header__icon {
  display: block;
  width: 40px;
  height: 34px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  cursor: pointer;
  position: relative;
}

.site-header .site-header__icon--search {
  background-image: url(../images/redesign/search.svg);
  background-position: left center;
  background-size: 21px 20px;
}

.site-header--search .site-header__icon--search {
  background-image: none;
}

.site-header--search .site-header__icon--search::before,
.site-header--search .site-header__icon--search::after {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 20px;
  height: 2px;
  background: #000;
  transform: rotate(45deg);
}

.site-header--search .site-header__icon--search::after {
  transform: rotate(-45deg);
}

.site-header .site-header__icon--cart {
  width: 60px;
  border-left: 1px solid #e8e8e8;
  border-right: 1px solid #e8e8e8;
  background-image: url(../images/redesign/cart.svg);
  background-position: center;
  background-size: 18px 24px;
}

.site-header .header-item--cart > a {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.site-header .site-header__icon--user {
  background-image: url(../images/redesign/user.svg);
  background-position: right center;
  background-size: 19px 20px;
}

.site-header .site-header__burger {
  display: none;
}

@media screen and (max-width: 1199px) {
  .site-header .header-nav__item {
    margin-right: 18px;
  }

  .site-header .header-nav__link {
    font-size: 13px;
  }
}

@media screen and (max-width: 1023px) {
  .site-header__top,
  .site-header__center,
  .site-header .site-header__icon--search,
  .site-header .site-header__icon--user {
    display: none;
  }

  .site-header__main {
    position: relative;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-header .site-header__burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .site-header__burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #050505;
  }

  .site-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
  }

  .site-header__icons {
    padding-left: 0;
    border-left: 0;
  }

  .site-header .site-header__icon--cart {
    width: 48px;
    border: 0;
  }
}

/* ===== Главная ===== */

.home-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 40px;
}

.home-section--hero {
  padding-top: 10px;
}

.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-hero__item {
  position: relative;
  display: block;
  aspect-ratio: 674 / 762;
  overflow: hidden;
  background: #efefef;
}

.home-hero__item picture,
.home-hero__img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero__img {
  object-fit: cover;
  transition: transform 0.6s ease;
}

.home-hero__label {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: 8px 16px;
  background: #fff;
  color: #333;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}

a.home-hero__item:hover .home-hero__img,
a.home-category:hover .home-category__img img {
  transform: scale(1.03);
}

a.home-hero__item:hover .home-hero__label {
  background: #000;
  color: #fff;
}

.home-categories {
  margin-top: 60px;
}

.home-categories__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 20px;
}

.home-category {
  display: block;
}

.home-category__img {
  display: block;
  aspect-ratio: 445 / 524;
  overflow: hidden;
  background: #f2f2f2;
}

.home-category__img picture,
.home-category__img img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-category__img img {
  object-fit: cover;
  transition: transform 0.6s ease;
}

.home-category__name {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  color: #2d2d2d;
  transition: color 0.2s;
}

a.home-category:hover .home-category__name {
  color: #f31b1b;
}

.home-products {
  margin-top: 80px;
  padding-bottom: 80px;
  overflow: hidden;
}

.home-products__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

.home-products__tabs {
  display: flex;
  gap: 20px;
  min-width: 0;
}

.home-products__tab-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.home-products__tab-btn:hover,
.home-products__tab-btn--active {
  opacity: 1;
}

.home-products__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.home-products__counter {
  margin-right: 2px;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.home-products__arrow {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.home-products__arrow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(../images/redesign/arrow-slider.svg) no-repeat center / 10px 10px;
}

.home-products__arrow--prev::after {
  transform: rotate(180deg);
}

.home-products__arrow:disabled {
  cursor: default;
}

.home-products__arrow:disabled::after {
  opacity: 0.1;
}

.home-products--static .home-products__nav {
  visibility: hidden;
}

.home-products__tab {
  display: none;
}

.home-products__tab--active {
  display: block;
}

.home-products__slider {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.home-product__img {
  display: block;
  aspect-ratio: 331 / 448;
  background: #fff;
  overflow: hidden;
}

.home-product__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-product__name {
  display: block;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #000;
}

.home-product__name:hover {
  color: #f31b1b;
}

.home-product__price {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.home-product__price-old {
  margin-left: 8px;
  font-weight: 400;
  color: #6f6f6f;
}

.home-products__empty {
  font-size: 16px;
  color: #6f6f6f;
}

.home-products__progress {
  display: none;
}

.home-products__more {
  margin-top: 40px;
  text-align: center;
}

.home-btn {
  display: inline-block;
  padding: 8px 32px;
  background: #000;
  color: #fff !important;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 0.2s;
}

.home-btn:hover {
  background: #f31b1b;
}

@media screen and (max-width: 1023px) {
  .site-container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .site-header__top-inner::after {
    left: 24px;
    right: 24px;
  }

  .home-title {
    font-size: 28px;
  }

  .home-section--hero {
    padding-top: 4px;
  }
}

@media screen and (max-width: 767px) {
  .site-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .home-hero__item {
    aspect-ratio: 358 / 408;
  }

  .home-hero__label {
    font-size: 14px;
  }

  .home-categories {
    margin-top: 40px;
  }

  .home-categories__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
  }

  .home-category__img {
    aspect-ratio: 174 / 248;
  }

  .home-category__name {
    font-size: 14px;
  }

  .home-products {
    margin-top: 60px;
    padding-bottom: 60px;
  }

  .home-products__head {
    margin-bottom: 20px;
  }

  .home-products__tabs {
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: -16px;
    padding-right: 16px;
  }

  .home-products__tabs::-webkit-scrollbar {
    display: none;
  }

  .home-products__nav {
    display: none;
  }

  /* Следующая карточка выглядывает из-за края экрана */
  .home-products__slider {
    overflow: visible;
  }

  .home-products__slider .swiper-slide {
    width: 266px;
  }

  .home-product__img {
    aspect-ratio: 266 / 360;
  }

  .home-products__progress {
    display: block;
    position: relative;
    height: 2px;
    margin-top: 20px;
    background: #d9dfe3;
  }

  .home-products--static .home-products__progress {
    display: none;
  }

  .home-products__progress span {
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    height: 100%;
    background: #000;
  }

  .home-products__more {
    margin-top: 20px;
  }

  .home-btn {
    display: block;
    padding: 8px 16px;
  }
}

/* ===== Футер ===== */

footer.site-footer {
  margin: 0;
  padding: 60px 0 32px;
  background: #2c2b2b;
  color: #fff;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 343fr) minmax(0, 343fr) minmax(0, 412fr) 262px;
  grid-template-areas:
    "logo contacts help subscribe"
    "bottom bottom bottom bottom";
  align-items: start;
}

.site-footer__grid--seo {
  grid-template-areas:
    "logo contacts help subscribe"
    "bottom bottom bottom bottom"
    "line line line line"
    "seo seo seo seo";
}

.site-footer__logo {
  grid-area: logo;
  display: block;
  width: 263px;
  max-width: 100%;
}

.site-footer__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer__contacts {
  grid-area: contacts;
}

.site-footer__help {
  grid-area: help;
}

.site-footer__subscribe-wrap {
  grid-area: subscribe;
}

.site-footer__title {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.site-footer__title--large {
  margin-bottom: 22px;
  font-size: 16px;
}

.site-footer__contacts-group + .site-footer__contacts-group {
  margin-top: 22px;
}

.site-footer__contacts-group a {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.site-footer__contacts-group a + a {
  margin-top: 8px;
}

.site-footer .site-footer__phone {
  font-weight: 600;
}

.site-footer__city {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
}

.site-footer__contacts-group p:not(.site-footer__city) {
  font-size: 16px;
  line-height: 23px;
}

.site-footer__menu {
  display: flex;
  gap: 77px;
}

.site-footer__menu-list {
  list-style: none;
  color: #fff;
}

.site-footer__menu-list li {
  line-height: 1.2;
}

.site-footer__menu-list li + li {
  margin-top: 6px;
}

.site-footer__menu-list a {
  display: inline-block;
  font-size: 13px;
  line-height: 1.2;
}

.site-footer a {
  transition: opacity 0.2s;
}

.site-footer a:hover,
.site-footer .site-footer__menu-link--active {
  opacity: 0.6;
}

.site-footer__subscribe-text {
  max-width: 250px;
  margin-bottom: 26px;
  font-size: 12px;
  line-height: 1.2;
}

.site-footer__subscribe-form {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #fff;
}

.site-footer__subscribe-form input {
  flex: 1;
  min-width: 0;
  height: 29px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
}

.site-footer__subscribe-form input::placeholder {
  color: #fff;
  opacity: 1;
}

.site-footer__subscribe-form button {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  background: url(../images/redesign/arrow-right.svg) no-repeat center / 19px 19px;
  cursor: pointer;
}

.site-footer__subscribe-form button:disabled {
  opacity: 0.4;
}

/* Нижняя строка: оплата слева, соцсети по центру, копирайт справа — все в одной ячейке сетки */
.site-footer__pays,
.site-footer__social,
.site-footer__copyright {
  grid-area: bottom;
  align-self: center;
  margin-top: 93px;
}

.site-footer__pays {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 15px;
}

.site-footer__social {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 21px;
}

.site-footer__pays img,
.site-footer__social img {
  display: block;
}

.site-footer__copyright {
  justify-self: end;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.4);
}

.site-footer__line {
  grid-area: line;
  height: 1px;
  margin-top: 27px;
  background: rgba(255, 255, 255, 0.1);
}

.site-footer__seo {
  grid-area: seo;
  justify-self: center;
  max-width: 791px;
  margin-top: 32px;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  color: #6f6f6f;
}

.site-footer__seo p + p {
  margin-top: 8px;
}

@media screen and (max-width: 1199px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "logo subscribe"
      "contacts help"
      "pays social"
      "copyright copyright";
    column-gap: 40px;
    row-gap: 40px;
  }

  .site-footer__grid--seo {
    grid-template-areas:
      "logo subscribe"
      "contacts help"
      "pays social"
      "line line"
      "seo seo"
      "copyright copyright";
  }

  .site-footer__pays,
  .site-footer__social,
  .site-footer__copyright,
  .site-footer__line,
  .site-footer__seo {
    margin-top: 0;
  }

  .site-footer__pays {
    grid-area: pays;
  }

  .site-footer__social {
    grid-area: social;
    justify-self: start;
  }

  .site-footer__copyright {
    grid-area: copyright;
    justify-self: start;
  }
}

@media screen and (max-width: 767px) {
  footer.site-footer {
    padding: 32px 0 33px;
  }

  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "logo"
      "contacts"
      "social"
      "help"
      "subscribe"
      "pays"
      "copyright";
    row-gap: 32px;
  }

  .site-footer__grid--seo {
    grid-template-areas:
      "logo"
      "contacts"
      "social"
      "help"
      "subscribe"
      "pays"
      "seo"
      "line"
      "copyright";
  }

  .site-footer__seo {
    justify-self: stretch;
  }

  .site-footer__menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .site-footer__subscribe-text {
    max-width: 266px;
  }

  .site-footer__pays {
    justify-self: center;
  }

  .site-footer__copyright {
    margin-top: -12px;
    max-width: 220px;
    font-size: 14px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.3);
  }
}
