/* Основні шрифти для модалки */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Chango&display=swap');

#customModal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(22, 25, 39, 0.70);
  transition: background 0.25s;
  box-sizing: border-box;
}
#add-tv-popup {
  display: none;
  position: fixed;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20000;
  background: rgba(24,38,47,0.25);
  justify-content: center;
  align-items: center;
}

#add-tv-popup .add-tv-popup-inner {
  background: #fff;
  border-radius: 22px;
  min-width: 330px;
  max-width: 90vw;
  box-shadow: 0 8px 44px rgba(44,62,80,0.19), 0 2px 8px rgba(52,73,94,0.10);
  padding: 40px 34px 30px 34px;
  text-align: center;
  position: relative;
  bottom: 70px
}

.add-tv-popup-title {
  font-size: 1.22em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #232c3b;
}

.add-tv-popup-text {
  color: #39475c;
  font-size: 1.07em;
  margin-bottom: 20px;
}

.add-tv-popup-btn {
  width: 100%;
  padding: 13px 0;
  font-size: 1.04em;
  font-weight: 600;
  border-radius: 13px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
  outline: none;
}

.add-tv-popup-btn-outline {
  background: #fff;
  color: #256cff;
  border: 2px solid #256cff;
}

.add-tv-popup-btn-outline:hover {
  background: #eaf2ff;
}

.add-tv-popup-btn-blue {
  background: #256cff;
  color: #fff;
  border: none;
}

.add-tv-popup-btn-blue:hover {
  background: #1741a8;
}

.add-tv-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.55em;
  color: #bcc4d4;
  cursor: pointer;
  transition: color 0.15s;
}
.add-tv-popup-close:hover {
  color: #4a6ea8;
}

#customModal.show {
    display: block;
  }
#customModal .modal-content {
  background: #fff;
  margin: 40px auto;
  border-radius: 32px;
  padding: 48px 32px 36px 32px;
  width: 95%;
  max-width: 490px;
  min-height: 120px;
  box-shadow: 0 6px 28px 0 rgba(40, 48, 60, 0.14), 0 1.5px 8px 0 rgba(20, 24, 31, 0.06);
  position: relative;
  animation: modalFadeIn 0.22s cubic-bezier(.6,.2,.2,1);
  font-family: 'Montserrat', Arial, sans-serif;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(48px);}
  to { opacity: 1; transform: translateY(0);}
}

/* Закриваючий хрестик */
#customModal .close {
  position: absolute;
  top: 0px;
  right: 22px;
  font-size: 2.2rem;
  color: #acb3bb;
  cursor: pointer;
  transition: color 0.18s;
  font-family: Arial, sans-serif;
  z-index: 3;
}
#customModal .close:hover { color: #27275a; }

/* Заголовки */
#customModal h2 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #232323;
  text-align: center;
  margin-bottom: 30px;
  margin-top: 6px;
  letter-spacing: 0.02em;
}
#customModal .modal-subtitle {
  text-align: center;
  color: #363750;
  font-size: 1.22rem;
  margin-bottom: 18px;
}

/* Інпути */
#customModal .modal-input {
  width: 100%;
  font-size: 1.14rem;
  padding: 15px 20px;
  margin: 16px 0 18px 0;
  border: 1.8px solid #e4e6eb;
  border-radius: 22px;
  outline: none;
  font-family: 'Montserrat', Arial, sans-serif;
  background: #fff;
  color: #232323;
  box-shadow: 0 1.5px 8px rgba(40,40,40,0.03);
  transition: border 0.18s, box-shadow 0.19s;
  font-weight: 500;
  letter-spacing: 0.01em;
}
#customModal .modal-input:focus {
  border: 2.2px solid #1777ff;
  box-shadow: 0 0 0 2.3px #e9f0ff;
}

/* Кнопки */
#customModal .modal-btn,
#customModal .modal-options button {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  padding: 14px 0;
  width: 100%;
  margin: 10px 0 0 0;
  border-radius: 28px;
  background: #fff;
  color: #1c2233;
  border: 2px solid #e5e8ef;
  transition: all 0.18s cubic-bezier(.58,.21,.29,.98);
  cursor: pointer;
  outline: none;
  box-shadow: 0 1.5px 7px 0 rgba(40,48,60,0.05);
  letter-spacing: 0.01em;
  display: block;
}

#customModal .modal-options button {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#customModal .modal-btn:hover,
#customModal .modal-options button:hover {
  background: #eaf3ff;
  border: 2px solid #1777ff;
  color: #1652a5;
}

