/* General Styling */

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

html {
  font-family: Avenir, Helvetica, sans-serif;
}

body {
  margin: 0;
}

nav {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

ul,
li {
  margin: 0;
}

img {
  margin: 0;
}

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

/* Header Styling */

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  width: 50px;
}

input[type="search"] {
  min-width: 200px;
  font-size: 1rem;
  border: none;
  outline: none;
  -webkit-appearance: none;
}

.search-icon {
  display: flex;
  justify-content: right;
  align-items: center;
}

.search-icon:hover {
  opacity: 0.7;
}

.search-icon img {
  width: 18px;
}

.search-bar {
  border: 0.1rem solid black;
  padding: 0.4rem;
  border-radius: 0.5rem;
  display: flex;
  justify-content: left;
  align-items: center;
}

.search-bar:focus-within {
  box-shadow: 0px 0px 0px 0.4rem rgba(0, 0, 0, 0.2);
}

.menu li {
  list-style: none;
  line-height: 1.8rem;
}

.menu li:hover {
  opacity: 0.7;
}

.menu {
  padding: 0;
}

nav {
  text-align: right;
  writing-mode: vertical-rl;
}

header {
  display: grid;
  align-items: end;
  grid-template-columns: max-content min-content min-content auto;
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 595px) {
  nav {
    order: 3;
  }

  .search-bar {
    order: 4;
    grid-column: 2;
    justify-content: space-between;
  }

  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  header > * {
    margin: 0.5rem 0.5rem 0.5rem 0.5rem;
  }

  .logo {
    margin-bottom: 0;
  }

  nav {
    line-height: 2rem;
    text-align: center;
    writing-mode: horizontal-tb;
  }
}

/* Product Styling */

.product .image-container {
  display: flex;
  min-width: 36vw;
  max-width: 500px;
  justify-content: center;
}

.product img {
  align-self: center;
  width: 100%;
  height: auto;
}

main {
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.product {
  display: flex;
  flex-wrap: wrap;
  padding: 1rem 3rem 1rem 3rem;
  justify-content: center;
}

.product > * {
  margin: 0.5rem 1rem 0.5rem 1rem;
}

.product-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-self: center;
  align-items: center;
}

.name {
  font-size: 1.6rem;
}

.name h2 {
  text-align: center;
}

.product .price {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.price {
  font-variant-numeric: slashed-zero;
  font-size: 1rem;
}

.price span {
  font-size: 2.6rem;
  font-weight: bolder;
}

.purchase {
  font-size: 1rem;
  font-weight: 100;
  color: white;
  background-color: black;
  border: 0.1rem solid black;
  padding: 0.7rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.purchase:hover {
  opacity: 0.7;
}

.kinds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 1rem;
}

.kinds input {
  visibility: hidden;
}

.kinds label {
  cursor: pointer;
  white-space: nowrap;
  padding: 0.5rem;
}

.kinds input:checked + label {
  border: 0.1rem solid black;
  padding: 0.4rem;
  border-radius: 0.5rem;
}

.description {
  line-height: 1.8rem;
  min-width: 36ch;
  max-width: 68ch;
  text-align: left;
}

.specs {
  display: grid;
  align-self: center;
  align-items: center;
  line-height: 1.8rem;
}

.specs ul {
  list-style-type: none;
  list-style-position: inside;
  padding-left: 0;
  text-align: center;
}

.specs ul li::before {
  display: inline-block;
  content: "";
  border-radius: 0.375rem;
  border: 0.15rem solid black;
  height: 0.5rem;
  width: 0.5rem;
  margin-right: 0.5rem;
  background-color: white;
}

.specs ul li::after {
  display: inline-block;
  content: "";
  border-radius: 0.375rem;
  border: 0.15rem solid black;
  height: 0.5rem;
  width: 0.5rem;
  margin-left: 0.5rem;
  background-color: white;
}

@media (max-width: 595px) {
  .description {
    text-align: center;
  }
}

@media (max-width: 360px) {
  .description {
    font-size: 0.9rem;
    min-width: 30ch;
    max-width: 46ch;
  }

  .kinds {
    font-size: 0.9rem;
  }
}

/* Footer Styling */

.other-title {
  text-align: center;
  padding: 2rem;
}

.other-item {
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
}

.other-item > * {
  margin: 1rem 0.5rem 1rem 0.5rem;
}

.other-item span {
  font-size: 1.6rem;
}

.other-item > img {
  order: -1;
  max-width: 86%;
  align-self: center;
}

.other-item > img:hover {
  opacity: 0.7;
  cursor: pointer;
}

.other-item > button {
  max-width: 46%;
}

footer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Copyright Styling */

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  font-weight: 100;
}

.copyright > span {
  font-size: 1.2rem;
}
