.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(500px, 720px) minmax(190px, 1fr);
  gap: 24px;
  padding-inline: max(32px, 7vw);
  height: 72px;
  transition: box-shadow 0.2s ease;
}

.topbar .brand {
  justify-self: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 190px;
  height: 56px;
  line-height: 0;
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.brand img {
  display: block;
  width: 190px;
  height: 56px;
  object-fit: contain;
}

.topbar .header-search {
  justify-self: center;
  width: 100%;
  max-width: 720px;
  height: 46px;
  background: #fff;
  border: 1px solid #c9c0bb;
  border-radius: 8px;
  box-shadow: 0 1px 2px #2a25240a;
}

.topbar .header-search input {
  background: transparent;
}
.topbar .quote-badge {
  justify-self: end;
}

.topbar.is-compact {
  height: 72px;
  box-shadow: 0 4px 14px #2a252412;
}

.topbar.is-compact .brand img {
  width: 190px;
  height: 56px;
}

.topbar.is-compact .brand {
  transform: none;
}

.topbar.is-compact .header-search {
  height: 38px;
}

@media (max-width: 1050px) and (min-width: 761px) {
  .topbar {
    grid-template-columns: 160px minmax(320px, 1fr) 170px;
    gap: 16px;
    padding-inline: 24px;
  }

  .topbar .brand img {
    width: 158px;
    height: 48px;
  }
  .category-rail {
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
  }
}

.catalog-head .breadcrumbs {
  display: none;
}
.catalog-head > p {
  max-width: 960px;
}

.filter-group[hidden],
.filter-group label[hidden] {
  display: none !important;
}

.category.active {
  background: var(--cream);
  border-color: #e0e2dc;
  color: #354640;
}

.category:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

#category-context {
  min-height: 30px;
  margin: 0 0 7px;
  color: #756863;
  font-size: 12px;
}

#category-context:empty {
  display: none;
}

#category-context .category-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}

#category-context button {
  border: 0;
  background: transparent;
  color: #a53b2b;
  padding: 3px 0;
  font:
    700 11px "DM Sans",
    sans-serif;
  cursor: pointer;
}

#category-context button:hover {
  text-decoration: underline;
}

.business-footer {
  padding: 18px max(24px, calc((100vw - 1320px) / 2));
  background: #f6f2f0;
  border-top: 1px solid #e5deda;
  color: #302a28;
}

.business-footer h2,
.business-footer h3 {
  margin: 0 0 8px;
  font-family: Outfit, sans-serif;
}
.business-footer h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
.business-footer h3 {
  margin-top: 16px;
  color: #9e6458;
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.business-footer p,
.business-footer a {
  margin: 0 0 5px;
  color: #5d5552;
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
}
.footer-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 45px;
}
.footer-info-grid h3 {
  margin-top: 0;
}
.footer-info-grid a {
  display: block;
  white-space: nowrap;
}

.site-footer {
  min-height: 38px;
  padding: 10px max(32px, 7vw);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: #242120;
  color: #e9e3df;
}

.site-footer span,
.site-footer button {
  margin: 0;
  font:
    12px "DM Sans",
    sans-serif;
  white-space: nowrap;
}
.site-footer span:first-child {
  justify-self: start;
}
.site-footer span:nth-child(2) {
  justify-self: center;
  color: #bdb4ae;
}
.site-footer span:nth-child(2) strong {
  display: inline;
  color: #e9e3df;
  font-weight: 700;
}
.site-footer button {
  justify-self: end;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.site-footer button:hover {
  color: #fff;
}

.whatsapp-float {
  position: fixed;
  z-index: 25;
  right: 24px;
  bottom: 54px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 22px #10251b45;
  text-decoration: none;
  animation: whatsapp-pulse 2.6s ease-in-out infinite;
}

.whatsapp-float i {
  font-size: 30px;
  line-height: 1;
}
.whatsapp-float small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.whatsapp-float::after {
  position: absolute;
  right: calc(100% + 10px);
  width: max-content;
  padding: 8px 10px;
  border-radius: 5px;
  background: #242120;
  color: #fff;
  content: "Falar no WhatsApp";
  font:
    600 11px "DM Sans",
    sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition:
    opacity 0.16s,
    transform 0.16s;
}
.whatsapp-float:hover::after,
.whatsapp-float:focus-visible::after {
  opacity: 1;
  transform: none;
}

@keyframes whatsapp-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 22px #10251b45,
      0 0 0 0 #25d36655;
  }
  55% {
    box-shadow:
      0 8px 22px #10251b45,
      0 0 0 10px #25d36600;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: 64px;
    padding-inline: 18px;
  }
  .topbar .header-search {
    display: none;
  }
  .brand {
    width: 150px;
    height: 46px;
  }
  .brand img {
    width: 150px;
    height: 46px;
  }
  .topbar.is-compact {
    height: 64px;
  }
  .topbar.is-compact .brand {
    transform: none;
  }
  #category-context .category-breadcrumb {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  .business-footer {
    padding: 18px 20px;
  }
  .footer-info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
    padding: 11px 18px;
  }
  .site-footer span:nth-child(2),
  .site-footer button {
    justify-self: center;
  }
  .whatsapp-float {
    right: 16px;
    bottom: 76px;
    width: 54px;
    height: 54px;
  }
  .whatsapp-float::after {
    display: none;
  }
}

