/* ==========================================================================
   МОДАЛЬНІ ВІКНА ТА ПРЕЗЕНТАЦІЯ (css/modals.css)
   Компанія: APFEL EXPERT (APFEL GROUP)
   ========================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: flex-start; 
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto; 
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.modal__overlay {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  color: #FFFFFF;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  margin: auto; 
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  
  /* ЖОРСТКИЙ ТЕМНИЙ РЕЖИМ ДЛЯ СИСТЕМНОГО СКРОЛБАРУ (WINDOWS) */
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0F172A;
}

/* Для Chrome/Edge/Safari (Темний скролбар) */
.modal__content::-webkit-scrollbar {
  width: 6px;
}
.modal__content::-webkit-scrollbar-track {
  background: #0F172A;
}
.modal__content::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 10px;
}
.modal__content::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-green);
}
.modal__content::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.modal.is-open .modal__content {
  transform: translateY(0) scale(1);
}

.modal__content--text-center {
  text-align: center;
}

/* ==========================================================
   ХРЕСТИК ЗАКРИТТЯ (Математично ідеальний геометричний хрестик) 
   ========================================================== */
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  font-size: 0;
  color: transparent; 
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease; 
  z-index: 100;
  padding: 0;
}

.modal__close::before,
.modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px; 
  height: 2px; 
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal__close:hover {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #FFFFFF;
  line-height: 1.3;
}

.modal__subtitle {
  font-size: 0.92rem;
  color: #94A3B8;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.contact-form__label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #CBD5E1;
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  padding: 14px 18px;
  background: #1A283B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(99, 175, 56, 0.2);
}

.contact-form__textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox__input {
  accent-color: var(--primary-green);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox__label {
  font-size: 0.82rem;
  color: #94A3B8;
  line-height: 1.4;
}

.modal__icon-success {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(99, 175, 56, 0.15);
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(99, 175, 56, 0.4);
}

/* ==========================================================================
   ВЕЛЕТЕНСЬКЕ ВІКНО ПРЕЗЕНТАЦІЇ НА ПК (1040×580 px)
   ========================================================================== */
.modal__content--presentation {
  width: 100%;
  max-width: 1040px;
  height: 580px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.presentation {
  display: grid;
  grid-template-columns: 580px 1fr;
  width: 100%;
  height: 100%;
}

.presentation__slider {
  position: relative;
  width: 100%;
  height: 100%;
  background: #080E18;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* НОВА ЛОГІКА ДЛЯ МИТТЄВОГО СЛАЙДЕРА */
.presentation__slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.presentation__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.presentation__img.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  z-index: 5;
}

.slider-btn:hover {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.slider-btn--prev { left: 16px; }
.slider-btn--next { right: 16px; }

.presentation__dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.presentation-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.presentation-dot.is-active {
  background: var(--primary-green);
  transform: scale(1.25);
}

/* Права колонка модалки */
.presentation__info {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  height: 100%;
  overflow-y: auto;
}

.presentation__title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 4px;
  margin-bottom: 14px;
  line-height: 1.2;
}

.presentation__desc {
  font-size: 0.96rem;
  color: #94A3B8;
  line-height: 1.65;
  margin-bottom: 26px;
}

.presentation__subtitle {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #CBD5E1;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.presentation__brands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 30px;
}

.presentation__brands span {
  display: inline-block;
  padding: 6px 14px;
  background: #131E2D;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
}

/* ==========================================================================
   АДАПТИВНІСТЬ ДЛЯ ТЕЛЕФОНІВ ТА ПЛАНШЕТІВ (MOBILE-FIRST)
   ========================================================================== */

@media (max-width: 860px) {
  .modal {
    padding: 16px; 
  }

  .modal__content {
    padding: 24px 20px;
    border-radius: var(--radius-md);
    max-height: calc(100svh - 32px); 
    margin: auto; 
  }

  .modal__close {
    top: 12px;
    right: 12px;
  }

  .modal__title {
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .modal__subtitle {
    font-size: 0.88rem;
    margin-bottom: 18px; 
    line-height: 1.4;
  }

  .modal-form {
    gap: 12px; 
  }

  .contact-form__input,
  .contact-form__textarea {
    padding: 12px 14px; 
  }

  /* Презентаційна модалка */
  .modal__content--presentation {
    max-width: 500px;
    height: auto !important;
    max-height: calc(100svh - 32px) !important;
    overflow-y: auto;
    padding: 0; 
  }

  .presentation {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .presentation__slider {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important; 
    flex-shrink: 0;
  }

  .presentation__info {
    padding: 20px 16px;
    height: auto;
    overflow-y: visible;
  }

  .presentation__title {
    font-size: 1.45rem;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .presentation__desc {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .presentation__brands {
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 12px;
  }
  
  .modal__content {
    max-height: calc(100svh - 24px); 
  }

  .modal__title {
    font-size: 1.25rem;
  }

  .presentation__title {
    font-size: 1.35rem;
  }
}