.topbar {
  grid-template-columns: 220px minmax(360px, 650px) 220px;
  justify-content: center;
  gap: 34px;
  padding-inline: max(24px, calc((100vw - 1320px) / 2));
}
.quote-badge {
  justify-self: end;
  padding: 10px 0;
}

#quote-page {
  min-height: calc(100vh - 70px);
  background: #fcfaf8;
}
.quote-page-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 64px;
}
.quote-page-shell > .back-to-catalog {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font:
    500 13px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.quote-page-shell > .back-to-catalog:hover,
.quote-page-shell > .back-to-catalog:focus-visible {
  color: #b4231c;
}
.quote-page-title {
  padding: 10px 0 18px;
}
.quote-page-title h1 {
  margin: 0 0 4px;
  font:
    800 30px/1.1 Outfit,
    sans-serif;
  letter-spacing: -0.8px;
}
.quote-page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.quote-page-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.quote-list-labels,
.quote-page-item {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 180px 150px 100px;
  gap: 20px;
  align-items: center;
}
.quote-list-labels {
  padding: 13px 20px;
  background: #f7f2f0;
  color: #765e58;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.quote-page-item {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}
.quote-item-product {
  display: flex;
  align-items: center;
  gap: 13px;
}
.quote-item-product img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  mix-blend-mode: multiply;
  background: #fafafa;
}
.quote-item-product strong {
  display: block;
  font:
    700 16px Outfit,
    sans-serif;
}
.quote-item-product small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.quote-field {
  display: grid;
  gap: 5px;
  color: #705f5a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.quote-field select {
  height: 37px;
  border: 1px solid #e2d8d4;
  border-radius: 5px;
  background: #fff;
  padding: 0 9px;
  color: var(--ink);
  font:
    600 12px "DM Sans",
    sans-serif;
}
.page-stepper {
  display: flex;
  overflow: hidden;
  height: 37px;
  border: 1px solid #e2d8d4;
  border-radius: 5px;
}
.page-stepper button {
  width: 34px;
  border: 0;
  background: #fbf3f0;
  color: var(--green);
  font-size: 18px;
  cursor: pointer;
}
.page-stepper input {
  min-width: 0;
  width: 100%;
  border: 0;
  text-align: center;
  color: var(--ink);
  font:
    700 13px "DM Sans",
    sans-serif;
  outline: 0;
}
.quote-item-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}
.quote-item-actions button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--green);
  font:
    700 11px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.quote-item-actions button:last-child {
  color: #a86b67;
}
.quote-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.quote-contact label {
  flex: 1 1 200px;
  display: block;
  font:
    700 13px Outfit,
    sans-serif;
}
.quote-contact input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #ead7d2;
  border-radius: 8px;
  font: 500 14px "DM Sans", sans-serif;
  box-sizing: border-box;
}
.quote-contact-error {
  flex: 1 1 100%;
  margin: 0;
  color: #b4231c;
  font-size: 13px;
  font-weight: 600;
}
.quote-notes {
  margin-top: 24px;
}
.quote-notes label {
  display: block;
  margin-bottom: 8px;
  font:
    700 13px Outfit,
    sans-serif;
}
.quote-notes small {
  color: var(--muted);
  font:
    400 11px "DM Sans",
    sans-serif;
}
.quote-notes textarea {
  margin: 0;
  height: 92px;
  font-size: 12px;
}
.quote-page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: 8px;
  background: #f7f2f0;
}
.quote-summary {
  text-align: center;
}
.quote-send {
  display: grid;
  gap: 4px;
  justify-items: center;
}
.quote-page-footer strong,
.quote-page-footer span {
  display: block;
}
.quote-page-footer strong {
  font:
    700 16px Outfit,
    sans-serif;
}
.quote-page-footer span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.send-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: #128c4a;
  color: #fff;
  padding: 0 22px;
  font:
    700 14px "DM Sans",
    sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.send-whatsapp:hover,
.send-whatsapp:focus-visible {
  background: #0f7a40;
}
.send-whatsapp i {
  font-size: 20px;
}
.page-stepper button:disabled {
  background: #f1f0ef;
  color: #b9b5b2;
  cursor: not-allowed;
}
.copy-fallback {
  border: 0;
  background: transparent;
  color: var(--muted);
  font:
    500 12px "DM Sans",
    sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
.copy-fallback:hover {
  color: #b4231c;
}
.quote-empty-page {
  max-width: 430px;
  margin: 55px auto;
  text-align: center;
}
.quote-empty-page > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: auto;
  border-radius: 50%;
  background: #f7e7e1;
  color: var(--green);
}
.quote-empty-page h2 {
  font:
    700 26px Outfit,
    sans-serif;
  margin: 16px 0 6px;
}
.quote-empty-page p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  min-height: 76px;
  padding: 18px max(24px, calc((100vw - 1320px) / 2));
  background: #2a2524;
  color: #f8f3f1;
}
.site-footer strong,
.site-footer span {
  display: block;
}
.site-footer strong {
  font:
    700 13px Outfit,
    sans-serif;
  letter-spacing: 0.5px;
}
.site-footer span,
.site-footer p {
  margin: 3px 0 0;
  color: #d9cbc7;
  font-size: 10px;
}
.site-footer > span {
  justify-self: end;
}

