/* -------------------------------- 

File#: _1_color-swatches
Title: Color Swatches
Descr: A list of selectable swatches used to show a product color variants
Usage: codyhouse.co/license

-------------------------------- */
/* reset */
*, *::after, *::before {
    box-sizing: border-box;
  }
  
  * {
    font: inherit;
    margin: 0;
    padding: 0;
    border: 0;
  }
  
  body {
    background-color: hsl(0, 0%, 100%);
    font-family: system-ui, sans-serif;
    color: hsl(230, 7%, 23%);
    font-size: 1rem;
  }
  
  h1, h2, h3, h4 {
    line-height: 1.2;
    color: hsl(230, 13%, 9%);
    font-weight: 700;
  }
  
  h1 {
    font-size: 2.0736rem;
  }
  
  h2 {
    font-size: 1.728rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  h4 {
    font-size: 1.2rem;
  }
  
  ol, ul, menu {
    list-style: none;
  }
  
  button, input, textarea, select {
    background-color: transparent;
    border-radius: 0;
    color: inherit;
    line-height: inherit;
    appearance: none;
  }
  
  textarea {
    resize: vertical;
    overflow: auto;
    vertical-align: top;
  }
  
  a {
    color: hsl(250, 84%, 54%);
  }
  
  table {
    border-collapse: collapse;
    border-spacing: 0;
  }
  
  img, video, svg {
    display: block;
    max-width: 100%;
  }
  
  @media (min-width: 64rem) {
    body {
      font-size: 1.25rem;
    }
  
    h1 {
      font-size: 3.051rem;
    }
  
      h2 {
      font-size: 2.44rem;
    }
  
      h3 {
      font-size: 1.75rem;
    }
  
      h4 {
      font-size: 1.5625rem;
    }
  }
  
  /* variables */
  :root {
    /* colors */
    --cc9-color-primary-hsl: 250, 84%, 54%;
    --cc9-color-bg-hsl: 0, 0%, 100%;
    --cc9-color-contrast-high-hsl: 230, 7%, 23%;
    --cc9-color-contrast-higher-hsl: 230, 13%, 9%;
    --cc9-color-contrast-medium-hsl: 225, 4%, 47%;
  
    /* spacing */
    --cc9-space-2xs: 0.375rem;
    --cc9-space-xs: 0.5rem;
  
    /* typography */
    --cc9-text-sm: 0.833rem;
  }
  
  @media(min-width: 64rem){
    :root {
      /* spacing */
      --cc9-space-2xs: 0.5625rem;
      --cc9-space-xs: 0.75rem;
  
      /* typography */
      --cc9-text-sm: 1rem;
    }
  }
  
  /* component */
  :root {
    --color-swatches-gap: var(--cc9-space-2xs);
    --color-swatch-size: 32px;
    --color-swatch-radius: 50%;
  }
  
  .color-swatches__list {
    display: flex;
    grid-gap: var(--color-swatches-gap);
    grid-template-columns: repeat(auto-fit, var(--color-swatch-size));
  }
  
  .color-swatches__swatch {
    position: relative;
    display: block;
    height: var(--color-swatch-size);
    width: var(--color-swatch-size);
    border-radius: var(--color-swatch-radius);
    cursor: pointer;
  }
  .color-swatches__swatch::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 1px solid hsla(var(--cc9-color-contrast-higher-hsl), 0.1);
    border-radius: inherit;
    pointer-events: none;
    transition: 0.2s;
  }
  .color-swatches__swatch:hover::before {
    border-color: hsla(var(--cc9-color-contrast-higher-hsl), 0.3);
  }
  
  .color-swatches__item--selected .color-swatches__swatch::before {
    border-color: hsla(var(--cc9-color-contrast-higher-hsl), 0.8);
    width: calc(100% + 6px);
    height: calc(100% + 6px);
  }
  
  /* utility classes */
  .cc9-sr-only {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    border: 0;
    white-space: nowrap;
  }
  
  .cc9-color-contrast-high {
    --cc9-color-o: 1;
    color: hsla(var(--cc9-color-contrast-high-hsl), var(--cc9-color-o, 1));
  }
  
  .cc9-margin-bottom-xs {
    margin-bottom: var(--cc9-space-xs);
  }
  
  .cc9-color-contrast-medium {
    --cc9-color-o: 1;
    color: hsla(var(--cc9-color-contrast-medium-hsl), var(--cc9-color-o, 1));
  }
  
  .cc9-text-sm {
    font-size: var(--cc9-text-sm);
  }
  
  .cc9-hide {
    display: none !important;
  }
  .sizes .color-swatches__swatch::before{
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    height: 100%;
    border: 1px solid hsla(var(--cc9-color-contrast-higher-hsl), 0.1);
    border-radius: inherit;
    pointer-events: none;
    transition: 0.2s;
    padding: 4px;
  }