.how-it-works {
  padding: 48px 0;
  background: #fff;
}

.how-it-works__container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding-left: var(--page-padding-x);
  padding-right: var(--page-padding-x);
  box-sizing: border-box;
}

/* Wrapper com overflow para o ícone flutuante não ser cortado */
.how-it-works__cards-wrapper {
  overflow: visible;
}

/* Grid de 4 colunas */
.how-it-works__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
  padding-top: 28px; /* espaço para o ícone flutuante */
}

/* Card achatado */
.how-it-works .hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 16px 20px;
  min-height: unset;
  border-top: none;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  overflow: visible;
}

/* Ícone flutuando acima da borda superior do card */
.how-it-works .hero-card__icon {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.how-it-works .hero-card__icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.how-it-works .hero-card__text {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  margin-top: 30px;
}

/* Bordas e cores por variante */
.how-it-works .hero-card--buscar {
  border: 1px solid #10A9D3;
  box-shadow: 0 1px 16px -3px rgba(16, 169, 211, 0.15);
}
.how-it-works .hero-card--buscar .hero-card__icon {
  background: #E8F7FB;
}

.how-it-works .hero-card--catalogo {
  border: 1px solid #17CA88;
  box-shadow: 0 1px 16px -3px rgba(23, 202, 136, 0.15);
}
.how-it-works .hero-card--catalogo .hero-card__icon {
  background: #E8FAF4;
}

.how-it-works .hero-card--portal {
  border: 1px solid #EE7748;
  box-shadow: 0 1px 16px -3px rgba(238, 119, 72, 0.15);
}
.how-it-works .hero-card--portal .hero-card__icon {
  background: #FFF8EF;
}

.how-it-works .hero-card--normas {
  border: 1px solid #B65DAF;
  box-shadow: 0 1px 16px -3px rgba(182, 93, 175, 0.15);
}
.how-it-works .hero-card--normas .hero-card__icon {
  background: #F8EFF7;
}

@media (max-width: 768px) {
  .how-it-works__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
  }
}

@media (max-width: 480px) {
  .how-it-works__cards {
    grid-template-columns: 1fr;
  }
}

/* Hover nos cards */
.how-it-works .hero-card {
  transition: box-shadow 0.2s ease;
}

.how-it-works .hero-card--buscar:hover {
  box-shadow: 0 4px 24px -3px rgba(16, 169, 211, 0.50);
}

.how-it-works .hero-card--catalogo:hover {
  box-shadow: 0 4px 24px -3px rgba(23, 202, 136, 0.50);
}

.how-it-works .hero-card--portal:hover {
  box-shadow: 0 4px 24px -3px rgba(238, 119, 72, 0.50);
}

.how-it-works .hero-card--normas:hover {
  box-shadow: 0 4px 24px -3px rgba(182, 93, 175, 0.50);
}

/* Painel Portal de Compras */
.portal-compras-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background: #fff;
  border-top: 1px solid #E1E1E1;
}

.portal-compras-panel--open {
  max-height: 800px;
}

.portal-compras-panel__container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 40px var(--page-padding-x) 100px;
  box-sizing: border-box;
}

.portal-compras-panel__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #151515;
  margin: 0 0 32px;
}

.portal-compras-panel__content {
  display: flex;
  align-items: center;
  gap: 60px;
}

.portal-compras-panel__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.portal-compras-panel__separator {
  width: 1px;
  background: #D9D9D9;
  align-self: stretch;
  flex-shrink: 0;
}

.portal-compras-panel__icon {
  display: flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #EE7748;
}

.portal-compras-panel__icon--cadastro {
  border-color: #F6B458;
}

.portal-compras-panel__icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.portal-compras-panel__label {
  font-family: Inter, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #151515;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

.portal-compras-panel__desc {
  font-family: Inter, sans-serif;
  font-size: 16px;
  color: #151515;
  line-height: 1.5;
  margin: 0;
  text-align: center;
  max-width: 66%;
}

.portal-compras-panel__btn {
  display: inline-flex;
  padding: 12px 28px;
  border-radius: 8px;
  background: #F29751;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.portal-compras-panel__btn:hover {
  background: #e0843a;
}

.portal-compras-panel__link {
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: #F29751;
  text-decoration: underline;
}

/* Card ativo */
.how-it-works .hero-card--active {
  background: #FFF8EF;
}

@media (max-width: 768px) {
  .portal-compras-panel__content {
    flex-direction: column;
    gap: 32px;
  }

  .portal-compras-panel__separator {
    width: 100%;
    height: 1px;
    align-self: auto;
  }

  .portal-compras-panel--open {
    max-height: 700px;
  }
}

/* Modal de vídeo */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.video-modal--open {
  display: flex;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.video-modal__content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 900px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 24px;
  box-sizing: border-box;
}

.video-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.video-modal__title {
  font-family: Inter, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}

.video-modal__content video {
  display: block;
  width: 100%;
  max-height: 75vh;
  border-radius: 8px;
}

.video-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #404a66;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.video-modal__close:hover {
  background: #f5f5f5;
}
