html {
  margin: auto;
  line-height: 1.75;
  font-size: var(--font-size-root);
}

body {
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-weight: 400;
  color: #1d1d1d;
  background-color: var(--surface);
  min-height: calc(100dvh - var(--header-height));
  padding-left: var(--gutter-padding);
  padding-right: var(--gutter-padding);
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: 1fr;
}

header {
  position: fixed;
  background-color: var(--highest-surface);
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 1000;
  padding: 0 var(--gutter-padding);
}

.header-logo {
  font-family: sans-serif;
  font-weight: 800;
  font-size: 2rem;
}

.header-button {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
}

.header-button--left {
  justify-self: start;
  cursor: e-resize;
}

.header-button--right {
  justify-self: end;
  cursor: w-resize;
}

.header-logo { display: block; }

main {
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 2rem;
}


.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  overflow-y: auto;
}

.product-grid__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  position: relative;
}

.product-grid__item-image-wrapper {
  display: grid;
  grid-template-areas: "item";
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-grid__item-image,
.product-grid__item-top-left,
.product-grid__item-top-right {
  grid-area: item;
}

.product-grid__item-top-left {
  align-items: self-start;
  justify-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem 0rem;
  padding: 0.5rem 0rem 0rem 0.5rem;
  max-width: 30%;
  min-width: 0;
}

.product-grid__item-top-right {
  align-items: self-end;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 0.5rem 0rem;
  padding: 0.5rem 0.5rem 0rem 0rem;
  max-width: 70%;
  min-width: 0;
}

.product-grid__item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-grid__item-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.2rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.product-grid__item-sku {
  font-weight: 800;
  padding: 0.2rem 0.4rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  max-width: fit-content;
}

.product-grid__item-button {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
}

.product-detail {
  margin-left: var(--sidebar-width);
  padding: 2rem var(--sidebar-width) 2rem;
}

.product-detail__item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  justify-items: center;
  align-items: start;
}

.product-detail__item-image-wrapper {
  position: relative;
  max-height: 800px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-detail__item-info {
  width: 100%;
}

.product-detail__item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title {
  text-align: center;
  font-size: 1.5rem;
}

.product-detail table {
  width: 100%;
  margin-top: 2rem;
}

.product-detail thead {
  display: none;
}


.product-detail tbody th {
  text-align: right;
}

.product-detail tbody td {
  font-weight: 800;
}

.product-detail tbody th,
.product-detail tbody td {
  padding: .5rem;
  width: 50%;
}

.main-narrow {
  max-width: 70ch;
  margin: 0 auto;
}

.aside-left,
.aside-right {
  background-color: var(--highest-surface);
  position: fixed;
  top: 0;
  height: 100dvh;
  width: var(--aside-width);
  z-index: 1100;
  overflow: auto;
  display: block;
  padding: 0 var(--gutter-padding);
}


.aside-left { left: 0;  transform: translateX(-100%); }
.aside-right { right: 0; transform: translateX(100%); }

.aside-left.is-open { transform: translateX(0); }
.aside-right.is-open { transform: translateX(0); }

.aside-header-rail {
  height: var(--header-height);
  display: flex;
}

aside#left-panel div.aside-header-rail {
  justify-content: flex-end;
}

aside#right-panel div.aside-header-rail {
  justify-content: flex-start;
}

.backdrop[hidden] { display: none; }
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1050;
}

.aside-close-button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: w-resize;
}

small {
  font-size: .875rem;
}

footer {
  height: calc(100dvh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: stretch;
  border-top: 1px solid #dadce0;
  width: 85vw;
  margin: 0 auto;
}

aside nav ul,
nav ul,
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #333;
}

header a:hover,
.product-grid a:hover {
  text-decoration: none;
}

header a,
header a:visited,
.product-grid a,
.product-grid a:visited,
aside nav ul a,
aside nav ul a:visited,
footer li a,
footer li a:visited {
  color: #333;
}

.footer-content {
  display: grid;
  gap: 2rem;
  justify-content: space-evenly; 
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.footer-copyright {
  text-align: center;
}

.footer-column {}

.footer-column li {
  margin: 1rem 0;
}

.footer-column-header {
  margin: 1rem 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: gray;
}


h1,h2,h3,h4,h5,h6 {
  margin: 3rem 0 1rem;
}

ul {
  list-style-type: circle;
  list-style-position: inside;
  padding: 1.125rem;
}

li {
  margin: 0.5rem;
}

p,ul,ol {
  margin-bottom: 2rem;
}

em {
  font-style: italic;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: var(--font-size-h4);
}

a {
  text-decoration: none;
  color: blue;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: blue;
}

@media (max-width: 768px) {
  footer > .footer-content > *:nth-child(n+5) {
    display: none;
  }

  .product-detail__item {
    grid-template-columns: 1fr;
  }
}
