/* nav */
.nav{
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top) + 8px);
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--nav-bg);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12), 0 8px 18px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  padding: 10px 14px;
  min-width: 320px;
  width: max-content;
  max-width: calc(100% - 20px);
  overflow: visible;
  border: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
/* (Logo) */
.nav img{height:34px; width:auto;
  display:block;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease}

/* Hover effect (Logo) */
.nav .logo:hover img{transform: scale(1.05);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.18))}
  
/* nav list */
.nav-list{
  list-style: none;
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: space-between;
}

/* nav item */
.nav-item.active .nav-btn{color: var(--nav-btn-text-active)}

/* Inactive icon dimming */
.nav-item:not(.active) svg{opacity:.55}

/* nav button everything */
.nav-btn{
  min-width: 72px; height: 44px;
  padding: 0 12px;
  display:grid;place-content:center;
  color: var(--nav-button-text);
  background: transparent;
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; letter-spacing: .6px; font-size: .85rem;
  border-radius: 12px;
  cursor: pointer;
  transition: color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.nav-btn:hover{
  color: var(--nav-btn-text-active);
  background: var(--nav-btn-hover-bg);
  box-shadow: inset 0 0 0 1px var(--nav-btn-hover-border);
  transform: translateY(-1px);
}

.nav-btn:active{
  transform: scale(.98);
  background: var(--nav-btn-press-bg);
}

.nav-btn:focus-visible{outline:2px solid var(--nav-btn-focus-ring);
  outline-offset:3px}

/* Click ripple effect */
.nav-btn .ripple{
  position: absolute;
  left: 0; top: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--nav-ripple);
  pointer-events: none;
  animation: ripple .55s ease-out forwards;
}

@keyframes ripple{
  0%{transform: translate(-50%, -50%) scale(0); opacity:.35}
  100%{transform: translate(-50%, -50%) scale(12); opacity:0}
}

/* ==================== */
/* RESPONSIVE DESIGN */
/* ==================== */

/* LARGE SCREENS: >= 1024px (Desktop, MacBooks) */
@media (min-width: 1024px) {
  .nav {
    padding: 10px 14px;
    gap: 14px;
    border-radius: 16px;
  }

  .nav img {
    height: 34px;
  }

  .nav-btn {
    min-width: 72px;
    height: 44px;
    padding: 0 12px;
    font-size: 0.85rem;
    border-radius: 12px;
  }
}

/* TABLETS: 768px - 1023px */
@media (max-width: 1023px) and (min-width: 768px) {
  .nav {
    padding: 8px 12px;
    gap: 10px;
    border-radius: 14px;
    width: max-content;
    max-width: calc(100% - 16px);
  }

  .nav img {
    height: 30px;
  }

  .nav-list {
    gap: 10px;
  }

  .nav-btn {
    min-width: 60px;
    height: 40px;
    padding: 0 10px;
    font-size: 0.75rem;
    border-radius: 10px;
  }

  .nav-btn:focus-visible {
    outline-offset: 2px;
  }
}

/* LANDSCAPE TABLETS: 600px - 767px */
@media (max-width: 767px) and (min-width: 600px) {
  .nav {
    padding: 7px 10px;
    gap: 8px;
    border-radius: 12px;
    max-width: calc(100% - 14px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .nav img {
    height: 28px;
    flex-shrink: 0;
  }

  .nav-list {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .nav-btn {
    min-width: 54px;
    height: 38px;
    padding: 0 8px;
    font-size: 0.7rem;
    letter-spacing: 0.4px;
    border-radius: 9px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-btn:hover {
    transform: translateY(-1px);
  }
}

/* MOBILE: 480px - 599px */
@media (max-width: 599px) and (min-width: 480px) {
  .nav {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 10px;
    max-width: calc(100% - 12px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .nav img {
    height: 24px;
    flex-shrink: 0;
  }

  .nav-list {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .nav-btn {
    min-width: 48px;
    height: 36px;
    padding: 0 6px;
    font-size: 0.65rem;
    letter-spacing: 0.3px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-btn .ripple {
    width: 8px;
    height: 8px;
  }
}

/* SMALL MOBILE: < 480px */
@media (max-width: 479px) {
  .nav {
    padding: 5px 6px;
    gap: 4px;
    border-radius: 8px;
    max-width: calc(100% - 10px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    top: max(8px, env(safe-area-inset-top) + 4px);
  }

  .nav img {
    height: 20px;
    flex-shrink: 0;
  }

  .nav-list {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .nav-item {
    flex-shrink: 0;
  }

  .nav-btn {
    min-width: 42px;
    height: 32px;
    padding: 0 5px;
    font-size: 0.6rem;
    letter-spacing: 0.2px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-btn .ripple {
    width: 6px;
    height: 6px;
  }

  .nav-btn:hover {
    box-shadow: inset 0 0 0 1px var(--nav-btn-hover-border);
  }
}
