/* css/style.css */
/* @import url('base/_reset.css');
@import url('base/_variables.css');
@import url('layout/_grid.css');
@import url('components/_card.css');
@import url('components/_cart.css');
@import url('components/_header.css');
@import url('components/_modal.css');
@import url('layout/_grid.css');
@import url('layout/_sidebar.css');
@import url('utils/_animations.css');
@import url('utils/_helpers.css'); */
/* ... */

/* global config */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", serif;
}

/* starts: header related */
header {
  display: flex;
  justify-content: space-between;
  grid-row: 1 / 2;
  grid-column: 1 / 3;
}
.top-container {
  display: flex;
  align-items: center;
  padding: 15px 3%;
}

.header-container {
  display: flex;
  gap: 1rem;
}

#cart-div {
  align-self: flex-end;
  margin-right: 0.3rem;
}

.div-cart {
  cursor: pointer;
  width: 3rem;
  transform: scale(1);
  opacity: 1;
  transition:
    transform 0.4s ease-in-out,
    opacity 0.4s ease-in-out;
}

.div-cart:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.search-button {
  height: 2rem;
  width: 2rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 0.4rem;
  padding: 0;
}

.search-img {
  width: 1rem;
  margin-top: 0.1rem;
  padding: 0;
}

.div-search {
  display: flex;
  align-self: flex-end;
  justify-content: center;
  align-items: center;
  background-color: field;
  border: none;
  opacity: 0.7;
  margin-bottom: 0.3rem;
  height: 2.8rem;
  border-radius: 4.5rem;
}

.div-search:focus-within {
  opacity: 1;
  border: 1px solid #669bbc;
}

.div-search:hover {
  opacity: 0.5;
  transition: 0.4s;
}

#search {
  border: none;
  outline: none;
  color: black;
  opacity: 0.7;
  border-radius: 5rem;
  width: 19vw;
}

header,
footer {
  background-color: #14213d;
  color: #ffffff;
}
/* ends: header related */

/* starts: body related */
body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: min-content auto min-content;
  justify-content: center;
  min-height: 100vh;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

#sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 5px 3%;
  gap: 5px;
}

#sidebar-price-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 99%;
  background-color: field;
  border: none;
  cursor: pointer;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  margin-top: 0.1rem;
  padding-right: 0;
}

#sidebar-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 99%;
  background-color: field;
  border: none;
  cursor: pointer;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  margin-top: 0.1rem;
  padding-right: 0;
}

h2 {
  text-align: start;
  font-weight: normal;
  font-size: 17px;
}

#arrow-down {
  width: 2.5vw;
}

main {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
}

.product-img {
  width: 100%;
  height: 25vh;
  object-fit: contain;
}

.img-cart {
  width: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  width: 21vw;
  max-height: fit-content;
  height: -moz-fit-content;
  margin: 0.3rem;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  will-change: transform;
  contain: content;
  align-items: center;
}

.card-btns {
  display: flex;
  gap: 1rem;
}

h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h3,
p {
  margin: 0;
  font-size: 15px;
}

.price {
  margin: 0.5rem 0;
  font-weight: bold;
  font-size: 18px;
  content-visibility: auto;
}

.category {
  color: grey;
}

.btn-product {
  flex: auto;
  color: black;
  background-color: transparent;
  padding: 0.3rem;
  border: 2px solid black;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0px 60px;
}

.btn-product:hover {
  opacity: 0.7;
}

footer {
  padding-top: 2rem;
  grid-row: 3 / 4;
  grid-column: 1 / 3;
}
/* ends: body related */

/* starts: modals related */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal[data-modal-type="cart"] .modal-content {
  right: 0;
  width: 300px;
}

.modal[data-modal-type="buy"] .modal-content {
  width: 400px;
}

.cart-content {
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  padding-top: 0.5rem;
  width: 25%;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  font-weight: bold;
}

/* starts: configuration scroll bar */
.cart-content::-webkit-scrollbar {
  width: 8px;
}

.cart-content::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}

.cart-content::-webkit-scrollbar-track {
  background-color: #f1f1f1;
}

