/*
 * 1. FONTES: importa Inter para textos e Barlow Condensed para títulos. As fontes
 * alternativas mantêm a leitura quando não há internet.
 */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');
/*
 * 2. TEMA: variáveis de cores da marca, fundo e bordas. Alterações aqui são
 * reaproveitadas pelos componentes.
 */
:root {
  --red: #e32128;
  --ink: #171717;
  --muted: #777;
  --paper: #f7f7f4;
  --line: #e4e4df;
}
/*
 * 3. BASE: cálculo de dimensões, tipografia, links, controles de toque e indicação de
 * foco para navegação pelo teclado.
 */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px Inter,
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #ff8c8c;
  outline-offset: 4px;
}
/* 4. CABEÇALHO: faixa superior, logo, navegação e contador do carrinho. */
.topline {
  background: #171717;
  color: white;
  padding: 12px 6%;
  font-size: 10px;
  letter-spacing: 1.7px;
  display: flex;
  justify-content: space-between;
}
.topline span {
  color: #bbb;
  letter-spacing: 0.5px;
}
header {
  padding: 20px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}
.brand span {
  font:
    800 25px 'Barlow Condensed',
    Impact,
    sans-serif;
  letter-spacing: 0.5px;
}
.brand small {
  display: block;
  font:
    600 9px Inter,
    sans-serif;
  letter-spacing: 5px;
  color: var(--red);
  margin-top: 4px;
}
nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 600;
  font-size: 12px;
}
.cart-button {
  background: transparent;
  border: 1px solid #ccc;
  padding: 12px 16px;
  border-radius: 5px;
}
.cart-button b {
  margin-left: 16px;
  background: var(--red);
  color: white;
  padding: 3px 7px;
  border-radius: 3px;
}
/*
 * 5. APRESENTAÇÃO: duas colunas no computador, título com destaque vermelho e composição
 * decorativa ao redor do logo.
 */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 520px;
  overflow: hidden;
}
.hero-copy {
  padding: 65px 0 50px 11%;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
}
.eyebrow span {
  display: inline-block;
  background: var(--red);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 7px;
}
h1 {
  font:
    800 clamp(54px, 6.8vw, 100px)/0.97 'Barlow Condensed',
    Impact,
    sans-serif;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin: 25px 0;
}
h1 em {
  font-style: normal;
  color: var(--red);
}
.hero p {
  line-height: 1.9;
  color: #666;
  font-size: 14px;
}
/* Botão principal compartilhado pela loja e pelo editor. */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  background: var(--red);
  color: white;
  padding: 17px 24px;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}
.hero .primary {
  margin-top: 18px;
}
.hero-note {
  font-size: 10px;
  color: #888;
  margin-top: 25px;
}
.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  overflow: hidden;
  background-image: radial-gradient(#d6d6d1 1px, transparent 1px);
  background-size: 18px 18px;
}
.hero-art img {
  position: relative;
  width: 77%;
  max-width: 440px;
  mix-blend-mode: multiply;
  z-index: 1;
}
.orbit {
  position: absolute;
  width: 580px;
  height: 580px;
  border: 1px solid #d0d0ca;
  border-radius: 50%;
}
.orbit-two {
  width: 440px;
  height: 440px;
}
.art-
/*
 * 11. FORMULÁRIOS: campos, indicadores de foco e organização em duas colunas quando há
 * espaço.
 */
