/* Wireframe structure, using the shared brand-book fonts and colours. */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-container {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

main.page-container {
  flex: 1;
  padding-block: 2rem;
}

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--color-sky-blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--surface);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header p, .site-footer p, .site-footer h2 {
  margin: 0;
}

.site-header a, .site-footer a {
  text-decoration: none;
}

.site-header a:hover, .site-footer a:hover {
  text-decoration: underline;
}

.utility-bar, .desktop-navigation, .navbar .desktop-order-link {
  display: none;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 4.625rem;
  padding: 0.75rem 1rem;
}

.brand-link {
  display: inline-flex;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 151px;
  height: 50px;
  object-fit: contain;
}

.brand-logo-dark, :root[data-theme="dark"] .brand-logo-light {
  display: none;
}

:root[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-picker {
  position: relative;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  list-style: none;
  cursor: pointer;
}

.theme-toggle::-webkit-details-marker {
  display: none;
}

.theme-toggle:hover, .theme-picker[open] .theme-toggle {
  background: var(--surface-tint);
}

.theme-icon {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.theme-options {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 10rem;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.theme-options legend {
  padding: 0;
  float: left;
  width: 100%;
  padding: 0.5rem;
  color: var(--color-slate);
  font-size: var(--text-caption);
}

.theme-options label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding-inline: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.theme-options label:hover {
  background: var(--surface-tint);
}

.theme-options input {
  accent-color: var(--action-background);
}

@media (max-width: 24rem) {
  .navbar .brand-logo {
    width: 130px;
    height: 43px;
  }
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
}

.cart-link img, .menu-toggle img, .navigation-chevron {
  display: block;
  flex-shrink: 0;
}

.cart-count {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--action-background);
  color: var(--color-white);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.125rem;
}

.menu-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  cursor: pointer;
  list-style: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle .menu-icon-close, .mobile-menu[open] .menu-icon-open {
  display: none;
}

.mobile-menu[open] .menu-icon-close {
  display: block;
}

.mobile-navigation {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: max(0px, calc(100dvh - var(--navigation-top, 0px)));
  overflow-y: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--color-border);
}

.mobile-navigation ul, .desktop-navigation ul, .policy-links {
  padding: 0;
  margin: 0;
  list-style: none;
}

.mobile-navigation .mobile-navigation-links {
  padding: 0.5rem 1.25rem 0;
}

.mobile-navigation-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.mobile-menu-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

.mobile-menu-contact .primary-link {
  width: 100%;
}

.mobile-menu-contact p {
  color: var(--color-slate);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

.site-footer {
  background: var(--color-deep-navy);
  color: var(--color-white);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

.site-footer a {
  color: inherit;
}

.footer-inner {
  padding-block: 2.5rem 2rem;
}

.footer-columns {
  display: grid;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  color: var(--color-ice-blue);
}

.footer-brand .brand-link {
  padding-inline: 4px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer-section h2 {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: var(--leading-small);
  color: var(--color-ice-blue);
}

.footer-section address {
  display: grid;
  gap: 0.5rem;
  font-style: normal;
}

.footer-section a {
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-top: 1px solid var(--color-slate);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.policy-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
  row-gap: 0.75rem;
}

.footer-copyright {
  color: var(--color-ice-blue);
  font-size: 0.75rem;
  line-height: 1rem;
}

@media (min-width: 48rem) {
  main.page-container {
    padding-block: 3rem;
  }

}

@media (min-width: 64rem) {
  .footer-inner {
    padding-block: 3.5rem 2.5rem;
  }

  .footer-columns {
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
  }

  .policy-links {
    column-gap: 1.75rem;
  }

}

/* Keep the mobile menu until the full navigation fits comfortably. */
@media (min-width: 80rem) {
  .navbar-actions {
    gap: 1.25rem;
  }

  .utility-bar {
    display: block;
    background: var(--surface-tint);
    color: var(--text-color);
    font-size: 0.75rem;
    line-height: 1rem;
  }

  .utility-bar-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.5rem;
  }

  .utility-bar a {
    color: inherit;
  }

  .navbar {
    padding-block: 1rem;
    padding-inline: 5rem;
    gap: 1.5rem;
  }

  .mobile-menu {
    display: none;
  }

  .desktop-navigation {
    display: block;
  }

  .desktop-navigation ul {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: var(--text-small);
    line-height: var(--leading-small);
    white-space: nowrap;
  }

  .desktop-navigation .navigation-chevron {
    display: none;
  }

  .navbar .desktop-order-link {
    display: inline-flex;
    white-space: nowrap;
  }

}
