:root {
  --nav-accent: #d81b60;
  --nav-text: var(--text-main, var(--text, #333333));
  --nav-border: var(--border, #eeeeee);
  --nav-surface: rgba(255, 255, 255, 0.97);
}

nav {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--nav-surface);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(10px);
}

.nav-l1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 54px;
  width: 100%;
  padding: 0 10px;
  overflow-x: auto;
  white-space: nowrap;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 8px 0;
  padding: 0 16px;
  border-radius: 999px;
  color: #666666;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  background: transparent;
  font-family: inherit;
  line-height: 1;
  appearance: none;
}

nav .nav-item:hover {
  background: #f4f4f4;
  color: var(--nav-text);
}

nav .nav-item.active {
  background: #fff6fb;
  color: var(--nav-accent);
  box-shadow: inset 0 0 0 1px var(--nav-accent);
}

.dropdown-trigger.open {
  background: #fff6fb;
  color: var(--nav-accent);
  box-shadow: inset 0 0 0 1px var(--nav-accent);
}

nav.has-open-dropdown .nav-item.active,
nav.has-open-dropdown a.nav-item.active,
nav.has-open-dropdown button.nav-item.active {
  background: #fff6fb !important;
  color: var(--nav-accent) !important;
  box-shadow: inset 0 0 0 1px var(--nav-accent) !important;
}

nav.has-open-dropdown .dropdown-trigger.open,
nav.has-open-dropdown button.dropdown-trigger.open {
  background: #fff6fb !important;
  color: var(--nav-accent) !important;
  box-shadow: inset 0 0 0 1px var(--nav-accent) !important;
}

.nav-context {
  margin: 0 16px;
  padding: 14px 18px 16px;
  border-top: 1px solid #f6f1f4;
  border-bottom: 1px solid #f3edf0;
  background: linear-gradient(180deg, #fffdfd 0%, #fff8fb 100%);
  animation: nav-fade-in 0.18s ease-out;
}

.nav-context-eyebrow {
  margin-bottom: 6px;
  color: #967786;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-context-title {
  color: #33262d;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.nav-context-subtitle {
  margin-top: 4px;
  color: #544850;
  font-size: 14px;
  line-height: 1.55;
}

.nav-context-hint {
  margin-top: 8px;
  color: #8c7b84;
  font-size: 12px;
  line-height: 1.5;
}

.nav-context.theme-pricing {
  background: linear-gradient(180deg, #fffdfd 0%, #fff7fb 100%);
}

.nav-context.theme-compare {
  background: linear-gradient(180deg, #fcfdff 0%, #f4f8ff 100%);
}

.nav-context.theme-safety {
  background: linear-gradient(180deg, #fcfdfb 0%, #f3f9f3 100%);
}

.nav-context.theme-neutral {
  background: linear-gradient(180deg, #fefefe 0%, #f7f7f7 100%);
}

.nav-item.nav-highlight {
  color: var(--nav-accent);
}

.nav-item.nav-highlight.active {
  background: var(--nav-accent);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--nav-accent);
}

.nav-l2-wrapper {
  position: relative;
  background: linear-gradient(180deg, #fffdfd 0%, #fff6fa 100%);
  border-top: 1px solid #f1d9e3;
  border-bottom: 1px solid #f1d9e3;
  padding: 10px 10px 12px;
}

.nav-l2-title {
  margin: 0 4px 8px;
  color: #8d5b74;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-l2-bar {
  display: none;
  justify-content: center;
  padding: 0;
  gap: 10px;
  overflow-x: visible;
  white-space: normal;
  flex-wrap: wrap;
  -webkit-overflow-scrolling: touch;
  animation: nav-slide-down 0.18s ease-out;
}

.nav-l2-bar.show {
  display: flex;
}

.sub-item {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #ebc8d8;
  background: #ffffff;
  color: #5a4350;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

nav .sub-item:hover {
  background: #ffe8f3 !important;
  border-color: var(--nav-accent) !important;
  color: var(--nav-accent) !important;
}

nav .sub-item.active {
  background: linear-gradient(180deg, var(--nav-accent) 0%, #c31655 100%) !important;
  border-color: var(--nav-accent) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(216, 27, 96, 0.14);
}

.nav-l1::-webkit-scrollbar,
.nav-l2-bar::-webkit-scrollbar {
  display: none;
}

@keyframes nav-slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nav-fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .nav-l1 {
    justify-content: flex-start;
    gap: 2px;
    min-height: 50px;
    padding: 0 8px;
  }

  .nav-item {
    min-height: 40px;
    margin: 7px 0;
    padding: 0 14px;
    font-size: 14px;
  }

  .nav-l2-bar {
    justify-content: flex-start;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-l2-wrapper {
    padding: 10px 10px 10px;
  }

  .nav-l2-title {
    margin: 0 2px 8px;
    font-size: 11px;
  }

  .nav-context {
    margin: 0 10px;
    padding: 12px 14px 13px;
  }

  .nav-context-title {
    font-size: 17px;
  }

  .nav-context-subtitle {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.5;
  }

  .nav-context-hint {
    margin-top: 6px;
    font-size: 11px;
  }

  .sub-item {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
    line-height: 1;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .nav-l2-wrapper.has-active::after {
    content: "\5DE6\53F3\6ED1\52D5\67E5\770B\66F4\591A";
    position: absolute;
    right: 10px;
    bottom: 4px;
    padding-left: 18px;
    font-size: 11px;
    color: #9a9a9a;
    background: linear-gradient(
      90deg,
      rgba(252, 252, 252, 0) 0%,
      rgba(252, 252, 252, 0.92) 30%,
      rgba(252, 252, 252, 1) 100%
    );
    pointer-events: none;
  }
}

@media (min-width: 769px) {
  .nav-l1 {
    justify-content: center;
    overflow-x: visible;
  }

  .nav-context {
    margin: 0 auto;
    max-width: 980px;
  }
}
