/* Контакты модалка - начало */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  backdrop-filter: blur(5px);
  /* Если контент модалки выше экрана — даем возможность прокручивать */
  overflow-y: auto;
  padding: 4vh 10px;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  padding: 32px;
  border-radius: 18px;
  width: 380px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.modal a {
  display: block;
  width: fit-content;
  margin: 0 auto;
}

.overlay.show .modal {
  transform: scale(1);
  opacity: 1;
}

.modal h3 {
  margin: 10px 0;
  text-align: center;
  color: #222;
  font-size: 22px;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #ccc;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  background: #f0f0f0;
  color: #000;
}

.contacts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contacts li {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  color: #444;
  line-height: 1.4;
}

.contacts li:last-child {
  border-bottom: none;
}

.contacts li strong {
  margin: 0 auto;
  color: #d93b3f;
  font-weight: 600;
  font-family: "lato";

}

/* Кликаябельные телефоны в модалке контактов */
.contacts li .contact-phone {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.contacts li .contact-phone:active strong {
  transform: scale(0.98);
}

.modal-socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.modal-socials img {
  width: 2.5rem;
  height: auto;
  transition: transform 0.2s;
}

.modal-socials a:hover img {
  transform: scale(1.1);
}

/* Контакты модалка - конец */

/* Подключение новая модалка - начало */
.modal-box {
  background: #fff;
  width: 850px;
  max-width: 95%;
  margin: 5vh auto;
  padding: 25px 30px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  position: relative;
  transform: scale(.9) translateY(-20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  /* Ограничиваем высоту и включаем внутренний скролл, чтобы форма всегда была доступна */
  max-height: 90vh;
  overflow-y: auto;
}

.overlay.show .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-box h2 {
  margin-top: 0;
}

.modal-box h3 {
  margin-top: 20px;
  font-size: 18px;
  text-align: left;
}

.modal-box .close-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  text-decoration: none;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.modal-box .close-btn:hover {
  background: #f0f0f0;
  color: #000;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}

.field {
  position: relative;
  height: 52px;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  background: none;
  line-height: 52px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: #d93b3f;
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #888;
  pointer-events: none;
  transition: .18s ease;
  background: #fff;
  padding: 0 4px;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label {
  top: -8px;
  transform: none;
  font-size: 11px;
  color: #d93b3f;
}

.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 15px 0 25px;
}

.modal-product {
  display: block;
  cursor: pointer;
  position: relative;
}

.product-check {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

.modal-equip-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
  border: 1px solid #ddd !important;
  padding: 12px !important;
  border-radius: 14px !important;
  background: #fff !important;
  transition: .25s ease !important;
  text-align: left !important;
  transform: none !important;
  /* Блокируем эффект из магазина. Нужно или нет - не знаю, но пусть будет */
  box-shadow: none !important;
}

.modal-equip-card img {
  width: 64px !important;
  height: 64px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  display: block !important;
}

.modal-equip-info {
  padding: 0 !important;
  text-align: left !important;
}

.modal-equip-info small {
  color: #777;
  font-size: 12px;
  display: block;
}

.modal-equip-info b {
  display: block;
  font-size: 14px;
  margin-top: 2px;
  color: #333;
}

.modal-equip-info p {
  color: #1e73e8;
  font-weight: 600;
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 0;
}

.modal-product:hover .modal-equip-card {
  border-color: #B3D4FF !important;
  /* Цвет рамки и товара при наведении */
  background: #EBF5FF !important;
}

.modal-equip-card .custom-checkbox {
  margin-left: auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid #c0c0c0;
  border-radius: 6px;
  background: #ffffff;
  position: relative;
  flex-shrink: 0;
  transition: .2s ease;
}

.modal-equip-card .custom-checkbox::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;

  background-color: #ffffff;
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;

  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.27);
}

/*Стили для чекбокса в модалке */

.product-check:checked+.modal-equip-card {
  border-color: #B3D4FF !important;
  /* Цвет рамки и товара при выборе */
  background: #EBF5FF !important;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, .15) !important;
}

.product-check:checked+.modal-equip-card .custom-checkbox {
  border-color: #d93b3f;
  background: #d93b3f;
}

.product-check:checked+.modal-equip-card .custom-checkbox::after {
  transform: scale(1);
}

.modal-box .btn {
  cursor: pointer;
  display: block;
  background-color: #dddddd;
  border: none;
  border-radius: 5px;
  color: black;
  padding: 16px 32px;
  text-align: center;
  font-size: 16px;
  transition: 0.3s;
  width: auto;
  margin: 0 auto;
}

.modal-box .btn:hover {
  background: #d93b3f;
  transform: translateY(-2px);
}

.modal-box .policy {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-top: 15px;
}

.success-text {
  margin: 10px 15px;
  line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 700px) {

  .form-grid,
  .products {
    grid-template-columns: 1fr;
    /* Все поля и товарі в одну колонку */
  }

  .modal-box {
    padding: 20px;
    margin: 2vh auto;
  }

  .modal-box h2 {
    font-size: clamp(1.2rem, 4vw, 1.4rem);
    text-align: center;
    padding: 0 2.5rem;
    /* Симметричный отступ с обеих сторон для красоты */
    line-height: 1.3;
    margin-bottom: 1.5rem;
  }
}

/* Подключение новая модалка - конец */

/* Аварийное сообщение на главной - начало */
.modal-shutdown {
  max-width: 650px;
  width: 95%;
  min-height: auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 45px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10000;

  /* Анимация пульсации тени */
  animation: pulse-shadow 2s infinite ease-out;
  -webkit-animation: pulse-shadow 2s infinite ease-out;
}

@media (max-width: 600px) {
  .modal-shutdown {
    padding: 35px 20px;
    border-radius: 16px;
  }

  .modal-shutdown h3 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .modal-shutdown img {
    max-width: 150px;
    margin-bottom: 15px;
  }
}

.shutdown-text p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* Анимация пульсации тени */
@keyframes pulse-shadow {
  0% {
    box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.4);
  }

  70% {
    box-shadow: 0 0 0 80px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@-webkit-keyframes pulse-shadow {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.4);
    box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.4);
  }

  70% {
    -webkit-box-shadow: 0 0 0 80px transparent;
    box-shadow: 0 0 0 80px transparent;
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Анимация появления модального окна */
.modal {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease-out;
}

#modal-shutdown h3 {
  color: #333;
  margin-top: 20px;
  margin-bottom: 20px;
  padding-bottom: 5px;
  border-bottom: 2px solid #f1f1f1;
}

.overlay.show .modal {
  opacity: 1;
  transform: translateY(0);
}

/* Стили для логотипа */
.modal-shutdown img {
  max-width: 200px;
  margin-bottom: 20px;
}

/* Аварийное сообщение на главной - конец */

/* Модалка описания тарифа - начало */
.modal-tariff-details-box {
  width: 600px;
  max-width: 92vw;
  max-height: 80vh;
  padding: 15px;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-tariff-details-box h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  color: #111827;
  text-align: center;
  padding-right: 30px;
}

.tariff-details-content {
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  word-wrap: break-word;
  overflow-y: auto;
  max-height: 55vh;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tariff-details-content p {
  margin: 0 0 10px 0;
}

.tariff-details-content ul,
.tariff-details-content ol {
  margin: 0 0 10px 20px;
  padding: 0;
}

.tariff-details-content li {
  margin-bottom: 4px;
}

.tariff-details-content:empty::before {
  content: 'Опис для цього тарифу відсутній.';
  color: #9ca3af;
  font-style: italic;
}
/* Модалка описания тарифа - конец */