/* Стили маркетплейса сервисов IIAI (Альфа) — Единая дизайн-система платформы */

.services-marketplace-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.services-main-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 22px 24px 60px;
  gap: 24px;
  -webkit-overflow-scrolling: touch;
}

/* Шапка раздела в едином стиле платформы */
.services-title-row {
  margin-bottom: 4px;
}

.services-title-row h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 4px 0 6px;
}

.services-title-row p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

/* Фильтры и строка поиска */
.services-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  .services-filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.services-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.services-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.services-cat-btn:hover {
  background: var(--surface-active);
  border-color: var(--border-strong);
  color: var(--text);
}

.services-cat-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.services-cat-btn.is-active .learning-chip {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: transparent;
}

/* Поле поиска в стиле платформы */
.services-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
  max-width: 420px;
  width: 100%;
}

.services-search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}

.services-search-wrapper input {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px 8px 38px;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.services-search-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Сетка сервисов-товаров */
.services-bento-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 720px) {
  .services-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .services-bento-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Карточка сервиса в едином стиле IIAI */
.service-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.service-product-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.service-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--accent);
  border: 1px solid var(--border);
}

.service-icon-box.accent-emerald {
  color: var(--success, #2fc48d);
  background: rgba(47, 196, 141, 0.1);
}

.service-icon-box.accent-blue {
  color: var(--accent);
  background: var(--accent-soft);
}

.service-icon-box.accent-purple {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.service-icon-box.accent-amber {
  color: var(--warning, #e8b84f);
  background: rgba(232, 184, 79, 0.1);
}

.service-badges-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text-soft);
}

.service-badge.badge-hot {
  border-color: rgba(242, 119, 134, 0.3);
  background: rgba(242, 119, 134, 0.1);
  color: var(--danger, #f27786);
}

.service-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.35;
}

.service-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
  flex: 1;
}

.service-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.service-features-list li svg {
  color: var(--success, #2fc48d);
  flex-shrink: 0;
}

.service-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 10px;
}

.service-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.service-status-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success, #2fc48d);
}

.service-status-pill.soon .status-dot {
  background: var(--muted);
}

.service-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Модальное окно авторизации для гостей */
.services-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.services-modal-backdrop.hidden,
.hidden {
  display: none !important;
}

.services-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 92dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  box-sizing: border-box;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.modal-close-icon:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(34, 111, 220, 0.12);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.services-modal-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

.modal-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.benefit-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  text-decoration: none;
}
