.cadastro-produto-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px 0;
  border-bottom: 1px solid var(--rest-borda);
}

.cadastro-produto-divisor {
  border-bottom: 1px solid var(--rest-borda);
}

.cadastro-produto-titulo {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  font-family: var(--font-destaque);
  font-weight: 700;
  color: var(--rest-texto);
  margin-bottom: 20px;
}

.cadastro-produto-titulo .bi {
  color: var(--rest-primaria);
  opacity: .9;
}

.cadastro-produto-form {
  display: block
}

.cadastro-produto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cadastro-produto-campo {
  grid-column: span 1
}

.cadastro-produto-campo--full {
  grid-column: 1 / -1
}

.cadastro-produto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "nome       descricao"
    "preco      descricao"
    "categorias descricao"
    "imagem     imagem"
    "opcoes     opcoes";
  gap: 16px;
}

.cadastro-produto-campo--nome {
  grid-area: nome;
}

.cadastro-produto-campo--preco {
  grid-area: preco;
}

.cadastro-produto-campo--categorias {
  grid-area: categorias;
}

.cadastro-produto-campo--descricao {
  grid-area: descricao;
}

.cadastro-produto-campo--imagem {
  grid-area: imagem;
}

.cadastro-produto-campo--opcoes {
  grid-area: opcoes;
}

.cadastro-produto-campo--descricao {
  display: flex;
}

.cadastro-produto-campo--descricao .cadastro-produto-input {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cadastro-produto-campo--descricao .cadastro-produto-input textarea {
  height: 100%;
  min-height: 0;
  resize: vertical;
}

.cadastro-produto-input {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cadastro-produto-input label {
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  background: var(--rest-branco);
  padding: 0 6px;
  color: var(--rest-texto);
  font-size: 0.85rem;
  font-weight: var(--font-semibold);
  z-index: 1;
  pointer-events: none;
}

.cadastro-produto-input input,
.cadastro-produto-input textarea,
.cadastro-produto-input select {
  width: 100%;
  padding: 18px 12px 12px 12px;
  font-size: 1rem;
  border: 1px solid var(--rest-borda);
  border-radius: 8px;
  background: var(--rest-fundo);
  color: var(--rest-texto);
  font-family: var(--font-texto);
  transition: border-color 0.3s ease;
  box-sizing: border-box;
  margin-top: 20px;
  height: 50px;
}

.cadastro-produto-input input::placeholder,
.cadastro-produto-input textarea::placeholder {
  color: var(--rest-preto);
  opacity: 0.6;
  font-size: 16px !important;
}

.cadastro-produto-input input:focus,
.cadastro-produto-input textarea:focus,
.cadastro-produto-input select:focus {
  border-color: var(--rest-hover);
  outline: none;
}

.cadastro-produto-input input:focus+label,
.cadastro-produto-input textarea:focus+label,
.cadastro-produto-input select:focus+label {
  color: var(--rest-hover);
}

/* Erros */
.cadastro-produto-erro {
  color: var(--rest-erro);
  font-size: .9rem
}

.cadastro-produto-opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.cadastro-produto-opcao {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 8px 10px;
  border: 1px solid var(--rest-borda);
  border-radius: 8px;
  background: var(--rest-card);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease, box-shadow .2s ease
}

.cadastro-produto-opcao input {
  accent-color: var(--rest-primaria)
}

.cadastro-produto-opcao:hover {
  border-color: var(--rest-primaria);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04)
}

.cadastro-produto-upload {
  width: 100%
}

.upload-area {
  position: relative;
  border: 1px dashed var(--rest-borda);
  border-radius: 12px;
  padding: 14px;
  background: var(--rest-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.upload-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center
}

.upload-tip {
  margin: 0;
  color: var(--rest-subtexto);
  font-size: .9rem
}

.upload-preview {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rest-borda);
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.upload-skeleton {
  position: absolute;
  inset: 14px auto auto 14px;
  right: 14px;
  bottom: auto;
  width: calc(100% - 28px);
  max-width: 520px;
  aspect-ratio: 16/9;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: skeleton 1.1s ease-in-out infinite;
  opacity: 0;
  pointer-events: none
}

@keyframes skeleton {
  0% {
    background-position: 100% 0
  }

  100% {
    background-position: 0 0
  }
}

.upload-area.loading .upload-skeleton {
  opacity: 1
}

.upload-area.loading .upload-preview img {
  opacity: .4;
  filter: grayscale(.3)
}

.cadastro-produto-botoes {
  display: flex;
  gap: .6rem;
  margin-top: 50px;
  margin-bottom: 50px;
  justify-content: space-between;
}

.cadastro-produto-botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .5rem .95rem;
  font-size: 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-destaque);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--rest-sombra);
  line-height: 1;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  transition: transform .3s ease, box-shadow .2s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.cadastro-produto-botao .bi {
  font-size: 1rem;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  transform-origin: center;
  transition: inherit;
}

.cadastro-produto-botao:hover {
  transform: scale(1.03);
}

