@import "./base.css";

header {
  background-color: var(--color-surface-mixed-300);

  .container {
    height: 60px;
    * {
      max-height: 60px;
    }
  }

  .site-logo {
    .site-icon {

      img {
        width: 100%;
        height: auto;
      }
    }
  }

  h1 {
    font-size: 1.4em;
    margin: 0;
    a {
      gap: 2px;
    }
    em {
      color: var(--color-primary-600);
      text-transform: uppercase;
      font-size: 0.9em;
      margin-top: -5px;
    }
  }

  a {
    color: var(--color-text);
    text-decoration: none;
  }

  .cart {
    a {
      gap: 2px;
    }
    #cart-count {
      background-color: var(--color-primary-600);
      color: var(--color-surface-200);
      width: 28px;
      display: flex;
      height: 28px;
      justify-content: center;
      border-radius: 100%;
      font-size: 1.2em;
      font-weight: bold;
      align-items: center;
    }
  }
}

footer {
  padding: 20px 0;
  margin-top: auto;
  background-color: var(--color-surface-200);

  p {
    color: var(--color-surface-600);
    font-size: 0.9em;
  }
  a {
    color: var(--color-surface-600);
    transition: color 100ms ease-in-out;
    text-decoration: underline;
    &:hover, &:active, &:focus {
      color: var(--color-primary-400);
    }
  }
  p+p {
    margin-top: 10px;
  }

}

main {
  margin-bottom: 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-bottom: 40px;

  .illustration {
    height: 60vh;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;

      &.desktop {
        display: none;
      }

      @media(min-width: 900px) {
        &.mobile {
          display: none;
        }
        &.desktop {
          display: block;
        }
      }
    }
  }

  .overlay {
    position: absolute;
    inset: 0 0 0 0;
    background-image: linear-gradient(180deg, transparent, transparent 20%, var(--color-surface-100) 80%);
    @media(min-width: 900px) {
      background-image: linear-gradient(90deg, transparent, transparent 20%, var(--color-surface-100) 80%);
    }
  }

  .hero-content {
    position: absolute;
    left: -5vw;
    right: -5vw;
    bottom: 5%;
    font-size: 1.2em;
    background: white;
    color: var(--color-surface-100);
    transform: rotate(355deg);
    /* text-shadow: 0 0 10px black; */
    .container {
      /* flex-direction: column-reverse; */
      text-align: center;
      height: 100%;
      padding: 20px;
      max-width: 700px;
    }
    h1 {
      margin: 0 0 5px 0;
    }
    p {
      font-size: 1.2em;

    }


  }

}

.product-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  .product-card {
    flex-direction: column;
    text-align: center;
    a {
      flex-direction: column;
      gap: 10px;
    }
  }

  @media (min-width: 720px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media (min-width: 1000px) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-list {
  .product-card {
    flex-direction: row;
    a {
      flex-direction: row;
      max-height: 120px;
      gap: 20px;
      min-width: 0;
      img {
        height: 100%;
        width: auto;
      }
    }
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--color-surface-mixed-200);
  border-radius: 1em;
  padding: 20px;
  a {
    display: flex;
    flex-direction: column;
    color: var(--color-text);
    text-decoration: none;
    align-items: center;

    img {
      border-radius: 1em;
      width: 100%;
      height: auto;
    }
  }

  button {
    margin-top: auto;
  }

  transition: box-shadow, transform 200ms ease-in-out;
  &:hover, &:active, &:focus {
    transform: scale(1.01);
    box-shadow: 0 0 10px 2px var(--color-primary-100);
  }
}

.product-detail {
  display: flex;
  flex-direction: column;
  margin: 40px 0;

  picture {

    img {
      width: 100%;
      height: auto;
    }
  }

  .product-info {
    flex: auto;
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: var(--color-surface-mixed-200);
    border-radius: 1em;
    padding: 20px;

    p {
      font-size: 1.2em;
      margin-bottom: 20px;
    }

    button {
      margin-top: auto;
    }
  }

  @media(min-width: 720px) {
    padding: 20px 0;
    flex-direction: row;

    picture {
      flex: 0 0 50%;
    }
    .product-info {
      text-align: left;
    }
  }
}

.callout {
  display: flex;
  flex-direction: column;
  margin: 40px 0;

  picture {
    margin-bottom: 5px;
    img {
      width: 100%;
      height: auto;
      border-radius: 1em;
    }
  }
  .callout-text {
    text-align: center;
    h2 {
      margin-bottom: 5px;
    }
    p {
      line-height: 1.5em;
    }
  }

  @media(min-width: 720px) {
    flex-direction: row;
    gap: 20px;
    &:nth-child(even) {
      flex-direction: row-reverse;
    }

    .callout-text {
      text-align: left;
      align-content: center;
      max-width: 600px;
    }
  }
}

main.cart {
  margin: 40px auto;
}

#promo-banner {
  background-color: var(--color-primary-100);
}
.promo-list {
  margin-bottom: 20px;

  .product-card {
    align-items: center;
    justify-content: space-between;
    background-color: transparent;
    padding: 0;
    a {
      flex-direction: row;
      height: 180px;
      gap: 20px;
      min-width: 0;
      img {
        height: 100%;
        width: auto;
      }
    }
    &:hover, &:active, &:focus {
      transform: none;
      box-shadow: none;
    }
    button {
      margin: 0;
    }

    /* Hidden by default */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    &.expand {
      max-height: 1000px;
      opacity: 1;
      /* transition: max-height 2s ease-in,
                  opacity 1s ease-out 1s; */

    }
  }

  @media (min-width: 720px) {
    margin-bottom: 0;
    .product-card {
      flex-direction: row;
    }
  }

}


/* #promo-banner {
  height: 260px;
} */
/*
#promo-banner {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 1;
}
 */