@media (max-width: 800px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding-inline: 18px;
    gap: 10px;
  }
  .topbar .header-search {
    display: none;
  }
  #quote-page {
    min-height: calc(100vh - 62px);
  }
  .quote-page-shell {
    width: min(100% - 28px, 600px);
    padding-top: 20px;
  }
  .quote-page-title h1 {
    font-size: 26px;
  }
  .quote-list-labels {
    display: none;
  }
  .quote-page-item {
    grid-template-columns: 1fr 1fr;
    gap: 15px 11px;
    padding: 15px;
  }
  .quote-item-product {
    grid-column: 1 / -1;
  }
  .quote-item-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
  }
  .quote-item-actions button {
    padding: 9px;
    border: 1px solid #e4d7d3;
    border-radius: 5px;
    text-align: center;
  }
  .quote-page-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }
  .send-whatsapp {
    width: 100%;
  }
  .site-footer {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 20px;
    text-align: center;
  }
  .site-footer > span {
    justify-self: center;
  }
}

/* Linha nova em evidência e itens repetidos */
@keyframes new-line-highlight {
  from {
    background: #fdeceb;
  }
  to {
    background: transparent;
  }
}
.quote-page-item.is-new {
  animation: new-line-highlight 2.6s ease-out;
}
.quote-page-item.is-duplicate {
  background: #fff8e6;
  box-shadow: inset 4px 0 0 #d99a00;
}
.duplicate-banner {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid #ecc86a;
  border-radius: 8px;
  background: #fff8e6;
  box-shadow: 0 8px 22px rgb(58 38 31 / 12%);
}
.duplicate-banner strong {
  font:
    700 15px Outfit,
    sans-serif;
}
.duplicate-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.duplicate-banner ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
}
.duplicate-banner li span {
  color: var(--muted);
}
.duplicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.duplicate-actions button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font:
    700 13px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.duplicate-remove {
  border: 0;
  background: #b4231c;
  color: #fff;
}
.duplicate-edit {
  border: 1px solid #d9b9b5;
  background: #fff;
  color: var(--ink);
}
@media (max-width: 800px) {
  .duplicate-actions {
    width: 100%;
  }
  .duplicate-actions button {
    flex: 1;
  }
}
/* Fechamento da cotação: barra de resumo sempre à vista e botão principal na cor da marca. */
.quote-open .whatsapp-float {
  display: none;
}
.quote-page-footer {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  border: 1px solid #ecdcd7;
  background: #fff;
  box-shadow: 0 -6px 24px rgb(58 38 31 / 12%);
}
.quote-page-footer .quote-summary strong {
  font:
    700 17px Outfit,
    sans-serif;
}
.quote-help-link {
  margin-left: 6px;
  color: var(--muted);
  text-decoration: underline;
}
.quote-help-link:hover {
  color: #b4231c;
}
.send-whatsapp {
  min-width: 220px;
  background: #1d7a46;
  font-size: 15px;
}
.send-whatsapp:hover,
.send-whatsapp:focus-visible {
  background: #155c34;
}

/* Observações: o "(opcional)" fica discreto ao lado do título. */
.quote-notes small {
  margin-left: 4px;
}
/* Quantidade: cabe 5 dígitos (88888) sem sobrar espaço. */
.page-stepper input {
  max-width: 64px;
}

/* Ajuda "?" ao lado das observações (mesmo desenho do restante do sistema). */
.help-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}
.help-tip {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #b4231c;
  color: #fff;
  font:
    700 12px/1 "DM Sans",
    sans-serif;
  cursor: pointer;
}
.help-tip[aria-expanded="true"] {
  background: #7f1a18;
  box-shadow: 0 0 0 3px #fbe4e1;
  font-size: 0;
}
.help-tip[aria-expanded="true"]::after {
  content: "×";
  font-size: 17px;
  font-weight: 500;
}
.help-text {
  position: absolute;
  z-index: 40;
  top: 30px;
  left: -10px;
  display: none;
  width: min(340px, 78vw);
  padding: 13px 15px;
  border-radius: 10px;
  background: #282425;
  color: #fff;
  font:
    600 13px/1.45 "DM Sans",
    sans-serif;
  text-transform: none;
  box-shadow: 0 12px 30px rgb(0 0 0 / 25%);
}
.help-text::before {
  position: absolute;
  top: -6px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #282425;
  content: "";
  transform: rotate(45deg);
}
.help-wrap:hover .help-text,
.help-tip[aria-expanded="true"] + .help-text {
  display: block;
}
