/* ==========================================================================
   NAVBAR.CSS — Header, sub-bar, search widget, mobile overlay
   ========================================================================== */


/* ==========================================================================
   TOP BAR & MAIN NAV LAYOUT
   ========================================================================== */

.top-bar {
  background: #f3f8ff;
}

.main-nav {
  background: var(--color-white);
}

.main-nav__links {
  position: relative;
}

/* Sliding indicator pill */
.main-nav__links .nav-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: #e6007e;
  border-radius: 2px;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  pointer-events: none;
  opacity: 0;
}
.main-nav__links .nav-indicator.visible { opacity: 1; }

.main-nav__links .wp-block-navigation-item__content {
  font-size: 14px;
  color: #001b2f;
  padding: 8px 12px;
  transition: color 0.15s;
}

/* Maintain pink color while hovering in the sub-bar */
.main-nav__links .wp-block-navigation-item.nav-item--active > .wp-block-navigation-item__content,
.main-nav__links .wp-block-navigation-item:hover > .wp-block-navigation-item__content {
    color: #e6007e;
}


/* ==========================================================================
   SUB-BAR
   ========================================================================== */

.sub-bar {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
  background: #f3f8ff;
}
.sub-bar.has-active-panel {
  border-top: 1px solid #e0e8f0;
  border-bottom: 1px solid #e0e8f0;
  max-height: 60px;
}

.sub-bar__panel {
  display: none !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
}
.sub-bar__panel.is-active {
  display: flex !important;
  animation: subBarIn 0.15s ease;
}

.sub-bar__label {
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid #ccd8e4;
  margin-right: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #001b2f;
}

.sub-bar .wp-block-navigation__container { gap: 0; }
.sub-bar .wp-block-navigation-item__content {
  padding: 12px 14px;
  font-size: 14px;
  color: #001b2f;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.sub-bar .wp-block-navigation-item__content:hover {
  color: #e6007e;
  border-bottom-color: #e6007e;
}
.sub-bar .current-menu-item .wp-block-navigation-item__content {
  color: #e6007e;
  border-bottom-color: #e6007e;
  font-weight: 500;
}

@keyframes subBarIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1140px) {
  .sub-bar { display: none !important; }
}


/* ==========================================================================
   DESKTOP SEARCH WIDGET
   ========================================================================== */

.custom-search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.custom-search-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #001B2F;
}
.custom-search-toggle:hover { opacity: 0.7; }

.custom-search-container { position: relative; }

.custom-search-inner {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  border: 1px solid rgba(0,0,0,0.10);
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  width: 0;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.custom-search-inner.open {
  width: 260px;
  opacity: 1;
  margin-left: 6px;
}
.custom-search-inner.open:focus-within {
  border-color: rgba(0,117,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,117,255,0.15);
}

.custom-search-input {
  width: 100% !important;
  opacity: 1 !important;
  padding: 7px 12px !important;
  margin-left: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: #001B2F;
  font-size: 13px;
  outline: none;
  flex: 1;
}
.custom-search-input::placeholder { color: #aab4be; }

.custom-search-wrapper .custom-search-filter,
.custom-search-wrapper select.custom-search-filter {
  border: none !important;
  border-left: 1px solid rgba(0,0,0,0.08) !important;
  background: transparent !important;
  color: #0075FF !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: 'Open Sans', sans-serif !important;
  padding: 7px 8px !important;
  cursor: pointer !important;
  outline: none !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.custom-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  overflow: hidden;
  display: none;
  z-index: 9999;
}
.custom-search-results.open { display: block; }

/* Hide desktop search on mobile */
@media only screen and (max-width: 1140px) {
  .custom-search-wrapper { display: none; }
}


/* ==========================================================================
   SHARED RESULT STYLES
   ========================================================================== */

.custom-search-result-item {
  display: block;
  padding: 11px 16px;
  text-decoration: none;
  color: #001B2F;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s ease;
}
.custom-search-result-item:last-child { border-bottom: none; }
.custom-search-result-item:hover { background: #F3F8FF; color: #0075FF; }

.custom-search-no-results,
.custom-search-loading {
  padding: 14px 16px;
  font-size: 13px;
  color: rgba(0,0,0,0.45);
  text-align: center;
}

.search-result-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0075FF;
  padding: 10px 16px 4px;
  background: #f3f8ff;
  border-bottom: 1px solid rgba(0,117,255,0.08);
}
.search-result-group:not(:first-child) .search-result-group-label {
  border-top: 1px solid rgba(0,0,0,0.06);
}


/* ==========================================================================
   MOBILE SEARCH BUTTON
   ========================================================================== */

.mobile-search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #001B2F;
}

/* Hide on desktop */
@media only screen and (min-width: 1141px) {
  .mobile-search-btn { display: none !important; }
}


/* ==========================================================================
   MOBILE SEARCH OVERLAY
   ========================================================================== */

.custom-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 27, 47, 0.6);
  z-index: 99998;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.custom-search-overlay.open { display: flex; }

/* Never show on desktop */
@media only screen and (min-width: 1141px) {
  .custom-search-overlay { display: none !important; }
}

.custom-search-overlay-inner {
  background: white;
  border-radius: 16px;
  width: calc(100% - 40px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.custom-search-overlay-bar {
  display: flex;
  align-items: center;
  padding: 4px 4px 4px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.custom-search-overlay-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #001B2F;
  font-family: 'Open Sans', sans-serif;
  padding: 10px 0;
  background: transparent;
}
.custom-search-overlay-input::placeholder { color: #aab4be; }

.custom-search-overlay-filter {
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  color: #0075FF;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
  padding: 10px;
  outline: none;
  cursor: pointer;
}

.custom-search-overlay-close {
  background: #f3f8ff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 18px;
  color: #556981;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-search-overlay-results {
  max-height: 60vh;
  overflow-y: auto;
}
.custom-search-overlay-results .custom-search-result-item {
  padding: 14px 16px;
  font-size: 14px;
}
.custom-search-overlay-results .custom-search-no-results,
.custom-search-overlay-results .custom-search-loading {
  padding: 20px 16px;
  font-size: 14px;
}

/* Container must be relative to anchor the absolute indicator */
.sub-bar__panel {
    position: relative;
    /* ... your existing styles ... */
}

/* The indicator for the sub-bar */
.sub-bar__indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: #e6007e;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 0;
}
.sub-bar__indicator.visible { opacity: 1; }