/* Card roxo de áreas médicas entre scalable e earnings. */
.areas-section {
  padding: 0;
}

/* Usa a largura real do frame desktop com pequena folga lateral responsiva. */
.areas-shell {
  width: min(1276px, calc(100% - 48px));
  margin: 0 auto;
}

/* Cartão principal com preenchimento e raio do Figma desktop. */
.areas-card {
  width: 100%;
  padding: 90px;
  border-radius: 45px;
  background: #845cff;
  color: #ffffff;
}

/* Cabeçalho da seção com largura fixa observada no frame. */
.areas-header {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 897px;
  margin-bottom: 41px;
}

/* Título branco em display, sem gradiente nessa faixa. */
.areas-title {
  margin: 0;
  font-family: "Muring Display", system-ui, sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.356;
  letter-spacing: 0.76px;
}

/* Texto corrido da faixa usando o mesmo tom e peso do Figma. */
.areas-description {
  margin: 0;
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.47;
}

/* Grade desktop em três linhas fixas para manter a composição do frame. */
.areas-grid--desktop {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cada linha controla o agrupamento visual dos pills no desktop. */
.areas-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

/* Última linha mais curta, com largura limitada como no Figma. */
.areas-row--compact {
  width: 1000px;
}

/* A versão mobile usa o mesmo visual, mas fica escondida no desktop. */
.areas-grid--mobile {
  display: none;
}

/* Pill translúcido com ícone ciano e texto branco. */
.areas-pill {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  padding: 20px 30px;
  border-radius: 98px;
  background: rgba(255, 255, 255, 0.1);
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.5px;
  color: #ffffff;
  white-space: nowrap;
}

/* Ícones mantêm a escala do desktop do Figma. */
.areas-pill img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: block;
}

/* O ícone de pediatria e alguns outros são levemente menores. */
.areas-pill img[src*="pediatria"],
.areas-pill img[src*="ortopedia"],
.areas-pill img[src*="nefrologia"],
.areas-pill img[src*="pneumologia"] {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

/* Ginecologia aparece com largura intermediária. */
.areas-pill img[src*="ginecologia"] {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

/* Chip final apenas com o sinal de mais. */
.areas-pill--plus {
  justify-content: center;
  min-width: 84px;
}

.areas-pill--plus span {
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 48px;
  font-weight: 600;
  line-height: 0.6;
}

/* Wrapper do details só entra em cena no mobile. */
.areas-mobile-details {
  display: flex;
  flex-direction: column;
}

.areas-more {
  display: none;
}

/* Tablet: mantém o card cheio, mas permite quebra das linhas em wraps. */
@media (max-width: 1180px) {
  .areas-shell {
    width: min(720px, calc(100% - 48px));
  }

  .areas-card {
    padding: 56px 40px;
  }

  .areas-header {
    width: 100%;
    margin-bottom: 28px;
  }

  .areas-title {
    font-size: 34px;
    letter-spacing: 0.68px;
  }

  .areas-description {
    font-size: 18px;
  }

  .areas-grid--desktop {
    gap: 18px;
  }

  .areas-row {
    flex-wrap: wrap;
    gap: 18px;
  }

  .areas-row--compact {
    width: 100%;
  }

  .areas-pill {
    font-size: 18px;
  }
}

/* Mobile: adaptação fiel ao espírito do frame, sem node dedicado no arquivo atual. */
@media (max-width: 480px) {
  .areas-shell {
    width: min(332px, calc(100% - 32px));
  }

  .areas-card {
    padding: 60px 28px;
    border-radius: 30px;
  }

  .areas-header {
    gap: 20px;
    width: 276px;
    margin-bottom: 41px;
  }

  .areas-title {
    font-size: 26px;
    letter-spacing: 0.52px;
  }

  .areas-description {
    font-size: 16px;
    line-height: 1.356;
    letter-spacing: 0.32px;
  }

  .areas-grid--desktop {
    display: none;
  }

  .areas-grid--mobile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
  }

  .areas-grid--mobile .areas-pill {
    width: 100%;
    gap: 12.685px;
    padding: 14.923px 22.384px;
    border-radius: 73.123px;
    font-size: 14.923px;
    line-height: 1.4;
    letter-spacing: -0.3731px;
  }

  .areas-grid--mobile .areas-pill img {
    width: 20.892px;
    height: 20.892px;
    flex-basis: 20.892px;
  }

  .areas-grid--mobile .areas-pill img[src*="pediatria"],
  .areas-grid--mobile .areas-pill img[src*="ortopedia"],
  .areas-grid--mobile .areas-pill img[src*="nefrologia"],
  .areas-grid--mobile .areas-pill img[src*="pneumologia"] {
    width: 17.908px;
    height: 17.908px;
    flex-basis: 17.908px;
  }

  .areas-grid--mobile .areas-pill img[src*="ginecologia"] {
    width: 19.4px;
    height: 19.4px;
    flex-basis: 19.4px;
  }

  .areas-grid--mobile .areas-pill--plus {
    width: 100%;
    min-width: 0;
  }

  .areas-grid--mobile .areas-pill--plus span {
    font-size: 28px;
    line-height: 1;
  }

  .areas-pill--muted {
    opacity: 0.48;
  }

  .areas-mobile-extra {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }

  .areas-mobile-extra-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .areas-fade {
    position: absolute;
    top: 250px; /* Sobre a 5ª pílula */
    left: -28px;
    width: calc(100% + 56px);
    height: 120px;
    background: linear-gradient(180deg, rgba(132, 92, 255, 0) 0%, #845cff 80%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
  }

  .areas-more {
    display: block;
    width: 100%;
    margin: 16px auto 0;
    list-style: none;
    cursor: pointer;
    font-family: "Muring Text", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.356;
    letter-spacing: 0.32px;
    text-align: center;
    color: #ffffff;
    position: relative;
    z-index: 3;
  }

  .areas-more::-webkit-details-marker {
    display: none;
  }

  .areas-mobile-details[open] .areas-mobile-extra {
    grid-template-rows: 1fr;
    order: 1;
  }

  .areas-mobile-details[open] .areas-more {
    order: 2;
    margin-top: 24px;
    font-size: 0;
  }

  .areas-mobile-details[open] .areas-more::after {
    content: "Ver menos ↑";
    font-size: 16px;
    line-height: 1.356;
    letter-spacing: 0.32px;
  }

  .areas-mobile-details[open] ~ .areas-fade {
    opacity: 0;
    pointer-events: none;
  }

  .areas-grid--mobile:has(.areas-mobile-details[open]) .areas-pill--muted {
    opacity: 1;
  }
}
