/* Componentes: botões, chips, busca, cards, amostras, diálogos, sacolinha */

/* ---------- Botões ---------- */
.botao {
  --cor: var(--vermelho);
  --texto: var(--branco);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: var(--borda);
  border-radius: 999px;
  background: var(--cor);
  color: var(--texto);
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--tinta);
  transition: transform .25s var(--ease-quique), box-shadow .25s var(--ease-quique);
}
.botao:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tinta); }
.botao:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.botao svg { width: 22px; height: 22px; flex: none; }
.botao--secundario { --cor: var(--branco); --texto: var(--tinta); }
.botao--whats { --cor: #25D366; --texto: var(--tinta); }
.botao--pequeno { min-height: 44px; padding: 0 16px; font-size: 1rem; box-shadow: 3px 3px 0 var(--tinta); }
.secao--tinta .botao { border-color: var(--papel); box-shadow: 4px 4px 0 var(--papel); }
.secao--tinta .botao:hover { box-shadow: 6px 6px 0 var(--papel); }

/* Linhas de velocidade: "chega rapidinho" */
.botao--primario::before {
  content: "";
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  width: 28px;
  height: 15px;
  translate: 10px -50%;
  opacity: 0;
  background:
    linear-gradient(currentColor, currentColor) 100% 0 / 100% 3px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 50% / 65% 3px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 85% 3px no-repeat;
  color: var(--tinta);
  transition: opacity .3s var(--ease-suave), translate .35s var(--ease-suave);
}
.secao--tinta .botao--primario::before { color: var(--papel); }
.botao--primario:hover::before { opacity: 1; translate: 0 -50%; }

.fechar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: var(--borda);
  background: var(--branco);
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: rotate .3s var(--ease-quique);
}
.fechar:hover { rotate: 90deg; }

/* ---------- Chips e busca ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 8px;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 2px solid var(--tinta);
  background: var(--branco);
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .25s var(--ease-quique);
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--papel); }

.busca input {
  width: 100%;
  font: inherit;
  font-weight: 600;
  border: var(--borda);
  border-radius: 999px;
  padding: 11px 18px 11px 46px;
  background: var(--branco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D0C11' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") 16px 50% / 20px no-repeat;
  color: var(--tinta);
}
.busca input::placeholder { color: #8A8490; }

/* ---------- Cards de produto ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--branco);
  border: var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra-adesivo);
  rotate: var(--giro, 0deg);
  transition: rotate .4s var(--ease-quique), box-shadow .3s var(--ease-suave), transform .3s var(--ease-tilt);
  will-change: transform;
}
.anim .card[data-reveal] {
  transition: opacity .7s var(--ease-suave), translate .8s var(--ease-quique), rotate .4s var(--ease-quique), box-shadow .3s var(--ease-suave), transform .3s var(--ease-tilt);
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s, 0s;
}
.card:nth-child(3n + 1) { --giro: -1deg; }
.card:nth-child(3n + 2) { --giro: .8deg; }
.card:nth-child(3n) { --giro: -.4deg; }
.card:hover { --giro: 0deg; box-shadow: 7px 8px 0 var(--tinta); }

.card__abrir {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: calc(var(--raio) - 3px) calc(var(--raio) - 3px) 0 0;
  overflow: hidden;
}
.card__abrir { position: relative; }
.card__selo {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border: 2px solid var(--tinta);
  border-radius: 999px;
  background: var(--branco);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  rotate: -3deg;
}
.card__foto { display: block; aspect-ratio: 4 / 5; background: var(--papel-2); overflow: hidden; }
.card__foto img { width: 100%; height: 100%; object-fit: cover; transition: scale .6s var(--ease-suave); }
.card:hover .card__foto img { scale: 1.06; }
.card__corpo { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 12px 14px 14px; border-top: var(--borda); }
.card__nome { font-size: 1.18rem; font-weight: 700; line-height: 1.12; }
.card__rodape { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.preco { font-family: var(--fonte-titulo); font-weight: 800; font-size: 1.3rem; color: var(--vermelho); line-height: 1; }
.preco--consulta { font-family: var(--fonte-texto); font-size: .9rem; color: var(--tinta-suave); font-style: italic; font-weight: 700; }

.botao-mais {
  border: 2px solid var(--tinta);
  background: var(--amarelo);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 800;
  font-size: .85rem;
  white-space: nowrap;
  transition: transform .25s var(--ease-quique), background .2s;
}
.botao-mais:hover { transform: scale(1.06) rotate(-2deg); }
.botao-mais.adicionado { background: var(--ciano); }

.foto-vazia { display: grid; place-items: center; width: 100%; height: 100%; background: var(--papel-2); }
.foto-vazia img { width: 42%; opacity: .5; filter: grayscale(.3); }

/* ---------- Amostras de toalha ---------- */
.amostras { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.amostra {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--branco);
  border: 2px solid var(--tinta);
  border-radius: 999px;
  padding: 6px;
  transition: transform .25s var(--ease-quique);
}
.amostra:hover { transform: translateY(-2px) rotate(-.6deg); }
.amostra__cor { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--tinta); background: var(--cor); }
.amostra__cor--xadrez {
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--cor) 80%, transparent) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(90deg, var(--cor) 0 7px, var(--branco) 7px 14px);
}
.amostra__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 0; background: none; text-align: left; line-height: 1.15; }
.amostra__nome { font-weight: 800; font-size: .95rem; }
.amostra__preco { font-size: .82rem; color: var(--tinta-suave); }
.amostra__mais { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--tinta); background: var(--amarelo); font-weight: 800; font-size: 1.2rem; line-height: 1; }