label {
  position: absolute;
  bottom: 22px;
  right: 25px;
  font-size: 8px;
  letter-spacing: 3px;
  color: #888;
}
/* 6. ETAPAS DA COMPRA: organiza os três passos em colunas. */
.benefits {
  margin: 0 6%;
  padding: 26px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  gap: 25px;
}
.benefits > div {
  display: flex;
  align-items: center;
  gap: 16px;
}
.benefits b {
  font:
    600 29px 'Barlow Condensed',
    sans-serif;
  color: var(--red);
}
.benefits span {
  font-size: 12px;
  font-weight: 600;
}
.benefits small {
  display: block;
  color: #888;
  font-size: 10px;
  font-weight: 400;
  margin-top: 5px;
}
/* 7. CATÁLOGO: espaçamento da seção, título, busca e filtros por categoria. */
.catalog {
  padding: 62px 6%;
}
.catalog .eyebrow {
  color: var(--red);
}
h2 {
  font:
    700 34px 'Barlow Condensed',
    Impact,
    sans-serif;
  margin: 10px 0;
}
.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.search {
  display: flex !important;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 4px;
  padding: 0 14px;
  width: 270px;
}
.search span {
  font-size: 25px;
}
.search input {
  border: 0;
  padding: 13px 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  outline: none;
}
.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.filter {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  color: #666;
}
.filter.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}
/*
 * 8. VITRINE: grade de quatro colunas no computador, estado vazio e cartões com foto,
 * descrição, preço e botão.
 */
.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  border: 1px dashed #d6d6cf;
  padding: 50px 20px;
  border-radius: 8px;
  background: #fafaf8;
}
.empty-mark {
  display: inline-grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  font-size: 25px;
}
.empty h3 {
  font:
    600 26px 'Barlow Condensed',
    sans-serif;
  margin: 15px 0 8px;
}
.empty p {
  font-size: 12px;
  line-height: 1.8;
  color: #888;
  margin: 0;
}
.product {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.product img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  padding: 20px;
  background: #fff;
}
.product-info {
  padding: 18px;
}
.product small {
  font-size: 9px;
  letter-spacing: 1px;
  color: #888;
}
.product h3 {
  font-size: 15px;
  margin: 10px 0;
}
.product p {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}
.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.product-bottom button {
  background: var(--red);
  color: white;
  border: 0;
  border-radius: 4px;
  padding: 10px;
  font-size: 11px;
}
/*
 * 9. CONTATO E RODAPÉ: faixa escura de atendimento, botão secundário e informações
 * finais.
 */
.contact {
  margin: 0 6% 55px;
  padding: 32px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #1e1e1e;
  color: white;
  border-left: 4px solid var(--red);
}
.contact .eyebrow {
  color: #aaa;
  font-size: 9px;
}
.contact h2 {
  font-size: 30px;
}
.contact p {
  font-size: 12px;
  color: #aaa;
}
.outline {
  padding: 15px 20px;
  border: 1px solid #777;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
footer {
  border-top: 1px solid var(--line);
  padding: 28px 6%;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  color: #888;
  font-size: 10px;
}
footer strong {
  font:
    700 18px 'Barlow Condensed',
    sans-serif;
  color: #222;
}
footer strong span {
  font-size: 10px;
  color: var(--red);
}
/*
 * 10. CARRINHO: janela centralizada, fundo escurecido, itens, controles de quantidade e
 * total.
 */
dialog {
  border: 0;
  border-radius: 10px;
  width: min(620px, 94vw);
  max-height: 90vh;
  padding: 28px;
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.icon-button {
  background: transparent;
  border: 0;
  font-size: 28px;
}
.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-item img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}
.cart-item-info {
  flex: 1;
}
.cart-item-info strong {
  font-size: 13px;
}
.cart-item-info small {
  display: block;
  color: #777;
  margin: 7px 0;
}
.quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quantity button {
  width: 28px;
  height: 28px;
  background: #eee;
  border: 0;
  border-radius: 4px;
}
.remove {
  background: none;
  border: 0;
  color: #888;
  font-size: 11px;
  padding: 6px;
}
.total {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}
.total strong {
  font-size: 22px;
}
.muted {
  font-size: 11px;
  line-height: 1.7;
  color: #777;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin: 12px 0;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d6d6d0;
  border-radius: 4px;
  background: white;
  padding: 12px;
  margin-top: 7px;
  color: #222;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #e3212833;
  border-color: var(--red);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.full {
  width: 100%;
}
#order-error {
  color: #c00;
  font-size: 12px;
}
/* 12. AVISOS: mensagem temporária fixa na parte inferior, controlada pela classe show. */
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #171717;
  color: white;
  padding: 14px 22px;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 5;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
}
/*
 * Garante que elementos ocultados pelo JavaScript não sejam exibidos por outras regras de
 * layout.
 */
