/* защита от глобальных стилей li/ul темы Bitrix (красные стрелки-маркеры, отступы, ::before/::after) */
.stores-grid > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  background: none !important;
}
.stores-grid > li::before,
.stores-grid > li::after {
  content: none !important;
  display: none !important;
}
:root {
  --background-color: #EFF1F4;
  --dark-gray: #828282;
  --light-gray: #F6F6F6;
  --white: #fff;
  --black: #000;
  --red: #DA2720;
}
html {
  scroll-behavior: smooth;
}
body {
  background-color: var(--background-color);
  font-family: 'Fira Sans', Arial, sans-serif;
  color: var(--black);
  font-weight: 400;
  font-size: 18px !important;
}

.custom-h1, .custom-h2 {
  font-size: 40px;
  font-weight: 700;
}
.custom-h3 {
  font-size: 20px;
  font-weight: 600;
}
.custom-section {
  margin-top: 40px;
}
.custom-container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-lead {
  margin: 20px 0;
}

.tel {
  text-decoration: underline;
}

/* FIRST SCREEN */
.custom-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.hero-content {
  background-image: url('../img/bg-images/main-banner.webp');
  background-color: var(--black);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  width: 100%;
  padding: 125px 40px;
  border-radius: 20px;
  margin: 40px 0;
}
.hero-content h1 {
  color: var(--white);
}
.hero-content p {
  font-size: 24px;
  color: var(--white);
  margin: 20px 0;
}

/* COMPONENT: BUTTON */
.custom-btn {
  background-color: var(--red);
  color: var(--white);
  padding: 10px 52px;
  font-size: 18px;
  border-radius: 12px;
  margin-top: 20px;
  transition: transform 0.3s ease;
  width: 100%;
}
.custom-btn:hover {
  transform: scale(0.9);
  color: var(--white) !important;
}
.custom-btn--flush {
  margin: 0;
}

/* COMPONENT: STORES GRID
   Сетка сама переносит карточки: добавление 9-го, 10-го, 11-го магазина
   не требует правок CSS и не даёт горизонтального скролла. */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
  padding: 0 !important;
  list-style: none !important;
}
.store-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.store-card__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 40px 25px;
  background-color: var(--white);
  border-radius: 10px;
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 0.2s;
}
a.store-card__link:hover,
a.store-card__link:focus-visible {
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}
.popup-note {
  margin-top: 12px;
}
.popup-note[hidden] {
  display: none;
}
.store-card__link img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
/* защита от глобальных стилей li/ul темы Bitrix (маркеры, отступы, ::before) */
.stores-grid > li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.stores-grid > li::before {
  content: none;
}
/* в карточке кнопка уже лежит под блоком, верхний отступ и 52px по бокам не нужны */
.store-card .custom-btn {
  margin-top: 0;
  padding: 10px 16px;
}

/* COMPONENT: BLOCK-CONTENT */
.block-content {
  padding: 40px;
  background-color: var(--white);
  border-radius: 20px;
  margin: 40px 0;

  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-display {
  display: none;
}

/* COMPONENT: TARIFF */
.tariffs-row {
  margin-top: 40px;
}
.tariff-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 292px);
  align-self: flex-start;
}
.tariff-card__top {
  background: var(--red);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 40px;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  color: var(--white);
}
.tariff-card__top h3 {
  font-size: 30px;
  font-weight: 600;
}
.tariff-card__bottom {
  background: var(--white);
  border-radius: 24px;
  padding: 20px;
  margin-top: -24px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  gap: 20px;
}
.tariff-features span {
  font-size: 22px;
  font-weight: 600;
}
.tariff-price {
  font-size: 28px;
  font-weight: 600;
}

