/* Móvil (< md): barra inferior tipo app nativa (PWA y navegador) */

.maniac-pwa-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  align-items: flex-end;
  justify-content: space-around;
  gap: 0;
  min-height: 3rem;
  padding: 0.25rem 0.375rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(30, 41, 59, 0.85);
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.maniac-pwa-tabbar[hidden] {
  display: none !important;
}

.maniac-pwa-tabbar.is-visible {
  display: flex;
}

html.maniac-pwa-tabbar-on #maniac-main {
  padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
}

html.maniac-pwa-tabbar-on .maniac-mobile-create-slot {
  display: none !important;
}

html.maniac-pwa-tabbar-on #maniac-app-header [data-maniac-act="toggle-side"] {
  display: none !important;
}

.maniac-pwa-tabbar__item--menu {
  cursor: pointer;
  font: inherit;
}

body[data-sidebar-open='1'] .maniac-pwa-tabbar__item--menu {
  color: #c4b5fd;
}

.maniac-pwa-tabbar__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.125rem 0.125rem 0.0625rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.maniac-pwa-tabbar__item.is-active {
  color: #e2e8f0;
}

.maniac-pwa-tabbar__icon {
  width: 1.375rem;
  height: 1.375rem;
}

.maniac-pwa-tabbar__label {
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maniac-pwa-tabbar__fab {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.625rem 0.125rem 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: #f4f4f5;
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.maniac-pwa-tabbar__fab:active {
  transform: scale(0.96);
  background: #e4e4e7;
}

.maniac-pwa-tabbar__fab-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.maniac-pwa-create-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.26s ease;
}

.maniac-pwa-create-sheet[hidden] {
  display: none !important;
}

.maniac-pwa-create-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
}

.maniac-pwa-create-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(2, 6, 14, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.maniac-pwa-create-sheet__panel {
  position: relative;
  margin:
    0
    max(0.5rem, env(safe-area-inset-right, 0px))
    calc(0.625rem + env(safe-area-inset-bottom, 0px))
    max(0.5rem, env(safe-area-inset-left, 0px));
  padding: 0.75rem 0.75rem 0.625rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 15, 28, 0.9);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow:
    0 -12px 42px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(calc(100% + 1.25rem));
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.maniac-pwa-create-sheet.is-open .maniac-pwa-create-sheet__panel {
  transform: translateY(0);
}

html.maniac-pwa-tabbar-on .maniac-pwa-create-sheet__panel {
  margin-bottom: calc(3rem + env(safe-area-inset-bottom, 0px) + 0.125rem);
}

html.maniac-pwa-create-sheet-open,
html.maniac-pwa-create-sheet-open body {
  overflow: hidden;
}

html.maniac-pwa-create-sheet-open .maniac-pwa-tabbar {
  transform: none;
}

.maniac-pwa-create-sheet__grabber {
  width: 2.25rem;
  height: 0.25rem;
  margin: 0 auto 0.625rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.maniac-pwa-create-sheet__title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  text-align: left;
  padding: 0.25rem 0.5rem 0.375rem;
}

.maniac-pwa-create-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.maniac-pwa-create-sheet__action {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.maniac-pwa-create-sheet__action:active {
  color: #fff;
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12), 0 8px 24px rgba(124, 58, 237, 0.12);
}

.maniac-pwa-create-sheet__action:active i,
.maniac-pwa-create-sheet__action:active svg {
  color: #e9d5ff;
}

.maniac-pwa-create-sheet__action i,
.maniac-pwa-create-sheet__action svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #94a3b8;
}

.maniac-pwa-create-sheet__cancel {
  margin-top: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(51, 65, 85, 0.45);
  border-radius: 0.75rem;
  background: rgba(30, 41, 59, 0.45);
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.maniac-pwa-create-sheet__cancel:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.55);
}

html.light .maniac-pwa-tabbar {
  border-top-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.94);
}

html.light .maniac-pwa-tabbar__item {
  color: #64748b;
}

html.light .maniac-pwa-tabbar__item.is-active {
  color: #0f172a;
}

html.light .maniac-pwa-tabbar__fab {
  background: #000;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

html.light .maniac-pwa-tabbar__fab:active {
  background: #171717;
}

html.light .maniac-pwa-create-sheet__panel {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

html.light .maniac-pwa-create-sheet__title {
  color: #64748b;
}

html.light .maniac-pwa-create-sheet__action {
  background: transparent;
  color: #475569;
}

html.light .maniac-pwa-create-sheet__action:active {
  color: #1e293b;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: none;
}

html.light .maniac-pwa-create-sheet__cancel {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
  color: #64748b;
}