[hidden] {
  display: none !important;
}
/*
 * 13. EDITOR: limita a largura de leitura e organiza painéis, ações e lista de produtos.
 */
.editor {
  max-width: 850px;
  margin: 40px auto;
  padding: 0 25px;
}
.editor section {
  background: white;
  padding: 24px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.editor .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.editor-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
/*
 * 14. TELAS GRANDES: limita a largura máxima para o conteúdo não ficar excessivamente
 * espalhado.
 */
@media (min-width: 1500px) {
  main,
  header,
  footer {
    max-width: 1500px;
    margin: auto;
  }
  .hero {
    min-height: 600px;
  }
}
/*
 * 15. CELULAR: empilha a apresentação, compacta o cabeçalho, usa duas colunas de produtos
 * e uma coluna nos formulários.
 */
@media (max-width: 700px) {
  .topline {
    font-size: 8px;
    justify-content: center;
  }
  .topline span {
    display: none;
  }
  header {
    padding: 14px 5%;
  }
  .brand span {
    font-size: 20px;
  }
  .brand img {
    width: 43px;
    height: 43px;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 3px;
  }
  nav > a {
    display: none;
  }
  .cart-button {
    padding: 10px;
    font-size: 11px;
  }
  .cart-button b {
    margin-left: 7px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding: 38px 6% 32px;
  }
  h1 {
    font-size: 65px;
  }
  .hero-art {
    min-height: 285px;
  }
  .hero-art img {
    width: 255px;
  }
  .hero p {
    font-size: 12px;
  }
  .hero-note {
    margin-top: 18px;
  }
  .benefits {
    gap: 12px;
    padding: 22px 0;
  }
  .benefits > div {
    display: block;
  }
  .benefits b {
    font-size: 23px;
  }
  .benefits span {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    line-height: 1.6;
  }
  .benefits small {
    display: none;
  }
  .catalog {
    padding: 35px 6%;
  }
  .heading-row {
    display: block;
  }
  h2 {
    font-size: 30px;
  }
  .search {
    width: 100%;
    margin-top: 20px;
  }
  .filters {
    gap: 7px;
  }
  .filter {
    padding: 9px 12px;
  }
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product img {
    height: 150px;
    padding: 12px;
  }
  .product-info {
    padding: 12px;
  }
  .product-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .contact {
    padding: 26px 22px;
    display: block;
    margin-bottom: 30px;
  }
  .contact .outline {
    display: inline-block;
    margin-top: 10px;
  }
  .contact h2 {
    font-size: 28px;
  }
  footer {
    display: block;
    padding: 25px 6%;
    line-height: 1.8;
  }
  dialog {
    padding: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cart-item {
    gap: 8px;
  }
  .cart-item img {
    width: 40px;
  }
  .quantity {
    gap: 7px;
  }
}
/*
 * 16. ESTADOS DE ESTOQUE: selos de disponível/em falta, botões desativados e faixa da
 * prévia do rascunho.
 */
.stock-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 20px;
  margin-bottom: 15px;
}
.available {
  color: #247547;
  background: #edf7ef;
}
.unavailable {
  color: #777;
  background: #eee;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.draft-banner {
  background: #fff0cc;
  color: #74520b;
  text-align: center;
  padding: 12px;
  font-size: 12px;
}
.editor-list > div {
  gap: 15px;
  flex-wrap: wrap;
}
.editor-list > div > span:first-child {
  flex: 1;
  min-width: 180px;
  line-height: 1.8;
}

/* Crédito de autoria: a imagem mantém suas proporções e o nome fica legível. */
.system-author {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: white;
  font-size: 11px;
  color: #777;
}
.system-author img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.system-author strong {
  color: #164f49;
  font-size: 14px;
}
.saved-customer {
  margin: 16px 0;
  padding: 16px;
  background: #f5f7f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.saved-customer p {
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.saved-customer button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #b20d21;
  text-decoration: underline;
}
.account-link {
  white-space: nowrap;
}
@media (max-width: 700px) {
  /* Duas linhas evitam que a marca dispute espaço com conta e carrinho. */
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  nav > .account-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 13px;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
  header nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    gap: 10px;
  }
  header nav > .admin-link:not([hidden]) {
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 5px;
  }
  header .cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    font-size: 13px;
    white-space: nowrap;
  }
  header .cart-button b {
    margin-left: 0;
  }
  header .brand span {
    font-size: 23px;
  }
  header .brand {
    align-self: center;
    gap: 10px;
  }
  header .brand img {
    width: 44px;
    height: 44px;
  }
}