/* COMPONENT: POP-UP */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: .3s;
  z-index: 1000;
}
.popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  visibility: hidden;
  transition: .3s;
  background: white;
  padding: 40px;
  border-radius: 18px;
  z-index: 1001;
  /* одна формула вместо отдельных max-width на каждом брейкпоинте */
  width: min(800px, calc(100% - 30px));
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
}
.popup-overlay.open {
  opacity: 1;
  visibility: visible;
}
.popup.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.popup-action {
  display: inline-block;
  white-space: nowrap;
  width: fit-content;
  margin-top: 20px;
  padding: 14px 40px;
  color: var(--white);
  background-color: var(--red);
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  transition: 0.3s ease;
}
.popup-actions .popup-action {
  margin-top: 0;
}
.popup-action--ghost {
  color: var(--black);
  background-color: var(--light-gray);
}
.popup-action[hidden] {
  display: none;
}
.popup-content h3 {
  margin-bottom: 20px;
}
.popup-content h2 {
  margin-bottom: 12px;
}
.popup-content p + p {
  margin-top: 12px;
}

/* COMPONENT: FAQ */
.faq-row {
  display: flex;
  gap: 32px;
  margin-top: 20px;
}
.faq-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 20px;
}
.faq-item.active-state .arrow {
  transform: rotate(180deg);
}
.arrow {
  flex-shrink: 0;
  align-self: flex-start;
  display: inline-block;
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform 0.3s ease;
}
.faq-item {
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 2px 8px 0 rgba(30, 41, 59, 0.07);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.faq-question {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 20px;
  color: var(--black);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
button, .faq-question {
  -webkit-tap-highlight-color: transparent;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  font-size: 16px;
  color: var(--black);
  background: var(--white);
  transition: max-height 1s, padding 0.3s;
  line-height: 1.7;
}
.faq-answer p {
  font-size: 16px;
}
.faq-answer a {
  color: var(--red);
}
.faq-item.active-state .faq-answer {
  padding: 0 20px 20px 20px;
  max-height: max-content;
}

/* MEDIA QUERIES */
@media (max-width: 1024px) {
  .custom-container {
    padding: 40px 20px;
  }
  .hero-content {
    padding: 107px 20px;
  }
  .hero-content h1 {
    font-size: 26px;
  }
  .hero-content p {
    max-width: 362px;
  }
  .custom-h2 {
    font-size: 32px;
  }
}
@media (max-width: 768px) {
  .hero-content {
    background-position: 70% 40%;
    padding: 107px 20px;
  }
  .faq-question {
    font-size: 16px;
  }
  .desktop-display {
    display: none;
  }
  .mobile-display {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  /* на мобильных и планшетах сетка превращается в ленту со snap:
     следующая карточка слегка выглядывает справа, подсказывая, что можно листать */
  .stores-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }
  .store-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
  }
  video {
    width: auto !important;
  }
}
@media (max-width: 450px) {
  .custom-container {
    padding: 40px 15px;
  }
  .hero-content {
    background-position: 75% 40%;
    padding: 106px 18px;
  }
  nav {
    font-size: 16px;
  }
  .custom-h1, .custom-h2 {
    font-size: 20px;
  }
  .custom-h3 {
    font-size: 18px;
  }
  p, li {
    font-size: 16px;
  }
  .hero-content p {
    max-width: 239px;
    font-size: 16px;
  }
  .block-content {
    padding: 25px 15px;
  }
  .store-card__link {
    padding: 24px 12px;
  }
  .store-card__link img {
    width: 80px;
    height: 80px;
  }
  .faq-row {
    flex-direction: column;
    gap: 20px !important;
  }
  .popup {
    padding: 20px;
  }
  .popup-action {
    padding: 12px 24px;
  }
}
@media (max-width: 375px) {
  .custom-h2 {
    font-size: 22px;
  }
}
@media (max-width: 320px) {
  body {
    font-size: 16px;
  }
  .custom-breadcrumb {
    font-size: 14px;
    gap: 5px;
  }
  .custom-h1, .custom-h2 {
    font-size: 20px !important;
  }
  .custom-h3 {
    font-size: 18px;
  }
  .hero-content {
    padding: 80px 15px;
  }
  .hero-content p {
    font-size: 14px;
    margin: 10px 0;
    max-width: 206px;
  }
  .popup {
    padding: 15px;
  }
}