.pill-nav-container {
  position: fixed;
  top: 1em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #000;
  border-radius: 9999px;
  padding: 0.5em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .pill-nav-container {
    width: 100%;
    left: 0;
    transform: none;
    border-radius: 0;
    padding: 0.75em 0;
    top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

.pill-nav {
  --nav-h: 42px;
  --logo: 36px;
  --pill-pad-x: 18px;
  --pill-gap: 3px;
  width: max-content;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .pill-nav {
    width: 100%;
    justify-content: space-between;
    padding: 0 1rem;
    background: #000;
  }
}

.pill-nav-items {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  background: #000;
  border-radius: 9999px;
}

.pill-logo {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--base, #000);
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: 12px;
}

.pill-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: var(--pill-gap);
  margin: 0;
  padding: 3px;
  height: 100%;
  background: #000;
  border-radius: 9999px;
}

.pill-list > li {
  display: flex;
  height: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 var(--pill-pad-x);
  background: var(--pill-bg, #fff);
  color: var(--pill-text, var(--base, #000));
  text-decoration: none;
  border-radius: 9999px;
  box-sizing: border-box;
  font-weight: 600;
  font-size: 16px;
  line-height: 0;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pill .hover-circle {
  position: absolute;
  left: 50%;
  bottom: 0;
  border-radius: 50%;
  background: var(--base, #000);
  z-index: 1;
  display: block;
  pointer-events: none;
  will-change: transform;
}

.pill .label-stack {
  position: relative;
  display: inline-block;
  line-height: 1;
  z-index: 2;
}

.pill .pill-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  line-height: 1;
  will-change: transform;
}

.pill .pill-label-hover {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--hover-text, #fff);
  z-index: 3;
  display: inline-block;
  will-change: transform, opacity;
}

.pill.is-active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--base, #000);
  border-radius: 50px;
  z-index: 4;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }
}

.mobile-menu-button {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--base, #000);
  border: none;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  position: relative;
}

@media (max-width: 768px) {
  .mobile-menu-button {
    display: flex;
  }
}

.hamburger-line {
  width: 16px;
  height: 2px;
  background: var(--pill-bg, #fff);
  border-radius: 1px;
  transition: all 0.01s ease;
  transform-origin: center;
}

.mobile-menu-popover {
  position: absolute;
  top: 3em;
  left: 1rem;
  right: 1rem;
  background: #000;
  border-radius: 27px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 998;
  opacity: 0;
  transform-origin: top center;
  visibility: hidden;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #000;
  border-radius: 27px;
}

.mobile-menu-popover .mobile-menu-link {
  display: block;
  padding: 12px 16px;
  color: var(--pill-text, #fff);
  background-color: var(--pill-bg, #fff);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-radius: 50px;
  transition: all 0.2s ease;
}

.mobile-menu-popover .mobile-menu-link:hover {
  cursor: pointer;
  background-color: var(--base);
  color: var(--hover-text, #fff);
}

.mobile-menu-popover .mobile-menu-link.is-active {
  background-color: var(--base);
  color: var(--hover-text, #fff);
}

/* Bottom Navigation Bar untuk Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  height: 70px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #666;
  font-size: 9px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 4px 4px;
  flex: 1;
  max-width: 65px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.bottom-nav-item i {
  font-size: 18px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
}

.bottom-nav-item span {
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

/* Item tengah (Menu Toggle) - Lebih besar */
.bottom-nav-menu-toggle {
  flex: 0 0 auto;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff !important;
  margin-top: -18px;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
  position: relative;
  z-index: 10000;
}

.bottom-nav-menu-toggle i {
  font-size: 22px;
  margin-bottom: 0;
  color: #fff !important;
}

.bottom-nav-menu-toggle span {
  font-size: 8px;
  color: #fff !important;
  margin-top: 2px;
}

.bottom-nav-menu-toggle.active {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
  transform: rotate(90deg);
}

.bottom-nav-item.active {
  color: #dc3545;
}

.bottom-nav-item.active i {
  color: #dc3545;
  transform: scale(1.1);
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

.bottom-nav-item:hover {
  color: #dc3545;
}

.bottom-nav-menu-toggle:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
  transform: scale(1.05);
}

/* Bottom Nav Menu Popover */
.bottom-nav-menu-popover {
  position: fixed;
  bottom: 70px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 60vh;
  overflow-y: auto;
}

.bottom-nav-menu-popover.show {
  transform: translateY(0);
}

.bottom-nav-menu-content {
  padding: 1rem;
}

.bottom-nav-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.bottom-nav-menu-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.bottom-nav-menu-close {
  background: transparent;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.bottom-nav-menu-close:hover {
  background: #f0f0f0;
  color: #dc3545;
}

.bottom-nav-menu-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.bottom-nav-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.bottom-nav-menu-item i {
  font-size: 24px;
  margin-bottom: 0.5rem;
  color: #dc3545;
}

.bottom-nav-menu-item span {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.bottom-nav-menu-item:hover {
  background: #fff;
  border-color: #dc3545;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
  color: #dc3545;
  text-decoration: none;
}

.bottom-nav-menu-item.active {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.bottom-nav-menu-item.active i {
  color: #fff;
}

.bottom-nav-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 70px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.bottom-nav-menu-overlay.show {
  pointer-events: auto;
}

.bottom-nav-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Sembunyikan top nav di mobile */
@media (max-width: 768px) {
  .pill-nav-container {
    display: none;
  }
  
  .header-spacer.mobile-only {
    display: block;
  }
  
  .header-spacer.desktop-only {
    display: none;
  }
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
  
  .header-spacer.mobile-only {
    display: none;
  }
  
  .header-spacer.desktop-only {
    display: block;
  }
  
  body {
    padding-bottom: 0;
  }
}