/* Sabores e promoções: controles legíveis também na vitrine do celular. */
.flavor-label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}
.flavor-label select {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
}
.discount {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
}
.discount del {
  color: #666;
}
.discount span {
  color: #a90000;
  background: #ffeded;
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
}

/* Selo de desconto sobre a foto, sem interferir na seleção dos sabores. */
.product {
  position: relative;
}
.discount-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 9px;
  background: #d80019;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px #d8001926;
  pointer-events: none;
}
.category-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}
.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.category-row input {
  margin: 0;
  min-width: 0;
}
@media (max-width: 520px) {
  .category-row {
    grid-template-columns: 1fr 1fr;
  }
  .category-row input {
    grid-column: 1 / -1;
  }
}

/* Espaços constantes mantêm sabores e preços alinhados em cada linha da vitrine. */
.products .product {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.products .product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.products .product h3 {
  min-height: 38px;
}
.products .product-info > p {
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.products .stock-badge {
  align-self: flex-start;
  margin-top: auto;
}
.products .flavor-label,
.products .flavor-placeholder {
  height: 74px;
  margin-top: 14px;
}
.products .flavor-label select {
  height: 42px;
}
.products .discount {
  height: 20px;
  min-height: 20px;
  margin: 8px 0;
}
.product-title {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.product-title:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}
body.product-open {
  overflow: hidden;
}
#product-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 24px;
  overflow-y: auto;
}
.detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 24px;
}
.detail-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  margin: auto;
  border: 0;
  gap: 40px;
}
.detail-product > img {
  height: min(70vh, 650px);
  padding: 24px;
}
.detail-product .product-info {
  align-self: center;
}
.detail-product h2 {
  font-size: 32px;
  margin: 20px 0;
}
.detail-product p {
  font-size: 16px;
  white-space: pre-line;
}
.detail-product .product-bottom strong {
  font-size: 28px;
}
@media (max-width: 680px) {
  #product-dialog {
    padding: 16px;
  }
  .detail-product {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .detail-product > img {
    height: 36vh;
  }
  .detail-product .product-bottom {
    flex-direction: row;
  }
}

/* O atalho administrativo também fica disponível no celular, somente após autenticação. */
nav > .admin-link:not([hidden]) {
  display: inline-block;
}
nav > .admin-link[hidden] {
  display: none;
}

/* Navegação administrativa com espaçamento independente das ações do editor. */
header > .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.phone-actions {
  margin-top: 16px;
}
.product-category-group {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.product-category-group summary {
  cursor: pointer;
  padding: 16px;
  background: #f3f3f0;
  font-weight: 700;
}
.editor .editor-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.editor-product-row > span:first-child {
  flex: 1;
  min-width: 0;
}
.editor-product-row .actions {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  header > .actions {
    justify-content: center;
    gap: 12px;
  }
  .editor .editor-product-row {
    flex-direction: column;
    align-items: stretch;
  }
}
