/* RESET */
* {
  font-family: Helvetica, Arial, sans-serif;
;
  font-size: 16px;
  color: #1d1d1b;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#wrapper {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;

  /* MAIN GRID */
  display: grid;
  grid-template-areas:
    "header"
    "main"
    "footer";
  grid-template-columns: 1fr;
  grid-template-rows: 120px minmax(600px, auto) minmax(100px, auto);
  gap: 2rem;
}

.sr-only {
  display: none;
}

header {
  grid-area: header;
  height: 120px;
  background-color: #fff;
  border-bottom: 2px solid #e9e9e9;

  /* sub grid */
  display: grid;
  grid-template-areas:
    "logo menu search";
  grid-template-columns: 1fr 2fr 35px;
  grid-template-rows: 1fr;
}

#logo {
  grid-area: logo;
  align-self: center;
}

nav {
  grid-area: menu;
}

#menu-icon {
  display: none;
}

.menu {
  height: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
}

nav li {
  list-style: none;
}

nav a {
  text-decoration: none;
  padding: 15px 25px;
  font-weight: bold;
  font-family: Tahoma, Verdana, sans-serif;
  text-transform: uppercase;
}

nav a:hover {
  background-color: #ce171b;
  color: #fff;
}

#search {
  grid-area: search;
  height: 25px;
  align-self: center;
  justify-self: end;
  cursor: pointer;
}

main {
  grid-area: main;
  min-height: 300px;
  padding: 0 25px;
}

#home-main {
  padding: 0;

  /* sub grid */
  display: grid;
  grid-template-areas:
    "hero"
    "featured";
  grid-template-columns: 1fr;
  grid-template-rows: 405px 170px;
  gap: 2rem;
}

#hero {
  grid-area: hero;
  height: 405px;
}

#hero img {
  width: 100%;
  max-width: 900px;
  height: auto;
}

#featured-grid {
  grid-area: featured;
  min-height: 170px;

  display: flex;
  justify-content: space-between;
}

#home-main figure {
  position: relative;
  text-align: center;
}

#home-main figcaption {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%);
  background-color: rgba(255, 255, 255, 0.7);
  text-shadow: 1px 1px 0px #fff;
  width: 130px;
  padding: 7px 0;
  font-size: 1.2rem;
}

span.credit, .credit a {
  font-size: 0.6rem;
  color: #9a9a9a;
}

#rooms-main {
  /* sub grid */
  display: grid;
  grid-template-areas:
    "heading"
    "content";
  grid-template-columns: 1fr;
  grid-template-rows: 2.5rem 1fr;
  gap: 2rem;
}

h1 {
  grid-area: heading;
  font-family: Tahoma, Verdana, sans-serif;
  font-weight: bold;
  font-size: 2rem;
  color: #ce171b;
  text-transform: uppercase;
}

#rooms-main section {
  grid-area: content;

  display: flex;
  flex-direction: column;
  gap: 2rem;
}

#rooms-main figure {
  /* sub grid */
  display: grid;
  grid-template-areas:
    "image description";
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr;
  gap: 2rem;
}

#rooms-main img {
  grid-area: image;
  width: 300px;
}

#rooms-main figcaption {
  grid-area: description;
}

h2 {
  font-size: 1.4rem;
  color: #159a39;
  margin-bottom: 10px;
}

main p {
  line-height: 1.25rem;
}

#product-main {
  /* sub grid */
  display: grid;
  grid-template-areas:
    "heading heading"
    "image description";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 2.5rem 1fr;
  gap: 2rem;
}

#product-main h1 {
  grid-area: heading;
}

#product-main img {
  grid-area: image;
  width: 100%;
  height: auto;
  border: 1px solid #e9e9e9;
}

#product-main > section {
  grid-area: description;
}

#product-main .product-price {
  font-size: 2rem;
  font-weight: bold;
  display: block;
  margin-bottom: 30px;
}

#product-main p {
  margin-bottom: 30px;
}

section#product-colours {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 30px;
}

.colour-option {
  display: block;
  width: 50px;
  height: 50px;
  border: 1px solid #1d1d1b;
}

.colour-option:hover {
  border: 3px solid #1d1d1b;
}

.brown {
  background-color: sandybrown;
}

.slate {
  background-color: darkslategray
}

.tan {
  background-color: wheat;
}

.grey {
  background-color: gray;
}

#product-main input {
  width: 50px;
  height: 50px;
  text-align: center;
  border-radius: 0;
  border: 1px solid #1d1d1b;
  margin-right: 1rem;
}

button {
  height: 50px;
  width: fit-content;
  padding: 0 70px;
  border-radius: 0;
  border: 1px solid #1d1d1b;
  background-color: #159a39;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
}

button:hover {
  background-color: #ce171b;
}

