/* Shared viewport and touch refinements; loaded after page styles. */
.products-mega__panel {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.products-mega__grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr);
}
.products-mega__grid > * {
  min-width: 0;
}
.products-mega__heading > a {
  white-space: normal;
}
.site-header .header-tools button,
.menu-btn {
  min-width: 44px;
  min-height: 44px;
}
.header-search input {
  min-width: 0;
}
.world-caption h3 {
  overflow-wrap: anywhere;
}
@media (min-width: 801px) and (max-width: 1100px) {
  .site-header .nav {
    gap: 14px;
  }
  .site-header .nav > nav {
    gap: 16px;
    font-size: 13px;
  }
  .products-mega__panel {
    padding: 20px;
  }
  .products-mega__grid {
    gap: 18px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
  .site-header .products-mega__feature {
    grid-column: 1/-1;
    min-height: 120px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  .products-mega__brands {
    padding-right: 18px;
  }
  .journal-hero-copy {
    width: 55%;
  }
  .journal-hero-copy h1 {
    font-size: 40px;
  }
  .journal-hero-copy p {
    font-size: 17px;
  }
}
@media (max-width: 800px) {
  .site-header .nav > nav.open {
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    max-width: 100vw;
  }
  .products-mega__panel {
    max-width: 100%;
    max-height: none;
    overflow: visible;
  }
  .products-mega__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .site-header .nav > nav > a,
  .products-mega > summary {
    min-height: 44px;
  }
  .shop-search input,
  .header-search input {
    font-size: 18px;
  }
  .filter-sidebar {
    max-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .filter-options label {
    min-height: 40px;
  }
  .filter-title button {
    min-width: 44px;
    min-height: 44px;
  }
  .gallery-filters button {
    min-height: 44px;
  }
  .gallery-buy {
    min-height: 38px;
  }
  .shop-card h2 {
    height: auto;
    min-height: 42px;
    overflow: visible;
    font-size: 15px;
  }
  .shop-card .card-brand {
    font-size: 12px;
  }
  .card-bottom {
    font-size: 13px;
    min-height: 38px;
    align-items: center;
  }
  .world-caption h3 {
    font-size: 18px;
  }
  .world-caption p {
    font-size: 14px;
  }
  .laguna-footer .footer-grid a {
    line-height: 2;
    min-height: 36px;
    display: block;
  }
  .journal-topics button {
    min-height: 40px;
  }
}
@media (max-width: 380px) {
  .journal-hero-copy h1 {
    font-size: 30px;
  }
  .journal-hero-copy p {
    font-size: 14px;
  }
  .journal-hero-copy small {
    letter-spacing: 1px;
  }
  .world-caption h3 {
    font-size: 16px;
  }
  .world-caption {
    padding-inline: 12px;
  }
  .header-search:not([hidden]) {
    width: calc(100% - 24px);
    gap: 8px;
  }
  .header-search .btn {
    padding-inline: 15px;
  }
}

/* Phone galleries wrap within the viewport instead of requiring sideways swipes. */
@media (max-width: 1100px) {
  .gallery-grid {
    gap: 12px;
  }
  .gallery-card {
    padding-inline: 8px;
  }
  .gallery-buy {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
  }
}
@media (max-width: 600px) {
  .category-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .category-row > a {
    min-width: 0;
  }
  .category-row .category-image {
    width: min(112px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
  .gallery-header,
  .gallery-grid,
  .gallery-filters {
    min-width: 0;
    max-width: 100%;
  }
  .gallery-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 2px 0 7px;
  }
  .gallery-filters button {
    min-width: 0;
    padding-inline: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 10px;
    padding: 2px 0 10px;
  }
  .gallery-card {
    min-width: 0;
  }
  .gallery-buy {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}
