.dbc-mobile-bottom-nav {
  display: none;
}

/* Mobile only — mirrors DBC_BP_MOBILE (767px) in dbc-breakpoints.php.
 * Tablets (768px+) show the regular top nav, not the bottom bar. */
@media (max-width: 767px) {
  body.dbc-mobile-search-open {
    overflow: hidden;
  }

  body.has-dbc-mobile-bottom-nav {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .dbc-mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9500;
    display: block;
    pointer-events: none;
  }

  .dbc-mobile-bottom-nav__shell {
    position: relative;
    padding: 0 0 env(safe-area-inset-bottom);
    pointer-events: none;
  }

  .dbc-mobile-bottom-nav__bar,
  .dbc-mobile-bottom-nav__submenu,
  .dbc-mobile-bottom-nav__search-panel {
    pointer-events: auto;
  }

  .dbc-mobile-bottom-nav__bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    padding: 0;
    background: rgba(20, 23, 28, 0.98);
    border: 0;
    border-top: 1px solid rgba(74, 77, 83, 0.9);
    border-radius: 0;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
  }

  .dbc-mobile-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 7px 0;
    color: #d5d9e0;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .dbc-mobile-bottom-nav__item:hover,
  .dbc-mobile-bottom-nav__item:focus-visible {
    color: #fff;
    background: #2a2d33;
    outline: none;
  }

  .dbc-mobile-bottom-nav__item.is-active,
  .dbc-mobile-bottom-nav.is-open [data-dbc-mobile-nav-toggle],
  .dbc-mobile-bottom-nav.is-search-open [data-dbc-mobile-search-toggle] {
    color: #fff;
    background: #2a2d33;
  }

  .dbc-mobile-bottom-nav__icon,
  .dbc-mobile-bottom-nav__submenu-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: inherit;
  }

  .dbc-mobile-bottom-nav__icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Explore submenu: compact row icons + text aligned to bar label size */
  .dbc-mobile-bottom-nav__submenu-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Filled icons (Explore compass, Dashboard): bar CSS uses stroke + fill:none — override */
  .dbc-mobile-bottom-nav__icon svg.dbc-mnav-svg--fill {
    fill: currentColor;
    stroke: none;
    width: 26px;
    height: 26px;
    margin-top: 1px;
  }

  .dbc-mobile-bottom-nav__submenu-icon svg.dbc-mnav-svg--fill {
    fill: currentColor;
    stroke: none;
    width: 18px;
    height: 18px;
    margin-top: 0;
  }

  .dbc-mobile-bottom-nav__label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
  }

  /* Explore: sheet above bar — width set in JS to match Explore button (box-sizing includes border) */
  .dbc-mobile-bottom-nav__submenu {
    position: absolute;
    right: 0;
    bottom: calc(100% + env(safe-area-inset-bottom));
    left: auto;
    box-sizing: border-box;
    width: 25%;
    max-width: none;
    min-width: 0;
    padding: 0;
    overflow: visible;
    background: #2a2d33;
    border: 1px solid rgba(74, 77, 83, 0.95);
    border-bottom: 0;
    border-radius: 0;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.38);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.28s;
  }

  .dbc-mobile-bottom-nav.is-open .dbc-mobile-bottom-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
      opacity 0.22s ease,
      transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s;
  }

  .dbc-mobile-bottom-nav__submenu-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .dbc-mobile-bottom-nav__submenu-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    gap: 4px;
    padding: 6px 5px 6px 3px;
    color: #d5d9e0;
    text-decoration: none;
    background: #14171c;
    border: 0;
    border-bottom: 1px solid rgba(74, 77, 83, 0.45);
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    transition:
      background-color 0.16s ease,
      color 0.16s ease;
  }

  .dbc-mobile-bottom-nav__submenu-link:last-child {
    border-bottom: 0;
  }

  .dbc-mobile-bottom-nav__submenu-link:hover,
  .dbc-mobile-bottom-nav__submenu-link:focus-visible {
    background: #1c2128;
    color: #fff;
    outline: none;
  }

  /* Current explore page: same family as main bar active pill (not flat gray slab) */
  .dbc-mobile-bottom-nav__submenu-link.is-active {
    background: #2a2d33;
    color: #fff;
  }

  .dbc-mobile-bottom-nav__submenu-link.is-active:hover,
  .dbc-mobile-bottom-nav__submenu-link.is-active:focus-visible {
    background: #32363d;
  }

  .dbc-mobile-bottom-nav__submenu-link:active {
    background: #252a32;
  }

  .dbc-mobile-bottom-nav__submenu-link.is-active:active {
    background: #2f333a;
  }

  .dbc-mobile-bottom-nav__submenu-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .dbc-mobile-bottom-nav__search-panel {
    position: fixed;
    inset: 0;
    z-index: 1;
  }

  .dbc-mobile-bottom-nav__search-panel[hidden] {
    display: none;
  }

  .dbc-mobile-bottom-nav__search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.62);
    backdrop-filter: blur(4px);
  }

  .dbc-mobile-bottom-nav__search-surface {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: calc(60px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 12px 12px 0;
    background: linear-gradient(180deg, rgba(20, 23, 28, 0.98) 0%, rgba(20, 23, 28, 0.96) 100%);
  }

  .dbc-mobile-bottom-nav__search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .dbc-mobile-bottom-nav__search-title {
    font-size: 15px;
    font-weight: 700;
    color: #eef1f4;
  }

  .dbc-mobile-bottom-nav__search-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(74, 77, 83, 0.9);
    border-radius: 8px;
    background: #2a2d33;
    color: #eef1f4;
    font: inherit;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .dbc-mobile-bottom-nav__search-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    font-size: 14px;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-input-wrapper {
    border-color: rgba(20, 23, 28, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    min-height: 35px;
    height: 35px;
    box-sizing: border-box;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-input-wrapper:focus-within {
    border-color: rgba(20, 23, 28, 0.22) !important;
    background: #fff;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-input {
    min-height: 35px;
    height: 100%;
    padding: 7px 12px !important;
    font-size: 13px !important;
    color: #000;
    box-sizing: border-box;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-input::placeholder {
    color: rgba(0, 0, 0, 0.48);
    font-size: 13px !important;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-submit,
  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-mic {
    color: rgba(0, 0, 0, 0.58);
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-submit svg,
  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-mic svg {
    width: 22px;
    height: 22px;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-results {
    position: static;
    right: auto;
    left: auto;
    margin-top: 12px;
    max-height: none;
    flex: 1 1 auto;
    border-color: #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-results.dbc-results-visible {
    display: block;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-results-subtitle-wrapper {
    border-bottom-color: #e0e0e0;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-results-subtitle {
    color: #666;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-book-title,
  .dbc-mobile-bottom-nav__search-body .dbc-search-person-name,
  .dbc-mobile-bottom-nav__search-body .dbc-trending-term {
    color: #333;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-rating-number {
    color: #000;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-book-authors,
  .dbc-mobile-bottom-nav__search-body .dbc-search-book-description,
  .dbc-mobile-bottom-nav__search-body .dbc-search-person-type,
  .dbc-mobile-bottom-nav__search-body .dbc-search-loading,
  .dbc-mobile-bottom-nav__search-body .dbc-search-no-results,
  .dbc-mobile-bottom-nav__search-body .dbc-search-error {
    color: #666;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-book-description {
    color: #000;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-result-book,
  .dbc-mobile-bottom-nav__search-body .dbc-search-result-person,
  .dbc-mobile-bottom-nav__search-body .dbc-trending-search-item {
    background: transparent;
    box-shadow: none;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-result-book {
    padding: 12px 0;
    margin: 0;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-result-person {
    padding: 12px 14px;
    margin: 0;
    border-radius: 12px;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-trending-search-item {
    margin-bottom: 0;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-results .dbc-search-book-cover,
  .dbc-mobile-bottom-nav__search-body .dbc-searchbar-results .dbc-search-book-cover img {
    border-radius: 0 8px 8px 0 !important;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-result-book:hover,
  .dbc-mobile-bottom-nav__search-body .dbc-search-result-person:hover,
  .dbc-mobile-bottom-nav__search-body .dbc-trending-search-item:hover,
  .dbc-mobile-bottom-nav__search-body .dbc-search-result-selected {
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: none;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-header-button {
    color: #999;
  }

  /* Match desktop .dbc-search-see-all (dbc-searchbar.css) */
  .dbc-mobile-bottom-nav__search-body .dbc-search-see-all {
    background: #14171c;
    border-top: 1px solid #1a252f;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-see-all-link {
    color: #fff;
  }

  .dbc-mobile-bottom-nav__search-body .dbc-search-see-all-link:hover,
  .dbc-mobile-bottom-nav__search-body .dbc-search-see-all-link:focus-visible {
    color: #fff;
    background: #000;
    text-decoration: underline;
    outline: none;
  }
}