.unit-item {
  display: grid;
  grid-template-columns: 1.5fr 0.3fr 0.3fr 0.3fr repeat(2, 1fr);
  grid-template-rows: repeat(2, 0.5fr) 0.2fr 0.3fr;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.unit-item:nth-last-child(2) {
  margin-bottom: 0;
}

/* ends: configuration scroll bar */
.cart-product-img {
  grid-column: 1 / 2;
  grid-row: 1 / 5;
  height: 8vh;
  padding: 0.3rem;
  align-self: center;
  object-fit: contain;
}

.more-btn,
.less-btn {
  width: 2vw;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.more-btn,
.less-btn,
.quantity {
  margin: 0.3rem 0;
}
.unit-item h3 {
  grid-column: 3 / 7;
  grid-row: 1 / 2;
  padding-bottom: 0;
}

.unit-item .price {
  grid-column: 3 / 7;
  grid-row: 2 / 3;
}

.more-btn {
  grid-column: 3 / 4;
  grid-row: 4 / 5;
}

.quantity {
  grid-column: 4 / 6;
  grid-row: 4 / 5;
  justify-self: center;
}

.less-btn {
  grid-column: 6 / 7;
  grid-row: 4 / 5;
}

.unit-item h3,
.unit-item p {
  font-size: 0.9rem;
}

.modal-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-weight: bold;
  width: 45%;
}

.close-cart-btn,
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

.close-btn {
  background-color: white;
  border-radius: 5px;
  height: 1.2rem;
  width: 1.2rem;
}

.div-total-prices {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 10vh;
  min-height: 13vh;
  background-color: #14213d;
  color: white;
}

.resume {
  color: white;
}

.total-value {
  font-size: 1rem;
  flex-basis: 35%;
}

.total-span {
  background-color: #2350b8a1;
  padding: 0.2em 0.5em;
  border-radius: 8px;
  color: #fff;
}
/* ends: modals related */

.hidden {
  display: none;
}

/* starts: media query for tablets */
@media screen and (max-width: 858px) {
  /* starts: body related */
  main {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    width: 32vw;
    margin: 0.1rem;
  }

  h3,
  p {
    padding-left: 0.1rem;
  }

  .price {
    font-size: 17px;
  }
  /* ends: body related */

  /* starts: modals related */
  .unit-item h3,
  .unit-item p {
    font-size: 0.8rem;
  }

  .more-btn,
  .less-btn {
    height: 2.6vh;
    width: 2.6vw;
  }
  /* ends: modals related */
}
/* ends: media query for tablets */

/* starts: responsiveness to the total value */
@media screen and (max-width: 770px) {
  .total-value {
    font-size: 0.9rem;
  }
  .total-quantity {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 718px) {
  .total-value {
    font-size: 0.8rem;
  }
  .total-quantity {
    font-size: 0.8rem;
  }
}
/* end: responsiveness to the total value */

/* starts: media query for cell phones */
@media screen and (max-width: 620px) {
  /* starts: header related */
  h1 {
    font-size: 22px;
  }

  #search {
    width: 28vw;
  }
  /* ends: header related */

  /* starts: body related */
  body {
    grid-template-columns: 100%;
  }

  main {
    grid-template-columns: 100%;
  }

  .product-img {
    object-fit: contain;
  }

  .card {
    width: 95vw;
    margin: 0.3rem 0;
  }

  h3,
  p {
    padding-left: 0.2rem;
    font-size: 14px;
  }

  .price {
    font-size: 16px;
  }

  .card-btns {
    justify-content: center;
    height: 4vh;
  }

  .btn-product {
    flex-grow: 0.9;
  }
  /* ends: body related */

  /* starts: modals related */
  .cart-content {
    left: 0;
    width: 100%;
    height: 50%;
  }

  .more-btn,
  .less-btn {
    width: 6vw;
  }

  .quantity {
    align-self: center;
  }

  .unit-item h3,
  .unit-item p {
    font-size: 0.85rem;
  }
  .total-value {
    font-size: 1rem;
  }
  .total-quantity {
    font-size: 0.9rem;
  }
  /* ends: modals related */
}
/* ends: media query for cell phones */