.cadastro-produto-botao--primario {
  background: var(--rest-principal);
  color: var(--rest-branco);
  padding: .80rem 2rem;
}

.cadastro-produto-botao--secundario {
  background: var(--rest-erro);
  color: var(--rest-branco);
  padding: .80rem 2rem;
}

.cadastro-produto-botao--novo {
  background: var(--rest-primaria);
  color: var(--rest-branco);
  padding: .80rem 2rem;
  margin-bottom: 20px;
}

.cadastro-produto-botao--primario .bi,
.cadastro-produto-botao--secundario .bi,
.cadastro-produto-botao--novo .bi {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.cadastro-produto-botao--img {
  background: var(--rest-principal);
  color: var(--rest-branco);
}

.cadastro-produto-botao--secundarioimg {
  background: var(--rest-erro);
  color: var(--rest-branco);
}

.cadastro-produto-botao:active {
  transform: scale(1.035)
}

.cadastro-produto-botao:focus-visible {
  transform: scale(1.02);
  outline: none;
  box-shadow: 0 0 0 .2rem rgba(216, 67, 21, .15)
}

.adicionais-erros {
  color: var(--rest-erro);
  font-size: .9rem;
  margin-bottom: 6px;
}

.adicionais-input {
  position: relative;
  width: 100%;
  display: block;
}

.adicionais-label {
  position: absolute;
  top: -10px;
  left: 1rem;
  background: var(--rest-branco);
  padding: 0 6px;
  color: var(--rest-texto);
  font-size: .85rem;
  font-weight: 600;
  z-index: 1;
  pointer-events: none;
  transition: color .2s ease;
}

.adicionais-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 12px 12px 12px;
  margin-top: 20px;
  min-height: 50px;
  border: 1px solid var(--rest-borda);
  border-radius: 8px;
  background: var(--rest-fundo);
}

.adicionais-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 8px 12px;
  border: 1px solid var(--rest-borda);
  border-radius: 999px;
  background: var(--rest-card);
  color: var(--rest-texto);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.adicionais-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.adicionais-icone {
  font-size: .95rem;
  color: var(--rest-subtexto);
  transition: color .2s ease, transform .08s ease;
}

.adicionais-texto {
  font-size: .95rem;
  font-weight: 600;
}

.adicionais-item:hover {
  border-color: var(--rest-primaria);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.adicionais-item:has(input:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 .2rem rgba(216, 67, 21, .15);
}

.adicionais-item:has(input:checked) {
  background: linear-gradient(to right, rgba(216, 67, 21, .08), transparent);
  border-color: var(--rest-primaria);
}

.adicionais-item:has(input:checked) .adicionais-icone {
  color: var(--rest-primaria);
  transform: scale(1.05);
}

.adicionais-item:active {
  transform: scale(1.02);
}

.adicionais-lista:focus-within+.adicionais-label {
  color: var(--rest-hover);
}

.cadastro-produto-subtitulo {
  font-family: var(--font-destaque);
  font-weight: 700;
  color: var(--rest-texto);
  margin: 50px 0 20px 0;
}

.cadastro-produto-lista-opcoes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cadastro-produto-lista-opcoes-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rest-borda);
  border-radius: 10px;
  background: var(--rest-card);
  transition: background .15s ease, border-color .15s ease, box-shadow .2s ease;
}

.cadastro-produto-lista-opcoes-item:hover {
  background: #fffdfa;
  border-color: var(--rest-primaria);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.cadastro-produto-opcao-nome {
  color: var(--rest-texto);
  font-weight: 700;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.cadastro-produto-link-editar-opcao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .60rem .70rem;
  border-radius: 10px;
  border: 1px solid var(--rest-principal);
  background: var(--rest-principal);
  color: var(--rest-branco);
  font-family: var(--font-destaque);
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transform-origin: center;
  box-shadow: var(--rest-sombra);
  transition: transform .3s ease, box-shadow .2s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.cadastro-produto-link-editar-opcao .bi {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  transition: inherit;
}

.cadastro-produto-link-editar-opcao:hover {
  transform: scale(1.03);
}

.cadastro-produto-opcao-bloco {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.cadastro-produto-valores {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cadastro-produto-valor-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .6rem;
  border: 1px solid var(--rest-borda);
  border-radius: 999px;
  background: var(--rest-card);
  color: var(--rest-texto);
  font-weight: 600;
  line-height: 1;
  transition: border-color .15s ease, box-shadow .2s ease, background .15s ease;
}

.cadastro-produto-valor-chip .bi {
  font-size: .95rem;
  color: var(--rest-primaria);
  line-height: 1;
}

.cadastro-produto-valor-chip .valor-nome {
  font-weight: 600
}

.cadastro-produto-valor-chip .valor-preco {
  color: var(--rest-subtexto);
  font-weight: 700;
}

.cadastro-produto-valor-chip:hover {
  border-color: var(--rest-primaria);
  background: linear-gradient(to right, rgba(216, 67, 21, .06), transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.cadastro-produto-sem-valores {
  color: var(--rest-subtexto);
}