/* Global safety (required) */
*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Drawer is mobile-only */
.nav-drawer-overlay,
.nav-drawer {
  display: none;
}

.desktop-only {
  visibility: visible;
}

.site-header .mobile-menu-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  /* Main layout safety: keep content in flow on mobile */
  .site-main {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .site-main::after {
    content: "";
    display: block;
    clear: both;
  }

  .site-main > * {
    position: relative !important;
    max-width: 100%;
  }

  /* Hide desktop nav links area (required) */
  .site-header .main-nav {
    display: none !important;
  }

  /* Show hamburger (required) */
  .site-header .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
  }

  .site-header .mobile-menu-btn i,
  .site-header .mobile-menu-btn svg {
    pointer-events: none;
  }

  .nav-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 2000;
  }

  .nav-drawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(86vw, 320px);
    background: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 2001;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .nav-drawer__title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
  }

  .nav-drawer__close {
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .nav-drawer__nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
  }

  .nav-drawer__nav a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    overflow-wrap: anywhere;
  }

  .nav-drawer__nav a + a {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .nav-drawer__nav .nav-btn-header {
    margin: 12px 16px 0;
    text-align: center;
  }

  /* Footer: clean stacked layout + larger logo (mobile only) */
  .site-footer {
    position: relative !important;
    padding: 48px 0 24px !important;
    margin-top: 40px !important;
  }

  .site-footer .footer-logo {
    justify-content: center !important;
  }

  .site-footer .footer-logo-img {
    height: 72px !important;
    width: auto !important;
  }

  .site-footer .footer-content {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 28px !important;
    text-align: center;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 28px !important;
    text-align: center;
  }

  .site-footer .footer-links h4,
  .site-footer .footer-col h4 {
    font-size: 1rem !important;
    margin-bottom: 12px !important;
  }

  .site-footer .footer-links a,
  .site-footer .footer-col a,
  .site-footer .footer-links li a {
    font-size: 0.95rem !important;
  }

  .site-footer .footer-links li {
    margin-bottom: 10px !important;
  }

  .site-footer .footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px !important;
  }

  body.nav-drawer-open {
    overflow: hidden;
  }

  body.nav-drawer-open .nav-drawer-overlay {
    opacity: 1;
    visibility: visible;
  }

  body.nav-drawer-open .nav-drawer {
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .nav-drawer {
    width: min(92vw, 320px);
  }
}