@media (hover: none) {
  #customModal .modal-btn:hover,
  #customModal .modal-options button:hover {
    background: initial;
    border: 2px solid #ececec;;
    color: initial;
  }
}

#customModal .modal-btn:disabled,
#customModal .modal-options button:disabled {
  background: #f5f7fb;
  border: 2px solid #f0f1f3;
  color: #bfc1cc;
  cursor: not-allowed;
  opacity: 0.85;
}

#customModal .modal-btn {
  background: #1777ff;
  color: #fff;
  border: none;
  box-shadow: 0 1px 6px 0 rgba(16,54,210,0.13);
  margin-top: 18px;
}
#customModal .modal-btn:hover:not(:disabled) {
  background: #125cc7;
  color: #fff;
}

/* Go Back — світла кнопка */
#customModal .prev-page.modal-btn {
  background: #fff;
  color: #1777ff;
  border: 2px solid #1777ff;
  margin-top: 10px;
}
#customModal .prev-page.modal-btn:hover:not(:disabled) {
  background: #eaf3ff;
  color: #125cc7;
}

/* Мультивибір */
#customModal .modal-options {
  margin: 6px 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}


#customModal .modal-options button {
  background: #fff;
  border: 2px solid #ececec;
  color: #222;
  padding: 18px 20px;
  font-size: 1.14rem;
  text-align: left;
  transition: background 0.14s, border 0.17s, color 0.17s;
}

#customModal .modal-options button.selected,
#customModal .modal-options button:active {
  border: 2px solid #1777ff;
  background: #eaf3ff;
  color: #1652a5;
}

#customModal .modal-options.multi button.selected {
  border: 2px solid #1777ff;
  background: #eaf3ff;
  color: #1a235a;
}

#customModal .modal-options.multi button.selected:hover {
  background: #d6eaff;
}

#customModal .modal-options button:last-child {
  margin-bottom: 0;
}

/* Hint-текст і сабтайтли */
#customModal .modal-hint, #customModal .modal-subtitle {
  color: #6f6f80;
  font-size: 1.08rem;
  text-align: center;
  margin-top: 16px;
  margin-bottom: 8px;
}
#customModal .modal-hint a { color: #1777ff; text-decoration: none; }
#customModal .modal-hint a:hover { text-decoration: underline; }

#customModal .modal-hint span, #customModal .modal-subtitle span {
  font-weight: 700;
}

/* Підлаштовуємо модалку під мобілку */
@media (max-width: 540px) {
  #customModal .modal-content {
    max-width: 100vw;
    padding: 34px 6vw 22px 6vw;
    margin: 8vw auto 50vw auto;
    border-radius: 20px;
  }
  #customModal h2 {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }
  #customModal .modal-btn, #customModal .modal-options button {
    font-size: 1.08rem;
    padding: 12px 15px;
    border-radius: 18px;
  }
  #customModal .modal-input { font-size: 1rem; padding: 11px 15px;}
}

#customModal .modal-page {
  animation: fadein .19s cubic-bezier(.7,.32,.22,.89);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

#customModal .modal-page[style*="display:none"] {
  display: none !important;
}

#customModal .modal-options.yes-no-buttons{
  display: flex;
  justify-content: space-between;
  flex-direction: row!important;
}
#customModal .modal-options.yes-no-buttons button{
  display: flex;
  align-items: center;
  justify-content: center;
}
/* .invalid-btn {
  background-color: white !important;
  color:  black!important;
  border-color: var(--color-primary) !important;
  transition: all 0.3s ease;
} */
#customModal .modal-options button.selected {
  border: 2px solid #1777ff;
  background: #eaf3ff;
  color: #1652a5;
}
#customModal .modal-options button:active:not(.selected),
#customModal .modal-options button:focus:not(.selected) {
  border: 2px solid #ececec;
  background: #fff;
  color: #222;
}
.device-qty-controls {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 30px;

}
.device-qty-controls button {
  display: flex;
  text-align: center;
  justify-content: center!important;
  align-items: center;

  width: 40px;

  border-radius: 50%;
  background: #eaf3ff;
  color: #1777ff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.device-qty-row .device-label {
  font-size: 1.10rem;
  color: #222222;
  font-weight: 600;
  padding: 0 15px;

}
.device-qty-value {
  font-size: 1.10rem;
  color: #222222;
  font-weight: 600;
  padding: 0 15px;
}
.disabled-option {
  opacity: 0.5;
  pointer-events: none;
}
