/* Banner atual da oferta: prévia (thumbnail) + rótulo/ações, em vez de um link cru. */
.offer-banner-current {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  background: var(--color-gray-50);
}

.offer-banner-current__thumb {
  display: block;
  flex: 0 0 auto;
  width: 9rem;
  height: 5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
  background: var(--color-surface-card);
}

.offer-banner-current__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-banner-current__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  /* Empurra o bloco de ações (Baixar/Excluir) para a direita do card. */
  flex: 1 1 auto;
}

.offer-banner-current__label {
  font-weight: 600;
  color: var(--color-gray-800);
  font-size: 0.9rem;
}

.offer-banner-current__hint {
  color: var(--color-gray-500);
  font-size: 0.8rem;
}

/* Ações do banner: alinhadas à DIREITA do card. */
.offer-banner-current__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.offer-banner-remove-btn {
  margin-bottom: 0;
  cursor: pointer;
  white-space: nowrap;
}

/* Marcado para exclusão: botão fica sólido e o card esmaecido. */
.offer-banner-remove-flag:checked + .offer-banner-remove-btn {
  background-color: var(--bs-danger, var(--color-danger-bs));
  border-color: var(--bs-danger, var(--color-danger-bs));
  color: var(--color-surface-card);
}

.offer-banner-current:has(.offer-banner-remove-flag:checked) {
  opacity: 0.6;
}

@media (max-width: 575.98px) {
  .offer-banner-current {
    flex-direction: column;
    align-items: flex-start;
  }
  .offer-banner-current__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 7;
  }
  .offer-banner-current__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Shared offer document upload table */

.offer-document-upload-fragment {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.offer-document-upload-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.offer-document-upload-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.offer-document-upload-title {
  margin: 0;
  color: var(--color-gray-800);
  font-size: 0.95rem;
  font-weight: 700;
}

/* "Documentos enviados": título em peso normal (a lista de baixo não compete com o de cima). */
.offer-document-upload-title--normal {
  font-weight: 400;
}

/* Linha de adicionar fixa no topo da seção "Demais documentos" (form inline, não tabela). */
.offer-document-add-row {
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  background: var(--color-gray-50);
  padding: 0.875rem 1rem;
}

.offer-document-upload-file-cell {
  white-space: nowrap;
}

/* Grid de documentos é VISUALIZAÇÃO: conteúdo das células como texto simples. */
.offer-document-upload-text {
  display: inline-block;
  color: var(--color-gray-700);
  font-size: 0.875rem;
  word-break: break-word;
}

.offer-document-upload-filename {
  color: var(--color-gray-600);
}

/* Botão "Adicionar" MENOR: largura só do texto (não ocupa a coluna toda),
   alinhado à esquerda da sua coluna. */
.offer-document-add-btn {
  width: auto;
  min-width: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

.offer-document-upload-help {
  margin: 0.25rem 0 0;
  color: var(--color-gray-500);
  font-size: 0.875rem;
}

.offer-document-upload-table-wrap {
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  background: var(--color-surface-card);
}

.offer-document-upload-table {
  min-width: 58rem;
  margin-bottom: 0;
}

.offer-document-upload-table thead th {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--color-gray-200);
  /* !important: reafirma o cinza do cabeçalho na ÚLTIMA coluna (Ações), que senão
     herdaria o `background: transparent` da regra global de neutralização de sticky. */
  background: var(--color-gray-50) !important;
  color: var(--color-gray-600);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.offer-document-upload-table tbody td {
  padding: 0.75rem 0.875rem;
  border-color: var(--color-surface-650);
  vertical-align: middle;
}

.offer-document-upload-table tbody tr:last-child td {
  border-bottom: 0;
}

.offer-document-upload-name-cell {
  width: 35%;
}

.offer-document-upload-row-actions {
  display: flex;
  align-items: center;
  /* Padrao unico: botoes de acao alinhados a ESQUERDA na celula. */
  justify-content: flex-start;
  gap: 0.625rem;
}

.offer-document-upload-download {
  flex: 0 0 auto;
  white-space: nowrap;
}

.offer-document-upload-actions-cell {
  width: 13.5rem;
  /* Padrao unico: coluna de acoes a ESQUERDA, mesmo fundo das demais. */
  text-align: left;
  white-space: nowrap;
  background: transparent;
}

/* Botão de excluir documento existente (substitui o antigo checkbox). */
.offer-document-delete-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: 0;
}

/* Marcado para exclusão: botão fica sólido e a linha esmaecida/riscada. */
.offer-document-delete-flag:checked + .offer-document-delete-btn {
  background-color: var(--bs-danger, var(--color-danger-bs));
  border-color: var(--bs-danger, var(--color-danger-bs));
  color: var(--color-surface-card);
}

.offer-document-upload-row--existing:has(.offer-document-delete-flag:checked) {
  opacity: 0.6;
}

.offer-document-upload-row--existing:has(.offer-document-delete-flag:checked) .offer-document-upload-name-cell input {
  text-decoration: line-through;
}

.offer-document-upload-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}

.offer-document-upload-empty {
  padding: 0.875rem 1rem;
  border: 1px dashed var(--color-gray-300);
  border-radius: 8px;
  background: var(--color-gray-50);
  color: var(--color-gray-500);
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  .offer-document-upload-table {
    min-width: 48rem;
  }
}

@media (max-width: 767.98px) {
  .offer-document-upload-section {
    gap: 0.75rem;
  }

  .offer-document-upload-section-header {
    flex-direction: column;
  }

  .offer-document-upload-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .offer-document-upload-table {
    min-width: 52rem;
  }

  .offer-document-upload-table tbody td {
    padding: 0.625rem 0.75rem;
  }

  .offer-document-upload-actions-cell {
    text-align: left;
    white-space: nowrap;
  }

  .offer-document-upload-row-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .offer-document-upload-row-actions .btn,
  .offer-document-upload-remove {
    flex: 0 0 auto;
    min-width: 0;
  }

  .offer-document-upload-download {
    justify-content: center;
  }
}
