:root {
  --primary-red: hsl(14, 86%, 42%);
  --accent-green: hsl(159, 69%, 38%);
  --rose-50: hsl(20, 50%, 98%);
  --rose-100: hsl(13, 31%, 94%);
  --rose-300: hsl(14, 25%, 72%);
  --rose-400: hsl(7, 20%, 60%);
  --rose-500: hsl(12, 20%, 44%);
  --rose-900: hsl(14, 65%, 9%);
  --white: hsl(0, 0%, 100%);
  --primary-red-hover: hsl(14, 97%, 30%);
}

/*****************************/
/* Utilities / Shared Styles */
/*****************************/

.u-flex {
  display: flex;
}

.u-font-medium {
  font-weight: 500;
}

.btn {
  border-radius: 1.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
}

.btn--sm {
  align-items: center;
  width: 160px;
}

.btn--lg {
  border: 1px solid var(--primary-red);
  background-color: var(--primary-red);
  color: var(--white);
  width: 100%;
}

/***********/
/* Layout */
/***********/

body {
  display: grid;
  justify-items: center;
  align-items: center;
  background-color: var(--rose-50);
  font-family: 'Red Hat Text', sans-serif;
  font-weight: 400;
  color: var(--rose-900);
}

.site-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  align-items: center;
  min-width: 320px;
  max-width: 1440px;
  width: 100%;
  padding: 2rem 1rem 0 1rem;
}

.app-view {
  flex-direction: column;
  gap: 3rem 0;
}

