/* ==========================================================================
   AXIONMESK — BOTTOM SHEET PREMIUM
   Painel "Mais" redesenhado: sobe de baixo, glass, ícones coloridos,
   animação em cascata, arraste para fechar.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) Backdrop com blur
   -------------------------------------------------------------------------- */
.mais-fundo {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  z-index: 1200;
}
.mais-fundo.aberto { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   2) Painel (bottom sheet)
   -------------------------------------------------------------------------- */
.mais-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1201;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgba(30, 34, 43, .97) 0%, rgba(17, 20, 26, .99) 42%, #0C0E13 100%);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  box-shadow:
    0 -2px 0 rgba(56,107,255, .22),
    0 -24px 60px rgba(0, 0, 0, .65);
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateY(102%);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  color: #F5F7FA;
}
.mais-panel.aberto { transform: translateY(0); }

/* Brilho superior decorativo */
.mais-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 180px; height: 2px;
  background: linear-gradient(90deg, transparent, #386BFF, transparent);
  opacity: .9;
}

/* --------------------------------------------------------------------------
   3) Alça de arrastar
   -------------------------------------------------------------------------- */
.mais-panel__handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .26);
  margin: 10px auto 6px;
  cursor: grab;
  touch-action: none;
  transition: background .2s ease;
}
.mais-panel__handle:active { background: rgba(255,255,255,.45); }

/* --------------------------------------------------------------------------
   4) Cabeçalho
   -------------------------------------------------------------------------- */
.mais-panel__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(232, 234, 237, .55);
  text-align: center;
  padding: 6px 0 16px;
}

/* --------------------------------------------------------------------------
   5) Grade de atalhos
   -------------------------------------------------------------------------- */
.mais-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
  padding-bottom: 8px;
}

.mais-item {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 6px 12px !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .06);
  text-decoration: none !important;
  color: #D7DBE1 !important;
  min-height: 86px;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: transparent;

  /* animação de entrada em cascata */
  opacity: 0;
  transform: translateY(16px) scale(.94);
}
.mais-panel.aberto .mais-item {
  animation: maisItemIn .42s cubic-bezier(.22, 1, .36, 1) forwards;
}
.mais-panel.aberto .mais-item:nth-child(1) { animation-delay: .04s; }
.mais-panel.aberto .mais-item:nth-child(2) { animation-delay: .08s; }
.mais-panel.aberto .mais-item:nth-child(3) { animation-delay: .12s; }
.mais-panel.aberto .mais-item:nth-child(4) { animation-delay: .16s; }
.mais-panel.aberto .mais-item:nth-child(5) { animation-delay: .20s; }
.mais-panel.aberto .mais-item:nth-child(6) { animation-delay: .24s; }
.mais-panel.aberto .mais-item:nth-child(7) { animation-delay: .28s; }
.mais-panel.aberto .mais-item:nth-child(8) { animation-delay: .32s; }

@keyframes maisItemIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mais-item:active {
  transform: scale(.94) !important;
  background: rgba(56,107,255, .12);
  border-color: rgba(56,107,255, .35);
}

/* Ícone */
.mais-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .07);
  color: #386BFF;
  flex: 0 0 auto;
  transition: transform .2s ease, background .2s ease;
}
.mais-item:active .mais-item__icon {
  transform: scale(.92);
  background: rgba(56,107,255, .18);
}

.mais-item__label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -.01em;
  color: rgba(232, 234, 237, .82);
}

/* Item ativo */
.mais-item.active {
  background: rgba(56,107,255, .10);
  border-color: rgba(56,107,255, .38);
}
.mais-item.active .mais-item__icon {
  background: linear-gradient(140deg, #5C86FF, #386BFF);
  color: #241A00;
}
.mais-item.active .mais-item__label {
  color: #386BFF;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6) Telas pequenas: 3 colunas
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .mais-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .mais-item { min-height: 80px; padding: 12px 4px 10px !important; }
  .mais-item__icon { width: 40px; height: 40px; border-radius: 12px; }
  .mais-item__label { font-size: 10.5px; }
}

/* --------------------------------------------------------------------------
   7) Esconde a barra "Instalar" enquanto o painel está aberto
   -------------------------------------------------------------------------- */
body.mais-aberto .pwa-install-bar { display: none !important; }

/* --------------------------------------------------------------------------
   8) Acessibilidade
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mais-panel, .mais-fundo { transition: none !important; }
  .mais-panel .mais-item { animation: none !important; opacity: 1 !important; transform: none !important; }
}
