/* Features modal — «Возможности» */

.features-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.features-modal[hidden] {
  display: none !important;
}

.features-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.features-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(92dvh, 860px);
  background: #fff;
  color: #1a1a1e;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(20, 15, 42, 0.28);
  overflow: hidden;
}

.features-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 4px;
  flex-shrink: 0;
}

.features-modal__header h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.features-modal__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #f3f4f6;
  color: #1a1a1e;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.features-modal__close:hover {
  background: #e5e7eb;
}

.features-modal__tabs {
  display: flex;
  gap: 6px;
  padding: 14px 20px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.features-modal__tabs.is-dragging {
  cursor: grabbing;
}

.features-modal__tabs.is-dragging .features-tab {
  pointer-events: none;
}

.features-modal__tabs::-webkit-scrollbar {
  display: none;
}

.features-tab {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.features-tab:hover {
  background: #e8edff;
  color: #326afd;
}

.features-tab.is-active {
  background: #326afd;
  color: #fff;
}

.features-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 20px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.features-modal__body::-webkit-scrollbar {
  display: none;
}

.features-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.features-panel {
  display: none;
}

.features-panel.is-active {
  display: block;
}

.features-section {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 15, 42, 0.16);
}

.features-section__trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  border-radius: 14px 14px 0 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.features-section__trigger:hover {
  background: #fafbfc;
}

.features-section__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.features-section__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}

.features-section__summary {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #949ca8;
}

.features-section__chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  color: #9da4ae;
  transition: transform 0.2s ease;
}

.features-section.is-open .features-section__chevron {
  transform: rotate(180deg);
}

.features-section__content {
  display: none;
  padding: 0 18px 18px;
}

.features-section.is-open .features-section__content {
  display: block;
}

.feature-block {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.feature-block + .feature-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eef0f3;
}

.feature-block__media {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  overflow: hidden;
  line-height: 0;
}

.feature-block__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(52dvh, 520px);
  margin: 0 auto;
  vertical-align: top;
  image-rendering: auto;
}

.feature-block__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, #fff 0%, transparent 8px, transparent calc(100% - 8px), #fff 100%),
    linear-gradient(to bottom, transparent calc(100% - 10px), #fff 100%);
  pointer-events: none;
}

.feature-block__media--placeholder {
  width: min(280px, 100%);
  min-height: 160px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #eef2ff 0%, #f8f9fb 45%, #eef2ff 100%);
}

.feature-block__media--placeholder::after {
  display: none;
}

.feature-block__placeholder-label {
  font-size: 13px;
  font-weight: 500;
  color: #9da4ae;
  letter-spacing: 0.02em;
}

.feature-block__text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #1a1a1e;
  text-align: left;
}

body.features-modal-open {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .features-modal {
    padding: 14px 12px;
    align-items: center;
  }

  .features-modal__dialog {
    width: 100%;
    max-height: min(90dvh, 860px);
    border-radius: 18px;
  }

  .features-modal__header {
    padding: 16px 16px 4px;
  }

  .features-modal__tabs {
    padding: 12px 16px 12px;
  }

  .features-modal__body {
    padding: 12px 16px 20px;
  }
}