/* Rodapé sempre no fim da tela: com poucos produtos (uma página só) a área de resultados
   estica e o rodapé não fica colado ao conteúdo nem sobe para o meio da tela. */
body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
#catalogo {
  flex: 1 0 auto;
}

/* Largura única: cabeçalho, conteúdo e rodapé usam a mesma margem lateral e nunca passam de 1320 px. */
:root {
  --page-gutter: max(24px, calc((100vw - 1320px) / 2));
}
.topbar,
.site-footer,
.catalog-head,
.business-footer {
  padding-inline: var(--page-gutter);
}
.catalog-content {
  max-width: none;
  padding-inline: var(--page-gutter);
}
@media (max-width: 800px) {
  :root {
    --page-gutter: 18px;
  }
}
/* Orçamento na mesma largura do catálogo. */
.quote-page-shell {
  width: auto;
  margin-inline: var(--page-gutter);
}

/* Celular: contagem e ordenação na primeira linha, botão de filtros ocupando a linha de baixo. */
@media (max-width: 800px) {
  .results-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: center;
  }
  .results-bar .mobile-filter {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    min-height: 44px;
  }
  .results-bar #result-count {
    margin: 0;
  }
}
/* Anúncio: informações em linhas separadas e espaços mais compactos. */
#modal-commercial-note {
  margin-top: 6px;
  line-height: 1.5;
  white-space: pre-line;
}
#modal-code {
  margin-top: 8px;
}
.modal-content hr {
  margin-block: 14px;
}
.modal-content .choice-title {
  margin-bottom: 8px;
}
.color-options {
  gap: 6px;
  margin-bottom: 14px;
}
.color-option {
  min-height: 30px;
  padding: 5px 8px;
}

/* Lista de cotação: escolha de cor com bolinha em cada opção. */
.color-select {
  position: relative;
}
.color-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.color-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot, #aaa);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 25%);
}
:is(.line-editor, .quote-page-item) .color-select .color-select-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 24px 0 9px;
  border: 1px solid #d9b9b5;
  border-radius: 4px;
  background: #fffaf9
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b4231c' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}
.quote-line .line-editor .color-select-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.color-select-list {
  position: fixed;
  z-index: 60;
  max-height: 232px;
  margin: 0;
  padding: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #e0d8d4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(58 38 31 / 16%);
  list-style: none;
}
.color-select-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}
.color-select-list li:hover,
.color-select-list li:focus-visible {
  background: #f6f2f0;
  outline: 0;
}
.color-select-list li[aria-selected="true"] {
  background: #fdeceb;
  font-weight: 700;
}
/* Bolinha de cor visível também quando é branca. */
.color-option i {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 25%);
}
@media (max-width: 800px) {
  .modal-content .choice-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
:is(.line-editor, .quote-page-item) .color-select .color-select-button:hover,
:is(.line-editor, .quote-page-item) .color-select .color-select-button[aria-expanded="true"] {
  border-color: #b4231c;
  background-color: #fff;
}
:is(.line-editor, .quote-page-item) .color-select .color-select-button:focus-visible {
  outline: 2px solid #b4231c;
  outline-offset: 1px;
}

/* Rolagem: a página de trás não anda com a gaveta ou janelas abertas, nem ao chegar no fim das listas. */
html {
  scrollbar-gutter: stable;
}
html.scroll-locked {
  overflow: hidden;
}
#quote-lines,
.quote-drawer,
.color-select-list,
dialog {
  overscroll-behavior: contain;
}

.quote-page-item .color-select .color-select-button {
  height: 37px;
  font-size: 12px;
  font-weight: 600;
}

/* Selo de disponibilidade no cartão do produto. */
.product-image {
  position: relative;
}
.avail-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  font:
    700 11px "DM Sans",
    sans-serif;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}
.avail-pronta {
  background: #0f5132;
}
.avail-rapida {
  background: #a6d785;
  color: #1f3b12;
}
.avail-programada {
  background: #c99a2e;
}
.avail-encomenda {
  background: #c2570c;
}
.avail-importado {
  background: #ffffff;
  color: #111111;
  border: 1px solid #111111;
}
.code-overlay {
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: var(--orange);
  background: rgb(255 255 255 / 82%);
  padding: 2px 7px;
  border-radius: 5px;
  font:
    700 10px "DM Sans",
    sans-serif;
  letter-spacing: 0.3px;
}

/* Escolha de gravação (1 ou 2 lados) na janela do produto. */
.engrave-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0 4px;
}
.engrave-choice strong {
  font:
    700 14px Outfit,
    sans-serif;
}
.engrave-choice label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.engrave-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
}
