/* LabKart — mobile UX + global touch polish */

/* Safe areas + tap comfort */
html {
  -webkit-tap-highlight-color: rgba(194, 160, 90, 0.18);
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 767px) {
  body {
    background-attachment: scroll;
  }

  body.has-mobile-nav {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }

  .container {
    padding-inline: max(0.85rem, env(safe-area-inset-left));
  }

  /* Header: compact, thumb-friendly */
  :root {
    --header-height: 3.65rem;
    --hp-edge: 0.85rem;
  }

  .site-header__inner {
    gap: 0.35rem;
    height: var(--header-height);
  }

  .logo__wordmark {
    font-size: 1.25rem;
  }

  .logo__mark {
    width: 1.85rem;
    height: 1.85rem;
  }

  .icon-btn {
    width: 2.65rem;
    height: 2.65rem;
  }

  .icon-btn--fav {
    display: none;
  }

  .menu-toggle {
    width: 2.65rem;
    height: 2.65rem;
  }

  /* Mobile search under header */
  .mobile-search {
    display: block;
    padding: 0 0.85rem 0.65rem;
    background: rgba(255, 253, 249, 0.95);
    border-bottom: 1px solid rgba(32, 28, 23, 0.05);
  }

  .mobile-search__form {
    position: relative;
    display: flex;
    align-items: center;
  }

  .mobile-search__icon {
    position: absolute;
    left: 0.9rem;
    width: 1.05rem;
    height: 1.05rem;
    color: var(--color-muted);
    pointer-events: none;
  }

  .mobile-search__input {
    width: 100%;
    height: 2.65rem;
    padding: 0 1rem 0 2.55rem;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid rgba(32, 28, 23, 0.08);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
  }

  .mobile-search__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(194, 160, 90, 0.18);
  }

  /* Drawer links: larger tap targets */
  .nav-drawer__links a {
    min-height: 2.85rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
  }

  /* Footer spacing */
  .site-footer {
    padding-block: 2.5rem 1.5rem;
  }

  .footer-grid {
    gap: 1.75rem;
  }
}

@media (min-width: 768px) {
  .mobile-search {
    display: none;
  }
}

/* Bottom mobile nav */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 253, 249, 0.94);
    border-top: 1px solid rgba(32, 28, 23, 0.08);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 -8px 24px rgba(32, 28, 23, 0.06);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 3.15rem;
    padding: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-muted);
    border-radius: 0.75rem;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  }

  .mobile-bottom-nav a svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .mobile-bottom-nav a[aria-current="page"],
  .mobile-bottom-nav a.is-active {
    color: var(--color-primary-dark);
    background: rgba(194, 160, 90, 0.12);
  }

  @media (prefers-reduced-motion: no-preference) {
    .mobile-bottom-nav a:active {
      transform: scale(0.96);
    }
  }
}

/* Active press feedback for buttons */
@media (prefers-reduced-motion: no-preference) {
  .btn:active,
  .btn-gold:active,
  .hero-slide__cta:active,
  .ad-btn:active {
    transform: scale(0.98);
  }
}
