/* ================================================================
   Treatment Modal Styles
   ================================================================ */

.treatment-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}
.treatment-modal[hidden] { display: none; }

.treatment-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeInModal 0.3s ease;
  z-index: -1;
}

.treatment-modal__container {
  position: relative;
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  max-width: 1000px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: slideUpModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.treatment-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  background: var(--clr-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--ease);
}
.treatment-modal__close:hover {
  background: var(--clr-primary);
  color: var(--clr-white);
  transform: rotate(90deg);
}

.treatment-modal__content { display: contents; }

.tm-gallery-section {
  position: relative;
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

.tm-gallery {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
}

.tm-gallery__main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.35s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.tm-gallery__main.is-visible {
  opacity: 1;
  transform: scale(1);
}

.tm-gallery__nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: auto;
  z-index: 5;
}

.tm-gallery__btn {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  color: var(--clr-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--ease);
  pointer-events: auto;
}
.tm-gallery__btn--prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.tm-gallery__btn--next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.tm-gallery__btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.1);
}

.tm-gallery__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.tm-gallery__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: var(--ease);
}
.tm-gallery__dot.active {
  background: var(--clr-white);
  width: 24px;
  border-radius: 4px;
}

.tm-info-section {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}

.tm-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 8px;
}

.tm-short {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-primary-dark);
  margin-bottom: 12px;
}

.tm-body {
  color: var(--clr-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  flex-grow: 1;
  margin-bottom: 20px;
}

.tm-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-treatment-link {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0;
  transition: var(--ease);
  text-align: left;
}
.footer-treatment-link:hover {
  color: var(--clr-primary-light);
  padding-left: 4px;
}

.s-card__btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.2s ease;
}
.s-card__btn:hover { gap: 10px; }

/* Responsive - Modal */
@media (max-width: 768px) {
  .treatment-modal {
    padding: 0;
    align-items: flex-end;
  }

  .treatment-modal__backdrop {
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .treatment-modal__container {
    grid-template-columns: 1fr;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
    animation: slideUpModal 0.35s ease;
  }

  .treatment-modal__close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }

  .tm-gallery {
    padding-bottom: 78%;
  }

  .tm-gallery__btn {
    width: 44px;
    height: 44px;
  }

  .tm-gallery__dots {
    bottom: 10px;
  }

  .tm-info-section { padding: 24px 20px; }
  .tm-title { font-size: 1.45rem; }
  .tm-cta-row { flex-direction: column; }
  .tm-cta-row .btn { width: 100%; }
}