/* ---------- Diálogos ---------- */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(13, 12, 17, .55); backdrop-filter: blur(3px); }

.detalhe { width: min(100% - 24px, 940px); margin: auto; }
.detalhe__caixa {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: min(90vh, 720px);
  background: var(--papel);
  border: 3px solid var(--tinta);
  border-radius: var(--raio-grande);
  box-shadow: 8px 8px 0 var(--tinta);
  overflow: hidden;
}
dialog[open] .detalhe__caixa { animation: surgir .45s var(--ease-quique); }
.detalhe__fechar { position: absolute; top: 12px; right: 12px; z-index: 2; }
.detalhe__foto { background: var(--papel-2); min-height: 280px; }
.detalhe__foto img { width: 100%; height: 100%; object-fit: cover; }
.detalhe__info { display: flex; flex-direction: column; gap: 12px; padding: 30px 28px 26px; overflow: auto; }
.detalhe__nome { font-size: clamp(1.9rem, 4vw, 2.6rem); padding-right: 40px; }
.detalhe__preco { font-family: var(--fonte-titulo); font-weight: 800; font-size: 1.7rem; color: var(--vermelho); line-height: 1; }
.detalhe__resumo { color: var(--tinta-suave); }
.detalhe__credito { font-size: .8rem; color: var(--tinta-suave); font-style: italic; }
.detalhe__credito a { color: inherit; }
.detalhe__subtitulo { font-size: 1.15rem; margin-bottom: 8px; }
.detalhe__inclui { list-style: none; padding: 0; display: grid; gap: 6px; }
.detalhe__inclui li { display: flex; gap: 10px; align-items: baseline; }
.detalhe__inclui li::before { content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--amarelo); border: 2px solid var(--tinta); translate: 0 1px; }
.detalhe__acoes { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.qtd { display: inline-flex; align-items: center; border: var(--borda); border-radius: 999px; background: var(--branco); overflow: hidden; }
.qtd button { width: 44px; height: 48px; border: 0; background: none; font-size: 1.35rem; font-weight: 800; }
.qtd button:hover { background: var(--papel-2); }
.qtd output { min-width: 34px; text-align: center; font-weight: 800; }
.qtd--mini button { width: 34px; height: 34px; font-size: 1.1rem; }
.qtd--mini output { min-width: 26px; font-size: .95rem; }

@keyframes surgir { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes subir { from { transform: translateY(100%); } }
@keyframes entrar-lado { from { transform: translateX(100%); } }

/* Painel do orçamento */
.painel { margin: 0 0 0 auto; height: 100dvh; width: min(100%, 440px); }
.painel__caixa { height: 100%; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; background: var(--papel); border-left: 3px solid var(--tinta); }
dialog.painel[open] .painel__caixa { animation: entrar-lado .45s var(--ease-suave); }
.painel__cabeca { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 2px dashed rgba(13, 12, 17, .25); }
.painel__cabeca h2 { font-size: 1.8rem; }
.painel__lista { list-style: none; padding: 14px 22px; flex: 1 0 auto; display: grid; gap: 12px; align-content: start; }
.painel__vazio { padding: 36px 22px; text-align: center; color: var(--tinta-suave); flex: 1; }
.painel__rodape { display: grid; gap: 12px; padding: 16px 22px 22px; border-top: 2px dashed rgba(13, 12, 17, .25); background: var(--papel-2); }
.painel__campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campo { display: grid; gap: 4px; font-weight: 800; font-size: .85rem; }
.campo--largo { grid-column: 1 / -1; }
.receber { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.receber legend { font-weight: 800; font-size: .85rem; padding: 0; margin-bottom: 4px; }
.receber label { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.receber input { width: 20px; height: 20px; accent-color: var(--vermelho); margin: 0; }
.painel__entrega { font-size: .88rem; line-height: 1.4; color: var(--tinta-suave); min-height: 1.2em; }
.painel__entrega strong { color: var(--tinta); }
.painel__contas { display: grid; gap: 2px; font-size: .92rem; }
.painel__contas p { display: flex; justify-content: space-between; gap: 12px; }
.campo input { min-width: 0; font: inherit; font-weight: 600; font-size: 1rem; border: 2px solid var(--tinta); border-radius: 12px; padding: 9px 12px; background: var(--branco); color: var(--tinta); }
.painel__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.painel__total strong { font-family: var(--fonte-titulo); font-size: 1.5rem; color: var(--vermelho); text-align: right; }
.painel .botao { width: 100%; }
.painel__limpar { justify-self: center; border: 0; background: none; text-decoration: underline; font-size: .85rem; color: var(--tinta-suave); padding: 4px; }

.item { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; background: var(--branco); border: 2px solid var(--tinta); border-radius: 16px; padding: 8px; }
.item__foto { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; background: var(--papel-2); }
.item__nome { font-weight: 800; line-height: 1.2; }
.item__cat { font-size: .8rem; color: var(--tinta-suave); }
.item__linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.item__preco { font-weight: 800; color: var(--vermelho); font-size: .95rem; }
.item__remover { border: 0; background: none; font-size: .8rem; text-decoration: underline; color: var(--tinta-suave); padding: 4px; }

/* ---------- Sacolinha flutuante ---------- */
.sacolinha {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--tinta);
  background: var(--vermelho);
  color: var(--branco);
  box-shadow: 4px 4px 0 var(--tinta);
  transition: transform .25s var(--ease-quique);
}
.sacolinha:hover { transform: rotate(-8deg) scale(1.05); }
.sacolinha svg { width: 30px; height: 30px; }
.sacolinha__contador {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2.5px solid var(--tinta);
  background: var(--amarelo);
  color: var(--tinta);
  font-weight: 800;
  font-size: .85rem;
}
.sacolinha__contador[data-zero] { display: none; }
.sacolinha__dica {
  position: absolute;
  right: calc(100% + 12px);
  white-space: nowrap;
  background: var(--tinta);
  color: var(--papel);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  opacity: 0;
  translate: 10px 0;
  pointer-events: none;
  transition: opacity .3s, translate .3s var(--ease-suave);
}
.sacolinha.mostrar-dica .sacolinha__dica { opacity: 1; translate: 0 0; }

.confete { position: fixed; z-index: 90; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; }

@media (max-width: 700px) {
  .detalhe { width: 100%; margin: auto 0 0; }
  .detalhe__caixa { grid-template-columns: 1fr; max-height: 92dvh; overflow: auto; border-radius: var(--raio-grande) var(--raio-grande) 0 0; border-bottom: 0; box-shadow: none; }
  dialog[open] .detalhe__caixa { animation: subir .4s var(--ease-suave); }
  .detalhe__foto { aspect-ratio: 4 / 3; min-height: 0; }
  .detalhe__info { overflow: visible; padding: 22px 18px 26px; }
  .detalhe__acoes .botao { flex: 1; }

  .painel { width: 100%; height: auto; max-height: 92dvh; margin: auto 0 0; }
  .painel__caixa { max-height: 92dvh; border-left: 0; border-top: 3px solid var(--tinta); border-radius: var(--raio-grande) var(--raio-grande) 0 0; }
  dialog.painel[open] .painel__caixa { animation: subir .4s var(--ease-suave); }

  .card__corpo { padding: 10px; }
  .card__nome { font-size: 1.02rem; }
  .card__rodape { flex-direction: column; align-items: stretch; }
  .botao-mais { padding: 8px; }
  .preco { font-size: 1.15rem; }
}