#cart-main {
  /* sub grid */
  display: grid;
  grid-template-areas:
    "heading"
    "cart-items"
    "button";
  grid-template-columns: 1fr;
  grid-template-rows: 2.5rem 1fr 70px;
  gap: 2rem;
  justify-items: center;
}

#cart-main h1 {
  grid-area: heading;
  width: 100%;
}

#cart-items {
  grid-area: cart-items;
  
  display: table;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#cart-items tbody {
  border-bottom: 3px solid #1d1d1b;
}

#cart-items td {
  vertical-align: top;
  padding: 0 2%;
}

#cart-items img {
  grid-area: image;
  max-width: 100%;
  border: 1px solid #e9e9e9;
}

#cart-items h2 {
  font-size: 1rem;
  margin-bottom: unset;
}

.narrow {
  height: 2rem;
}

.wide {
  width: 65%;
}

.price {
  text-align: right;
  font-weight: bold;
}

.total {
  font-size: 1.8rem;
  font-weight: bold;
}

#cart-main button {
  grid-area: button;
}

/* grid: footer */
footer {
  grid-area: footer;
  min-height:100px;
  background-color: #1d1d1b;

  /* sub grid */
  display: grid;
  grid-template-areas:
    "social footnav"
    "copyright copyright";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 40px;
}

#social {
  grid-area: social;
}

#social .menu {
  justify-content: flex-start;
}

#footnav {
  grid-area: footnav;
}

#footnav .menu {
  justify-content: flex-end;
}

footer .menu {
  gap: 2rem;
  padding: 20px 25px;
}

footer li {
  list-style: none;
}

footer a {
  text-decoration: none;
  color: #fff;
}

footer a:hover {
  border-bottom: 3px solid #ce171b;
}

#copyright {
  grid-area: copyright;
  height: 40px;
  background-color: #fff;
  padding: 0 25px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

#copyright a {
  color: #1d1d1b;
}

#copyright a:hover {
  border: none;
  color: #159a39;
}


/* MEDIA QUERIES */
@media screen and (max-width: 900px) {
  #wrapper {
    /* change main grid row sizes */
    grid-template-rows: 70px minmax(600px, auto) minmax(100px, auto);
  }

  header {
    height: 70px;

    /* change layout */
    grid-template-areas:
      "menu logo search";
    grid-template-columns: 50px 1fr 50px;
  }

  #logo {
    justify-self: center;
    width: 100px;
  }

  #logo img {
    width: 100px;
    height: auto;
  }

  nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  
  #menu-icon {
    display: block;
    height: 35px;
  }

  #search {
    justify-self: start;
  }

  #menu-icon:hover {
    cursor: pointer;
  }

  header .menu {
    display: none;
  }

  #home-main {
    /* change row sizes */
    grid-template-rows: auto 1fr;
  }

  #hero {
    height: unset;
    width: 100%;
  }

  #featured-grid {
    /* change layout */
    flex-direction: column;
    gap: 2rem;
  }
  
  #featured-grid img {
    width: 100%;
    height: 100%;
  }

  #home-main figcaption {
    top: 30%;
    font-size: 2rem;
    width: 50%;
    padding: 5% 0;
  }

  #rooms-main figure {
    /* change rooms page layout */
    grid-template-areas:
      "image"
      "description";
    grid-template-columns: 1fr;
    grid-template-rows: minmax(75px, auto) 1fr;
    gap: 1rem;
  }

  #rooms-main img {
    width: 100%;
  }

  footer {
    /* change layout */
    grid-template-areas:
      "social"
      "footnav"
      "copyright";
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 40px;
  }

  #social {
    background-color: #ce171b;
  }

  #social a:hover {
  border-bottom: 3px solid #1d1d1b;
  }

  #social .menu, #footnav .menu {
    justify-content: center;
    gap: 1.5rem;
  }

  footer .menu {
    padding: 10px 25px;
  }
}

@media screen and (max-width: 750px) {
  #product-main {
    /* change layout */
    grid-template-areas:
      "heading"
      "image"
      "description";
    grid-template-columns: 1fr;
    grid-template-rows: 2.5rem auto auto;
  }

  .wide {
    width: 45%;
  }
}

@media screen and (max-width: 500px) {
  #wrapper {
    gap: 1rem;
  }

  #home-main, #featured-grid {
    gap: 1rem;
  }
  
  #home-main figcaption {
    top: 30%;
    font-size: 1.3rem;
    width: 50%;
    padding: 3% 0;
  }

  footer {
    grid-template-rows: 1fr 1fr 60px;
  }

  #copyright {
    height: 60px;
    flex-direction: column-reverse;
    justify-content: space-evenly;
  }

  footer a, #copyright span {
    font-size: 0.8rem;
  }
}