/* Mobile hamburger menu
   Replaces the top text nav (and its "More" dropdown, which was causing
   horizontal overflow/scroll on small screens) with a hamburger button
   that opens a full-screen grid of every page. The old .main-nav is
   hidden on mobile in styles.css; this file handles the new layout. */

@media (max-width: 768px) {
  .main-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    column-gap: 8px;
    flex-wrap: nowrap;
  }

  .mobile-menu-toggle {
    grid-column: 1;
    justify-self: start;
  }

  .logo-container {
    grid-column: 2;
    justify-self: center;
    margin: 0;
  }

  .user-profile {
    grid-column: 3;
    justify-self: end;
    margin: 0;
  }
}

/* Hamburger button - hidden by default, shown only in the mobile layout above */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #7a6855;
  border-radius: 2px;
}

/* Full-screen grid menu overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 237, 228, 0.98);
  z-index: 3000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-menu-overlay.is-open {
  display: flex;
}

.mobile-menu-overlay-header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #7a6855;
  cursor: pointer;
  padding: 4px 10px;
}

.mobile-menu-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 8px 20px 40px;
  align-content: center;
}

.mobile-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #3e342a;
  padding: 18px 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.mobile-menu-item:active {
  background: #f0e9e2;
}

.mobile-menu-item.active {
  border: 2px solid #7a6855;
}

.mobile-menu-icon {
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}

.mobile-menu-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Make sure none of this leaks onto desktop */
@media (min-width: 769px) {
  .mobile-menu-toggle,
  .mobile-menu-overlay {
    display: none !important;
  }
}
