.cartpage {
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto 0 auto;
}

#cart-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-item {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0px 0px 8px 0 rgba(0, 0, 0, 0.15);
}

.cart-product-image {
  width: 100px;
  margin-right: 20px;
  cursor: pointer;
}

.product-info {
  flex: 1;
}

.product-info h2 {
  margin: 0 0 3px 0;
  font-size: 16px;
}

.product-info p {
  margin: 2.5px 0;
  font-size: 14px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-actions input {
  width: 50px;
  text-align: center;
}

.remove-button {
  height: 20px;
  filter: invert(16%) sepia(95%) saturate(7452%) hue-rotate(360deg) brightness(108%) contrast(113%);
  cursor: pointer;
}

.quantity-input {
  border-radius: 6px;
  border: 1px solid #7b7b7b;
}
.cart-kpl-text {
  transform: translateX(-5px);
}

#cart-summary {
  margin-top: 0px;
  line-height: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cart-summary b {
  font-size: 20px;
}

#checkout-button {
  background-color: #28a745;
  color: white;
  width: 200px;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 17px;
  height: 50px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  position: relative; /* Tarvitaan, jotta loader voidaan keskittää painikkeen sisällä */
}

#checkout-button:hover {
  background-color: #218838;
}

.cart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jatka-ostoksia {
  color: #7b7b7b;
  text-align: right;
  align-items: center;
  display: flex;
  font-size: 16px;
}

.jatka-ostoksia img {
  height: 16px;
  padding-right: 5px;
  filter: invert(57%) sepia(0%) saturate(68%) hue-rotate(155deg) brightness(84%) contrast(85%);
}

@media screen and (max-width: 599px) {
  .product-item {
    flex-direction: column;
    text-align: center;
  }
  #cart-summary {
    display: block;
  }
  #checkout-button {
    width: 100%;
    margin-top: 20px;
  }
  .cart-product-image{
    width: 180px;
    margin-right: 0;
    margin-bottom: 20px;
    margin-top: 10px;
  }
  #error-text, .turvallinen-maksu-teksti-cart {
    text-align: left;
  }
  #payment-methods-section-cart {
    flex-direction: column;
    margin-top: 25px !important;
  }
}

@media screen and (min-width: 600px) {
  .cart-summary-right-side {
    padding-left: 30px;
  }
  .newsletter-agree-section {
    margin-bottom: 9px !important;
  }
}

.loader, .loader:before, .loader:after {
  border-radius: 50%;
  width: 2.5em;
  height: 2.5em;
  animation-fill-mode: both;
  animation: bblFadInOut 1.8s infinite ease-in-out;
}
.loader {
  display: none;
  color: white;
  font-size: 7px;
  text-indent: -9999em;
  animation-delay: -0.16s;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -150%);
}
.loader:before,
.loader:after {
  content: '';
  position: absolute;
  top: 0;
}
.loader:before {
  left: -3.5em;
  animation-delay: -0.32s;
}
.loader:after {
  left: 3.5em;
}
@keyframes bblFadInOut {
  0%, 80%, 100% { box-shadow: 0 2.5em 0 -1.3em }
  40% { box-shadow: 0 2.5em 0 0 }
}

#error-text {
  color: rgb(255, 0, 0);
  display: none;
}

.cart-summary-right-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Kohdistaa elementit oikealle puolelle vaakasuunnassa */
  justify-content: center; /* Kohdistaa elementit keskelle pystysuunnassa, säädä tarvittaessa */
  text-align: right;
}

.cart-summary-left-side {
  white-space: nowrap;
}

.empty-cart-message {
  display: none;
  text-align: center;
  margin-top: 50px;
  color:black;
}
.empty-cart-message a {
  color:black;
}
.empty-cart-message img {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  filter: invert(47%) sepia(0%) saturate(0%) hue-rotate(260deg) brightness(102%) contrast(90%);
}

.product-info .original-price {
  font-size: 12px;
  margin-right: 2px;
}

/* ALENNUSKOODI KENTTÄ */
#promo-code-input {
  width: 230px;
  padding: 0.6em 1em;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  color: black;
}

#promo-code-input:hover {
  background-color: #fff;
  border-color: #aaa;
}
#promo-code-input-button {
  height: 41.2px;
  width: 66px;
  margin-left: 5px;
  color: #006fff;
  background-color: white;
  border: solid 1px #006fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  transition: background-color 0.3s ease;
  position: relative; /* Tarvitaan, jotta loader voidaan keskittää painikkeen sisällä */
}

.promo-code-container {
  margin-top: 30px;
  margin-bottom: 25px;
}

#applied-promo-code {
  background-color: #eaeaea;
  padding: 4px 13px 4px 13px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}

#applied-promo-code img {
  margin-left: 15px;
  height: 20px;
  filter: invert(14%) sepia(99%) saturate(6678%) hue-rotate(4deg) brightness(97%) contrast(117%);
}

.applied-promo-code-discount-amount {
  font-size: 12px;
  line-height: 0;
  margin-top: 2px;
  color: #7b7b7b;
}

.applied-promo-code-discount-name {
  line-height: 0;
  font-weight: 500;
}

.apply-loader {
  display: none;
  width: 25px;
  height: 25px;
  border: 3px solid #006fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  position: absolute;
  top: 20%;
  left: 31%;
  }

  @keyframes rotation {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
  } 

#promo-code-input-div {
  display: flex;
}

#payment-methods-container-cart {
  border: solid 1px rgb(183, 183, 183);
  padding: 7px 11px;
  border-radius: 15px;
  font-size: 14px;
  color: rgb(100, 100, 100);
  position: relative;
  text-align: left;
  flex: 1;
}
.payment-method-in-container-cart {
  position: absolute;
  top: 2px;
  left: 2px;
}
.klarna-spacer {
  margin-left: 44px;
}
#payment-methods-section-cart {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

#payment-methods-container-cart .footer-payment-methods {
  margin: 5px 0 0 0;
}

.cart-agree-label {
  font-size: 14px;
}

.newsletter-agree-section {
  margin-bottom: 25px;
}