/* Notificações temporárias — medidas e acabamento extraídos do Figma. */
.cookey-notices {
  --notice-width: 423.714px;
  --notice-font: 16.34px;
  --notice-detail-font: 11.7px;
  --notice-action-font: 13.62px;
  --notice-icon-size: 22px;
  position: fixed;
  z-index: 300;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  transform-origin: 0 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 0;
  pointer-events: none;
  transition:
    padding-right 0.38s cubic-bezier(0.32, 0.72, 0, 1),
    padding-left 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.cookey-notice {
  display: flex;
  width: min(var(--notice-width), 100%);
  max-width: 100%;
  min-height: 40.61px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 18px;
  border: 0.5px solid rgba(51, 79, 136, 0.7);
  border-radius: 3px;
  color: #fefff2;
  background: rgba(22, 32, 52, 0.9);
  box-shadow: 0 13.616px 40.848px rgba(0, 20, 59, 0.15);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
  font: 400 var(--notice-font) / 1.16
    var(
      --sf,
      "SF Pro Display",
      "SF Pro Text",
      -apple-system,
      BlinkMacSystemFont,
      "Helvetica Neue",
      Arial,
      sans-serif
    );
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  outline-offset: 4px;
  animation: notice-enter 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  transition:
    transform 0.23s ease,
    opacity 0.2s ease;
}
.notice-warning,
.notice-info,
.notice-error {
  background: rgba(22, 32, 52, 0.9);
}
.notice-icon {
  display: block;
  width: var(--notice-icon-size);
  height: auto;
  flex: 0 0 var(--notice-icon-size);
  object-fit: contain;
  pointer-events: none;
}
.notice-icon-error .notice-icon {
  width: 17px;
  flex-basis: 17px;
}
.notice-icon-new-order .notice-icon {
  width: 20px;
  flex-basis: 20px;
}
.notice-message {
  min-width: 0;
  white-space: pre-line;
  overflow-wrap: break-word;
}
.notice-has-detail .notice-message {
  white-space: nowrap;
}
.notice-detail {
  display: block;
  font-size: var(--notice-detail-font);
  line-height: 1.16;
}
.notice-action-area {
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  align-items: center;
  margin: -8px -6px;
  padding: 8px 6px;
  cursor: default;
  touch-action: manipulation;
}
.notice-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 var(--notice-action-font) / 1.2
    var(
      --sf,
      "SF Pro Display",
      "SF Pro Text",
      -apple-system,
      BlinkMacSystemFont,
      "Helvetica Neue",
      Arial,
      sans-serif
    );
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

.cookey-notice.has-interacted {
  animation: none;
}
.cookey-notice.is-dragging {
  animation: none;
  transition: none;
  cursor: grabbing;
}
.cookey-notice.is-leaving {
  animation: none;
  transition: none;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.has-notices .receipt-status {
  position: absolute !important;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
@keyframes notice-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Agrupamento: mantém a mesma largura do cartão e abre a pilha sem saltos. */
.notice-deck {
  position: relative;
  width: min(var(--notice-width), 100%);
  height: 0;
  transition: height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.notice-slot {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  transform-origin: center top;
}
.notice-slot .cookey-notice {
  width: 100%;
}
.notice-stack-toggle {
  align-self: center;
  min-height: 30px;
  border: 0.5px solid rgba(51, 79, 136, 0.7);
  border-radius: 3px;
  padding: 5px 13px;
  color: #fefff2;
  background: rgba(22, 32, 52, 0.9);
  box-shadow: 0 8px 24px rgba(0, 20, 59, 0.15);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  font: 600 12px/1.2
    var(
      --sf,
      "SF Pro Display",
      "SF Pro Text",
      -apple-system,
      BlinkMacSystemFont,
      "Helvetica Neue",
      Arial,
      sans-serif
    );
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.notice-stack-toggle[hidden] {
  display: none;
}

.bag-drawer-open .cookey-notices:not(.is-in-bag) {
  padding-right: calc(min(632px, 100vw) + 10px);
}
.cookey-notices.is-in-bag {
  position: relative !important;
  z-index: 1;
  top: auto !important;
  left: auto;
  width: 100% !important;
  transform: none !important;
  align-items: stretch;
  padding: 0;
  transition: none;
}
.cookey-notices.is-in-bag.has-active-notices {
  padding-bottom: 8px;
}
.cookey-notices.is-in-bag .notice-deck {
  width: 100%;
}
.cookey-notices.is-in-bag .cookey-notice {
  width: 100%;
  max-width: none;
}

@media (max-width: 600px) {
  .cookey-notices {
    --notice-font: 12.8px;
    --notice-detail-font: 10px;
    --notice-action-font: 11px;
    --notice-icon-size: 18px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .cookey-notice {
    gap: 12px;
    min-height: 40px;
    padding: 9px 13px;
    border-radius: 2px;
  }
  .notice-stack-toggle {
    border-radius: 2px;
  }
  .notice-icon-error .notice-icon {
    width: 15px;
    flex-basis: 15px;
  }
  .notice-icon-new-order .notice-icon {
    width: 18px;
    flex-basis: 18px;
  }
  .notice-action-area {
    margin: -7px -5px;
    padding: 7px 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cookey-notice,
  .notice-deck {
    animation: none;
    transition: none;
  }
}
/* Dentro da sacola, avisos ocupam uma faixa sticky abaixo do cabeçalho. */
.cookey-notices.is-in-bag {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  flex: none;
  box-sizing: border-box;
  padding: 12px 0 10px !important;
  background: var(--shell-navy, #162034);
}
.cookey-notices.is-in-bag.has-active-notices {
  padding-bottom: 12px !important;
}
.cookey-notices.is-in-bag .notice-stack-toggle {
  margin-top: 8px;
}
