/* ============================================
   TOVARIUM — МОДАЛЬНІ ВІКНА
   Налаштування (SEO, Піксели, CRM, Telegram,
   сторінка "Дякую") та Експорт
   ============================================ */

/* Таби всередині модалки налаштувань */
.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.modal-tab {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.modal-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-tab.active {
  background: var(--gradient-btn);
  color: #fff;
  border-color: transparent;
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
  animation: modalTabFade 0.2s var(--ease-out);
}

@keyframes modalTabFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== CRM КАРТКИ ===== */
.crm-card {
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.crm-card.active {
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px var(--glow-blue);
}

.crm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  transition: margin 0.3s;
}

.crm-card-header.has-fields {
  margin-bottom: 16px;
}

.crm-card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-card-fields {
  display: none;
}

.crm-card-fields.show {
  display: block;
  animation: crmFieldsShow 0.3s var(--ease-out);
}

@keyframes crmFieldsShow {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 600px; }
}

/* ===== TELEGRAM PREVIEW ===== */
.tg-preview {
  background: var(--surface-input);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  font-size: 13px;
}

.tg-preview-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.tg-preview-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 2;
  white-space: pre-wrap;
  font-family: var(--font-body);
}

/* ===== ПІКСЕЛИ — розділювач ===== */
.pixel-divider {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: 20px 0;
}

/* ===== ЕКСПОРТ ===== */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.export-card {
  background: var(--surface-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.export-card:hover {
  border-color: var(--neon-blue);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px var(--glow-blue);
}

.export-card .export-icon {
  font-size: 40px;
  margin-bottom: 10px;
  display: block;
}

.export-card h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.export-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== ІНСТРУКЦІЯ ===== */
.instruction-screen {
  display: none;
  min-height: 100vh;
  padding: 40px 20px;
}

.instruction-screen.visible {
  display: block;
}

.instruction-container {
  max-width: 800px;
  margin: 0 auto;
}

.instruction-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 4vw, 30px);
  text-align: center;
  margin-bottom: 36px;
  color: var(--text-primary);
}

.instruction-card {
  background: var(--surface-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.instruction-card h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.instruction-card p,
.instruction-card li {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.instruction-card ol,
.instruction-card ul {
  padding-left: 22px;
}

.instruction-card li {
  margin-bottom: 6px;
}

.instruction-card strong {
  color: var(--neon-blue);
}

.video-placeholder {
  background: var(--surface-input);
  border-radius: var(--radius-sm);
  padding: 48px;
  text-align: center;
  margin-top: 12px;
}

.video-placeholder .play-icon {
  font-size: 56px;
  margin-bottom: 10px;
  display: block;
}

.video-placeholder p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .export-grid {
    grid-template-columns: 1fr;
  }

  .modal-tabs {
    gap: 3px;
  }

  .modal-tab {
    padding: 8px 12px;
    font-size: 12px;
  }
}
