/**
 * FAQ Accordion Component
 * BEM: .dtec-faq
 */

:root {
  --dtec-faq-border: var(--dtec-border, #E9E0E4);
}

.dtec-faq {
  --faq-brand: var(--aubergine-gleam-500, #8F385D);
  --faq-brand-strong: var(--aubergine-gleam-600, #6C2C47);
  --faq-brand-light: rgba(143, 56, 93, 0.05);
  display: flex;
  padding: var(--space-3xl) var(--space-4xl) var(--space-4xl);
  flex-direction: column;
  align-items: flex-start;
  gap: 57px;
  align-self: stretch;
  border-radius: 20px;
  border: 2px solid var(--faq-brand);
  background: var(--white, #FFF);
  max-width: 100%;
  margin-inline: auto;
}

.dtec-faq--marketing {
  --faq-brand: var(--lime-500, #A0BA18);
  --faq-brand-strong: var(--lime-600, #869c16);
  --faq-brand-light: rgba(159, 185, 24, 0.05);
}

.dtec-faq__heading {
  color: var(--faq-brand);
  font-size: 32px;
  font-weight: 600;
  line-height: normal;
  margin: 0;
}

.dtec-faq__category {
  display: inline-block;
  background-color: var(--faq-brand);
  color: #ffffff;
  font-size: var(--text-s);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.375rem 1rem;
  border-radius: 4px;
  margin-bottom: var(--space-l);
}

.dtec-faq__list {
  border-top: 1px solid var(--dtec-faq-border);
  width: 100%;
}

.dtec-faq__empty {
  color: rgba(46, 40, 38, 0.75);
  font-size: var(--text-s);
  padding: var(--space-m) 0;
}

/* --- Item --- */

.dtec-faq__item {
  border-bottom: 1px solid var(--dtec-faq-border);
}

/* --- Question row --- */

.dtec-faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-m) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--dark-gray, #2E2826);
  font-family: inherit;
  font-size: var(--text-l);
  font-weight: 600;
  line-height: 1.6;
  transition: color 150ms ease;
}

.dtec-faq__question:hover {
  color: var(--faq-brand);
}

.dtec-faq__question-text {
  flex: 1;
}

/* --- Icon (+ → − animated via CSS transform) --- */

.dtec-faq__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
  user-select: none;
}

.dtec-faq__icon::before,
.dtec-faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--lime-500, #A0BA18);
  border-radius: 2px;
  transition: transform 300ms ease;
}

/* Horizontal bar */
.dtec-faq__icon::before {
  width: 20px;
  height: 2px;
  transform: translate(-50%, -50%);
}

/* Vertical bar — rotates to 0° when open */
.dtec-faq__icon::after {
  width: 2px;
  height: 20px;
  transform: translate(-50%, -50%);
}

.dtec-faq__item--open .dtec-faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.dtec-faq__item--open .dtec-faq__icon::before,
.dtec-faq__item--open .dtec-faq__icon::after {
  background-color: var(--faq-brand);
}

/* --- Answer (collapsed by default, hidden via height 0) --- */

.dtec-faq__answer {
  height: 0;
  overflow: hidden;
  transition: height 350ms ease;
}

.dtec-faq__answer-text {
  color: var(--contrast);
  font-size: 18px;
  font-weight: 400;
  line-height: 160%;
  padding-bottom: 40px;
  margin: 0;
}

.dtec-faq__answer-text p {
  margin: 0;
}

/* --- Plain style (no border, no padding — for embedding) --- */

.dtec-faq--plain {
  border: none;
  border-radius: 0;
  padding: 0;
  gap: var(--space-l);
  max-width: none;
}

.dtec-faq--plain .dtec-faq__heading {
  color: var(--dark-gray, #2E2826);
}

/* ==========================================================================
   Tabs type — category button tabs above accordion
   ========================================================================== */

.dtec-faq-tabs__nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.dtec-faq-tabs__tab {
  display: flex;
  height: 52px;
  padding: 14px 24px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid var(--faq-brand);
  background: var(--white, #FFF);
  color: var(--faq-brand);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.dtec-faq-tabs__tab:hover {
  background: var(--faq-brand-light);
}

.dtec-faq-tabs__tab--active {
  background: var(--faq-brand);
  color: var(--white, #FFF);
}

.dtec-faq-tabs__tab--active:hover {
  background: var(--faq-brand-strong);
}

.dtec-faq-tabs__panel {
  width: 100%;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .dtec-faq {
    padding: 30px 24px 40px;
    gap: 32px;
    border-radius: 12px;
  }

  .dtec-faq__heading {
    font-size: 24px;
  }
}
