/* Aviso rapido (toast): uma mensagem por vez, embaixo da tela. Usado no site e nas lojas de exemplo.
   Cores trocaveis por --aviso-fundo e --aviso-texto. */

.aviso {
  position: fixed;
  inset: auto auto max(1rem, env(safe-area-inset-bottom)) 50%;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: 0;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: var(--aviso-fundo, #0F2E1F);
  color: var(--aviso-texto, #FFFFFF);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  translate: -50% 0;
}

/* Regras separadas: navegador que nao conhece :popover-open descartaria a regra inteira */
.aviso:popover-open { display: flex; opacity: 1; }
.aviso.aviso-sem-camada { z-index: 100; display: flex; opacity: 1; translate: -50% 0; }

.aviso-texto { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.aviso-fechar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.aviso-fechar svg { width: 1.125rem; height: 1.125rem; }
.aviso-fechar:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .aviso {
    translate: -50% 1rem;
    transition: opacity 0.25s ease, translate 0.25s ease, overlay 0.25s, display 0.25s;
    transition-behavior: allow-discrete;
  }

  .aviso:popover-open { translate: -50% 0; }

  @starting-style {
    .aviso:popover-open { opacity: 0; translate: -50% 1rem; }
  }
}
