/*
 * MELANIUM PWA Navigation 2.0.
 * Installed-app only. Normal browser navigation remains unchanged.
 * Five accessible tabs and a compact Windows/desktop PWA dock.
 */
.mp-pwa-nav { display: none; }

@media (display-mode: standalone) {
  body.mp-site {
    padding-bottom: 112px;
  }

  .mp-pwa-nav {
    --mp-nav-red: #f25470;
    --mp-nav-ink: #f7eaf0;
    position: fixed;
    z-index: 180;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    width: min(640px, calc(100vw - 36px));
    min-height: 76px;
    padding: 8px 10px;
    gap: 3px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 22px;
    background: rgba(21, 13, 19, .96);
    box-shadow: 0 16px 50px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.045);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    font-family: Manrope, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
  }

  .mp-pwa-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 59px;
    padding: 7px 3px 5px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #c5b7c0;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color .16s ease, color .16s ease;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .005em;
    text-align: center;
  }

  .mp-pwa-nav__item:visited { color: #c5b7c0; }
  .mp-pwa-nav__item:hover {
    color: #fff6f8;
    background: rgba(255,255,255,.07);
    text-decoration: none;
  }
  .mp-pwa-nav__item:focus-visible {
    outline: 3px solid #ff899d;
    outline-offset: -2px;
  }
  .mp-pwa-nav__item svg {
    display: block;
    width: 23px;
    height: 23px;
    flex: none;
    stroke: currentColor;
  }
  .mp-pwa-nav__item[aria-current="page"] {
    color: #fff6f8;
    background: linear-gradient(145deg,rgba(173,26,57,.38),rgba(83,18,35,.48));
    border-color: rgba(248,98,125,.25);
  }
  .mp-pwa-nav__item[aria-current="page"]:visited { color: #fff6f8; }
  .mp-pwa-nav__item[aria-current="page"] svg { color: #ff6b84; }
  .mp-pwa-nav__item[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 32%;
    right: 32%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: #ff5778;
    box-shadow: 0 0 14px rgba(255,74,108,.7);
  }

  /* Never cover the floating scroll-to-top button. */
  .mp-back-to-top {
    bottom: max(108px, calc(108px + env(safe-area-inset-bottom)));
    right: max(15px, env(safe-area-inset-right));
    z-index: 185;
  }
}

@media (display-mode: standalone) and (max-width: 760px) {
  body.mp-site { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .mp-pwa-nav {
    width: 100%;
    left: 0;
    bottom: 0;
    transform: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 21px 21px 0 0;
    padding: 8px 7px calc(8px + env(safe-area-inset-bottom));
    gap: 0;
    min-height: 76px;
    box-shadow: 0 -12px 34px rgba(0,0,0,.5);
  }
  .mp-pwa-nav__item { min-height: 61px; font-size: 11px; gap: 4px; }
  .mp-pwa-nav__item svg { width: 22px; height: 22px; }
  .mp-pwa-nav__item[aria-current="page"]::before { top: -8px; }
  .mp-back-to-top { bottom: calc(94px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) and (max-width: 350px) {
  .mp-pwa-nav { padding-left: 3px; padding-right: 3px; }
  .mp-pwa-nav__item { font-size: 10px; }
}
@media (display-mode: standalone) and (orientation: landscape) and (max-height: 460px) {
  body.mp-site { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
  .mp-pwa-nav {
    min-height: 57px;
    padding-top: 3px;
    padding-bottom: calc(3px + env(safe-area-inset-bottom));
  }
  .mp-pwa-nav__item { min-height: 49px; gap: 1px; }
  .mp-pwa-nav__item svg { width: 19px; height: 19px; }
  .mp-pwa-nav__item[aria-current="page"]::before { top: -3px; }
  .mp-back-to-top { bottom: calc(75px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .mp-pwa-nav__item { transition: none; }
}
/* iOS home-screen installations support display-mode standalone on modern Safari. */

/* iPhone/iPad home-screen fallback for Safari versions that expose
   navigator.standalone without matching the display-mode media query. */
html.mp-ios-standalone body.mp-site {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
html.mp-ios-standalone .mp-pwa-nav {
  position: fixed;
  z-index: 180;
  bottom: 0;
  left: 0;
  transform: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  min-height: 76px;
  gap: 0;
  padding: 9px 7px calc(11px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.16);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 21px 21px 0 0;
  background: rgba(21,13,19,.97);
  box-shadow: 0 -12px 34px rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-family: Manrope,Arial,sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html.mp-ios-standalone .mp-pwa-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 61px;
  padding: 7px 2px 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  text-decoration: none;
  background: transparent;
  color: #c5b7c0;
  font: 800 11px/1.2 Manrope,Arial,sans-serif;
  text-align: center;
  touch-action: manipulation;
}
html.mp-ios-standalone .mp-pwa-nav__item svg {
  width: 23px;
  height: 23px;
  flex: none;
  stroke: currentColor;
}
html.mp-ios-standalone .mp-pwa-nav__item[aria-current="page"] {
  color: #fff6f8;
  border-color: rgba(248,98,125,.25);
  background: linear-gradient(145deg,rgba(173,26,57,.38),rgba(83,18,35,.48));
}
html.mp-ios-standalone .mp-pwa-nav__item[aria-current="page"] svg {color:#ff6b84}
html.mp-ios-standalone .mp-pwa-nav__item[aria-current="page"]::before {
  content:"";
  position:absolute;
  top:-9px;
  left:32%;
  right:32%;
  height:3px;
  background:#ff5778;
  border-radius:0 0 4px 4px;
}
html.mp-ios-standalone .mp-pwa-nav__item:focus-visible {
  outline:3px solid #ff899d;
  outline-offset:-2px;
}
html.mp-ios-standalone .mp-back-to-top {
  bottom:calc(101px + env(safe-area-inset-bottom));
  z-index:185;
}
@media (min-width:761px) {
  html.mp-ios-standalone .mp-pwa-nav {
    left:50%;
    bottom:max(16px, env(safe-area-inset-bottom));
    transform:translateX(-50%);
    width:min(640px, calc(100vw - 36px));
    border:1px solid rgba(255,255,255,.16);
    border-radius:22px;
    padding:8px 10px;
    gap:3px;
  }
}
@media (max-width:350px) {
  html.mp-ios-standalone .mp-pwa-nav__item {font-size:10px}
}
/* When entering information on an iPhone, uncover the form and its keyboard. */
html.mp-ios-input-active .mp-pwa-nav {display:none!important}