@media only screen and (min-width: 600px) {
  .site-wrapper {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media only screen and (min-width: 800px) {
  .site-wrapper {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .app-view {
    flex-direction: row;
    justify-content: space-between;
    gap: 0 2rem;
  }
}

@media only screen and (min-width: 1200px) {
  .site-wrapper {
    padding: 3rem;
  }
}

/****************/
/* Product Grid */
/****************/

.product-grid {
  flex-basis: 100%;
  width: 100%;
}

.product-grid h2 {
  color: var(--rose-900);
  margin-bottom: 1.5rem;
  font-size: 2.5rem;
}

.product-items-list {
  display: grid;
  row-gap: 2rem;
}

.product-item-card {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 25px 40px auto;
}

.product-card-image-wrapper {
  border-radius: 0.5rem;
  overflow: hidden;
  grid-column: 1;
  grid-row: 1/3;
  position: relative;
}

.selected .product-card-image-wrapper {
  border: 2px solid var(--primary-red);
}

.product-card-btns-group {
  grid-column: 1;
  grid-row: 2;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.product-card-content {
  grid-row: 4;
  flex-direction: column;
  row-gap: 0.35rem;
  justify-content: space-between;
}

.product-category {
  color: var(--rose-900);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.product-name {
  color: var(--rose-900);
  font-weight: 600;
}

.product-price {
  color: var(--primary-red);
}

@media only screen and (min-width: 551px) {
  .product-items-list {
    -moz-column-gap: 1.2rem;
    column-gap: 1.2rem;
  }
}

@media only screen and (min-width: 551px) and (max-width: 799px) {
  .product-items-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media only screen and (min-width: 800px) {
  .product-grid {
    flex-basis: 60%;
  }

  .product-items-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media only screen and (min-width: 1066px) {
  .product-grid {
    flex-basis: 69%;
  }

  .product-items-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media only screen and (min-width: 1375px) {
  .product-items-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/************************/
/* Product Card Buttons */
/************************/

.btn__add-to-cart {
  justify-content: center;
  border: 1px solid var(--rose-400);
  background-color: var(--white);
  color: var(--rose-900);
}

.btn__add-to-cart:hover {
  border-color: var(--primary-red);
  transition: 0.2s scale ease-out;
}

.btn__add-to-cart img {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.btn__add-to-cart span {
  font-weight: 600;
}

.btn__add-to-cart:hover span {
  color: var(--primary-red);
}

.btn__add-to-cart:hover img {
  -webkit-animation: 0.5s linear 2 moveIcon;
  animation: 0.5s linear 2 moveIcon;
}

.btn__quantity {
  justify-content: space-between;
  border: 1px solid var(--primary-red);
  background-color: var(--primary-red);
  color: var(--white);
  cursor: default;
}

.btn__decrease-qty,
.btn__increase-qty {
  background-color: transparent;
  padding: 0.35rem;
  border-radius: 50%;
  border: 1px solid var(--rose-100);
  cursor: pointer;
}

.btn__decrease-qty:hover,
.btn__increase-qty:hover {
  background-color: var(--white);
  color: var(--primary-red);
}

.btn__decrease-qty img,
.btn__increase-qty img {
  width: 10px;
  height: 10px;
}

.btn__decrease-qty:hover img,
.btn__increase-qty:hover img {
  -webkit-filter: brightness(0) saturate(100%) invert(23%) sepia(78%)
    saturate(1573%) hue-rotate(350deg) brightness(111%) contrast(103%);
  filter: brightness(0) saturate(100%) invert(23%) sepia(78%) saturate(1573%)
    hue-rotate(350deg) brightness(111%) contrast(103%);
}

@-webkit-keyframes moveIcon {
  0% {
    transform: translateX(5px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes moveIcon {
  0% {
    transform: translateX(5px);
  }

  100% {
    transform: translateX(0);
  }
}

/******************/
/* Checkout Panel */
/******************/

.checkout-panel {
  flex-basis: 100%;
  background-color: var(--white);
  padding: 1.25rem;
  border-radius: 0.5rem;
}

@media only screen and (max-width: 799px) {
  .sticky.checkout-panel {
    border: 2px solid var(--rose-100);
    position: -webkit-sticky;
    position: sticky;
    z-index: 1;
    bottom: -15%;
    transform: translate(0, 10%);
  }
}

@media only screen and (min-width: 800px) {
  .checkout-panel {
    flex-basis: 39%;
    align-self: baseline;
  }
}

@media only screen and (min-width: 1066px) {
  .checkout-panel {
    flex-basis: 30%;
  }
}

.checkout-panel-title {
  color: var(--primary-red);
  margin-bottom: 1.5rem;
}

.checkout-panel-empty img {
  margin: 0 auto 1rem auto;
}

.checkout-panel-empty p {
  color: var(--rose-500);
  font-size: 0.875rem;
  text-align: center;
}

.checkout-panel-active {
  flex-direction: column;
  row-gap: 1.5rem;
}

.checkout-items-list {
  flex-direction: column;
  row-gap: 1rem;
}

.checkout-item {
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rose-100);
  padding-bottom: 0.65rem;
}

.checkout-item-body p {
  margin-bottom: 0.25rem;
}

.checkout-item-data {
  -moz-column-gap: 0.85rem;
  column-gap: 0.85rem;
}

/* Shared Checkout, Confirmation Styles */

.checkout-item-qty {
  color: var(--primary-red);
}

.checkout-item-qty--confirmed {
  margin-right: 0.75rem;
}

.checkout-item-price,
.checkout-item-total-price {
  color: var(--rose-500);
}

.checkout-item-price {
  font-weight: 400;
}

.checkout-item-total-price {
  font-weight: 600;
}

.final-calc-content {
  justify-content: space-between;
  align-items: center;
}

.final-calc-amount {
  font-size: 1.5rem;
  font-weight: 700;
}
/* End Shared Checkout, Confirmation Styles */

.checkout-item-cancel-icon {
  border: 1px solid var(--rose-300);
  border-radius: 50%;
  padding: 0.175rem;
  cursor: pointer;
}

.checkout--submessage {
  padding: 1rem 0;
  border-radius: 0.25rem;
  background-color: var(--rose-50);
}

.checkout--submessage p {
  text-align: center;
  font-size: 0.875rem;
}

.checkout--submessage p::before {
  content: url('../assets/images/icon-carbon-neutral.svg');
  vertical-align: text-top;
  margin-right: 0.25rem;
}

.btn__checkout:hover {
  background-color: var(--primary-red-hover);
}

/*********************/
/* Confirmation Modal */
/*********************/

.confirmation-modal {
  background-color: var(--white);
  padding: 1.5rem;
  border-color: transparent;
  border-radius: 0.5rem;
  min-width: 375px;
  width: 100%;
}

@media only screen and (min-width: 516px) {
  .confirmation-modal {
    max-width: 500px;
  }
}

.confirmation-icon-wrapper {
  margin-bottom: 2rem;
}

.confirmation-modal h3 {
  font-size: 2.5rem;
  margin-bottom: 0.35rem;
}

.confirmation-modal > p {
  color: var(--rose-500);
}

.confirmed-items-list {
  flex-direction: column;
  row-gap: 1rem;
  margin-top: 1.5rem;
  background-color: var(--rose-50);
  padding: 1.5rem;
  border-top-right-radius: 0.5rem;
  border-top-left-radius: 0.5rem;
}

.confirmed-item {
  border-bottom: 1px solid var(--rose-100);
  padding-bottom: 1rem;
  -moz-column-gap: 0.25rem;
  column-gap: 0.75rem;
}

.confirmed-item-image-wrapper {
  flex-basis: 20%;
}

.confirmed-item-body-wrapper {
  flex-basis: 75%;
}

.confirmed-item-body-wrapper {
  justify-content: space-between;
  align-items: center;
}

.final-calc-content--confirmation {
  justify-content: space-between;
  align-items: center;
  background-color: var(--rose-50);
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-bottom-right-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.btn__new-order {
  margin-top: 1.5rem;
}

.btn__new-order:hover {
  background-color: var(--primary-red-hover);
}

dialog {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

::-webkit-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/**********/
/* Footer */
/**********/

.fm-byline {
  margin-top: 4rem;
}

.fm-byline-text {
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-align: center;
}

.fm-byline-text,
.fm-byline-text a {
  color: var(--primary-red);
}
