/* Header component responsive rules and off-canvas menu */

.navbar-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px;
  margin: 0;
  color: inherit;
}

/* Mobile first: hide desktop navs, show hamburger */
@media (max-width: 1023px) {
  .navbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: -1; /* ensure hamburger is leftmost */
    margin-right: 8px;
  }
  .left-nav { display: none; }
  .right-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto; /* push to the right */
  }
  .right-nav .currency-switcher { display: none; }
  .header-inner { justify-content: space-between; }
  .logo img {
    height: 16px; /* 50% of desktop size (32px) */
  }
  /* 20% smaller actions on mobile */
  #cart-btn svg {
    width: 16px;
    height: 16px;
  }
  #cart-btn {
    padding-right: 8px;
  }
  #header-login-btn {
    height: 32px;
    padding: 6px 10px;
    font-size: var(--text-sm, 14px);
    border-radius: 16px;
  }
}

/* Off-canvas menu */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 999;
}

.mobile-nav {
  position: fixed;
  top: 8px; /* stick to top with small inset for rounded corners */
  left: 8px;
  width: min(84vw, 360px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateX(calc(-100% - 8px)); /* fully off-screen including inset */
  transition: transform .25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 12px;
  padding-top: 12px; /* space for close button */
  max-height: calc(100dvh - 16px);
  overflow: auto;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
}

.mobile-close {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px;
  margin: 0;
  color: inherit;
  position: absolute;
  top: 6px;
  right: 6px;
}

.mobile-links {
  display: grid;
  gap: 8px;
  padding: 8px 2px 16px;
}

.mobile-currency {
  padding: 4px 2px 12px;
}

.mobile-meta {
  margin-top: auto;
  padding: 12px 4px 6px;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.mobile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Open states */
.mobile-nav.is-open {
  transform: translateX(0);
}
.mobile-nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Prevent background scroll when menu open */
body.nav-open {
  overflow: hidden;
}


