/**
 * Mobile bottom navigation — Coo & Cry
 * Visible only at max-width: 960px (matches header nav-pill breakpoint).
 */

@media (max-width: 960px) {
  body.has-mobile-bottom-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-bottom-nav .footer {
    margin-bottom: 0;
  }
}

/* Hidden on desktop */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 960px) {
  .mobile-bottom-nav {
    display: block;
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 50;
    pointer-events: none;
  }

  .mobile-bottom-nav__inner {
    pointer-events: auto;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(247, 249, 253, 0.99), rgba(247, 249, 253, 0.96));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(148, 197, 233, 0.35);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav__item {
    flex: 1;
    min-width: 0;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #4b5563;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    position: relative;
  }

  .mobile-bottom-nav__item:hover,
  .mobile-bottom-nav__item:focus-visible {
    color: #0ea5e9;
    background: rgba(224, 242, 254, 0.65);
    outline: none;
  }

  .mobile-bottom-nav__item:active {
    transform: scale(0.96);
  }

  .mobile-bottom-nav__item.is-active {
    color: #0369a1;
    font-weight: 600;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon-wrap {
    background: radial-gradient(circle at 20% 0%, #eff6ff, #dbeafe);
    box-shadow: 0 8px 18px rgba(107, 184, 224, 0.22);
  }

  .mobile-bottom-nav__item.is-active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 22;
    color: #0369a1;
  }

  .mobile-bottom-nav__icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(186, 215, 238, 0.55);
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .mobile-bottom-nav__item .material-symbols-outlined {
    font-size: 22px;
    color: #0f172a;
    transition: color 0.2s ease;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 22;
  }

  .mobile-bottom-nav__label {
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* === Search overlay (shared with header search) === */
.mobile-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding: 96px 24px 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-search-overlay.is-open {
  display: flex;
  opacity: 1;
}

.mobile-search-panel {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(186, 215, 238, 0.9);
  padding: 20px;
  transform: translateY(-8px);
  transition: transform 0.25s ease;
}

.mobile-search-overlay.is-open .mobile-search-panel {
  transform: translateY(0);
}

.mobile-search-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mobile-search-panel__title {
  font-family: "Noto Serif", serif;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.mobile-search-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0f172a;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mobile-search-close:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
}

.mobile-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mobile-search-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 197, 233, 0.6);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: #181c1f;
  background: #f7f9fd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-search-form input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.mobile-search-form input::placeholder {
  color: #9ca3af;
}

.mobile-search-submit {
  flex-shrink: 0;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #6bb8e0, #1a68b0);
  color: #ffffff;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 12px 28px rgba(26, 104, 176, 0.35);
}

.mobile-search-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #83d0f9, #155a9a);
  box-shadow: 0 16px 34px rgba(26, 104, 176, 0.45);
}

@media (min-width: 961px) {
  .mobile-search-overlay {
    display: none !important;
  }
}
