.grid {
  display: grid;
  gap: var(--gap, 1rem);
  grid-template-columns: repeat(
    var(--grid-type, auto-fit),
    minmax(min(180px, 100%), 1fr)
  );
  grid-auto-rows: 120px auto auto;
  container-type: inline-size;
}

@layer general-styling {
  :root {
    --clr-primary-900: hsl(213.57, 23%, 8%);
    --clr-primary-800: hsl(219.57, 23%, 12%);
    --clr-primary-700: hsl(219.57, 23%, 18%);
    --clr-primary-600: hsl(219.57, 23%, 26%);
    --clr-primary-500: hsl(219.57, 23%, 32%);
    --clr-primary-400: hsl(219.57, 23%, 45%);
    --clr-primary-300: hsl(219.57, 23%, 65%);
    --clr-primary-200: hsl(219.57, 23%, 85%);
    --clr-primary-100: hsl(219.57, 23%, 92%);

    --clr-accent-600: hsl(196.57, 40%, 20%);
    --clr-accent-500: hsl(196.57, 40%, 32%);
    --clr-accent-400: hsl(196.57, 40%, 45%);
    --clr-accent-300: hsl(196.57, 40%, 58%);
    --clr-accent-200: hsl(196.57, 40%, 80%);
  }

  /* :root {
    --clr-primary-900: hsl(200, 23%, 8%);
    --clr-primary-800: hsl(206, 23%, 12%);
    --clr-primary-700: hsl(206, 23%, 18%);
    --clr-primary-600: hsl(206, 23%, 26%);
    --clr-primary-500: hsl(206, 23%, 32%);
    --clr-primary-400: hsl(206, 23%, 45%);
    --clr-primary-300: hsl(206, 23%, 65%);
    --clr-primary-200: hsl(206, 23%, 85%);
    --clr-primary-100: hsl(206, 23%, 92%);

    --clr-accent-600: hsl(183, 40%, 20%);
    --clr-accent-500: hsl(183, 40%, 32%);
    --clr-accent-400: hsl(183, 40%, 45%);
    --clr-accent-300: hsl(183, 40%, 58%);
    --clr-accent-200: hsl(183, 40%, 80%);
  } */

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    color-scheme: dark;
  }

  body {
    font-family: system-ui;
    line-height: 1.7;
    background: var(--clr-primary-900);
    color: var(--clr-primary-200);

    padding: 4rem 0;
  }

  img {
    max-width: 100%;
    display: block;
  }

  h1,
  h2,
  h3 {
    color: var(--clr-primary-100);
  }

  h1,
  h2 {
    line-height: 1.1;
  }

  h1 {
    font-size: clamp(2.75rem, 10vw - 1rem, 4.5rem);
  }

  h1 + div {
    font-size: 1.275rem;
    margin-block: 1rem 3.25rem;
  }

  h2 {
    padding-bottom: 1rem;
  }

  h3 {
    line-height: 1.35;
  }

  .wrapper {
    width: min(100% - 4rem, 85rem);
    margin-inline: auto;
  }

  .layout {
    display: grid;
    gap: 1rem;
    @media (width > 760px) {
      grid-template-columns: 1fr 240px;
    }
  }

  aside {
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--clr-primary-700);
  }

  .flex-group {
    display: flex;
    gap: 1rem;
  }

  .space-between {
    justify-content: space-between;
  }

  .v-center {
    align-items: end;
  }

  .button {
    font: inherit;
    line-height: 1;
    display: inline-flex;
    cursor: pointer;
    text-decoration: none;
    padding: 0.5em 1.25em 0.7em;
    border-radius: 0.25em;
    color: var(--button-color, var(--clr-primary-100));
  }

  .button[data-type="outline"] {
    --button-color: var(--clr-accent-300);

    font-weight: 700;
    background: transparent;
    border: 2px solid var(--button-color);
  }

  .button[data-type="outline"]:hover,
  .button[data-type="outline"]:focus {
    background: var(--button-color);
    color: var(--clr-primary-800);
  }

  .product {
    --_padding: 1rem;

    grid-row: span 3;

    display: grid;
    grid-template-rows: subgrid;
    gap: 1rem;
    background: var(--clr-primary-700);
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .product > :not(img) {
    margin-inline: var(--_padding);
  }

  .product > :last-child:not(img) {
    margin-block-end: var(--_padding);
  }

  .product > img {
    width: 100%;
    height: 120px;
    object-fit: cover;
  }

  .product__price {
    line-height: 1;
  }

  .product__price span {
    display: block;
    font-size: 1.25rem;
    color: var(--clr-accent-300);
    font-weight: 900;
  }

  .product__description {
    display: none;
  }

  .group {
    padding-bottom: 3rem;
  }

  fieldset {
    display: grid;
    gap: 1rem;
    margin-block-end: 1rem;
  }

  select {
    font: inherit;
    padding: 0.25lh 1ch;
  }

}

/* this is for the select menus...
   it's fun to do it with CSS-only
   but you might want to use JS instead :)
*/

/* html:has(option[value="auto-fit"]:checked) {
  --grid-type: auto-fit;
}

html:has(option[value="auto-fill"]:checked) {
  --grid-type: auto-fill;
}

html:has(option[value="one"]:checked) .grid > :nth-child(1n + 2) {
  display: none;
}

html:has(option[value="two"]:checked) .grid > :nth-child(1n + 3) {
  display: none;
}

html:has(option[value="three"]:checked) .grid > :nth-child(1n + 4) {
  display: none;
}

html:has(option[value="four"]:checked) .grid > :nth-child(1n + 5) {
  display: none;
}

html:has(option[value="five"]:checked) .grid > :nth-child(1n + 6) {
  display: none;
}

html:has(option[value="six"]:checked) .grid > :nth-child(1n + 7) {
  display: none;
}

html:has(option[value="seven"]:checked) .grid > :nth-child(1n + 8) {
  display: none;
} */