/* Varukorgslådan: placering, storlek och flex som Rebuys låda i Shopify (mått 17 okt).
   Utseendet i övrigt (typsnitt, färger, knappar, fraktmätaren och prenumerationsrutan)
   kommer från envana-custom.css, som läses efter den här filen. */
/* Sidan låses medan lådan är öppen och står still: rullistens bredd blir marginal (mäts i korg.js, som i ram.css). */
html.envana-korg-oppen {
  overflow: hidden;
  padding-right: var(--envana-rullist, 0px);
}
.rebuy-cart[hidden],
.korg__fot[hidden],
.korg__besked[hidden],
.korg__fel[hidden] {
  display: none;
}
.rebuy-cart {
  position: fixed;
  inset: 0;
  z-index: 1000000;
}
.rebuy-cart__background {
  position: absolute;
  inset: 0;
  background: rgba(25, 7, 1, 0.45);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.rebuy-cart.is-visible .rebuy-cart__background {
  opacity: 1;
  transition-duration: 0.5s;
}
.rebuy-cart__flyout {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #FFFFFF;
  color: rgb(25, 7, 1);
  font-family: var(--env-font-body);
  /* Glider in och ut som lådan i Shopify-temat Impact (Rasmus 24 okt): mjuk inbromsning in, snabbare ut.
     korg.js döljer lådan när utglidningen är klar (KORG_STANG_MS). */
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.rebuy-cart.is-visible .rebuy-cart__flyout {
  transform: none;
  transition-duration: 0.5s;
}
@media (prefers-reduced-motion: reduce) {
  .rebuy-cart__background,
  .rebuy-cart__flyout {
    transition: none !important;
  }
}
@media screen and (min-width: 768px) {
  .rebuy-cart__flyout {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: 500px;
    max-width: calc(100% - 16px);
    border-radius: 16px;
    /* Lådan står 10 px från kanten i dator, så den glider ut helt. */
    transform: translateX(calc(100% + 20px));
  }
}

.korg__huvud {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 10px 16px 0;
}
.rebuy-cart__title {
  margin: 0;
  line-height: 30px;
}
.rebuy-cart__flyout-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #320D01;
  cursor: pointer;
}
.korg__kropp {
  flex: 1 1 auto;
  overflow-y: auto;
}
.korg__innehall {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
}
.korg__innehall:empty {
  display: none;
}
.korg__rader {
  margin: 12px 0 10px;
  padding: 6px 0;
  list-style: none;
  border-top: 1px solid #EEEEEE;
  border-bottom: 1px solid #EEEEEE;
}

/* Raden: bild, namn, papperskorg, antal och pris */
.rebuy-cart__flyout-item {
  display: flex;
  gap: 10px;
  padding: 20px 0;
}
.rebuy-cart__flyout-item-media {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
}
.rebuy-cart__flyout-item-media img {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
}
.rebuy-cart__flyout-item-info {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  padding-left: 6px;
}
.rebuy-cart__flyout-item-product-title {
  display: block;
  width: 100%;
  padding-right: 30px;
  text-decoration: none;
}
/* Prenumerationsradens intervall ("Levereras var 20:e dag") under namnet; texten styrs av envana-custom.css. */
.rebuy-cart__flyout-item-property {
  display: block;
  width: 100%;
  padding-right: 30px;
}
.rebuy-cart__flyout-item-remove {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: rgb(138, 125, 118);
  cursor: pointer;
}
.rebuy-cart__flyout-item-quantity {
  flex: 1 1 50%;
  margin-top: 10px;
}
.rebuy-cart__flyout-item-quantity-widget {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rebuy-cart__flyout-item-quantity-widget-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #320D01;
  cursor: pointer;
}
.rebuy-cart__flyout-item-quantity-widget-button:disabled,
.rebuy-cart__flyout-item-remove:disabled {
  cursor: default;
  opacity: 0.5;
}
.rebuy-cart__flyout-item-quantity-widget-label {
  width: 36px;
  color: #320D01;
  font-size: 15px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  border-left: 1px solid rgb(227, 227, 227);
  border-right: 1px solid rgb(227, 227, 227);
}
.rebuy-cart__flyout-item-price {
  flex: 1 1 50%;
  margin-top: 5px;
  text-align: right;
}
.rebuy-cart__flyout-empty-cart {
  margin: 0;
  padding: 40px 16px;
  color: #320D01;
  text-align: center;
}

/* Foten: totalen och kassaknappen */
.korg__fot {
  flex-shrink: 0;
  padding: 14px 0 10px;
  border-top: 1px solid rgb(232, 211, 201);
}
.korg__summa {
  padding: 0 16px;
}
.rebuy-cart__flyout-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.korg__kassa {
  margin-top: 20px;
  padding: 0 16px 12px;
}
/* Rebuys rad för delbetalning är tom men ger 10 px luft under knappen. */
.rebuy-cart__flyout-installments {
  margin-top: 10px;
}
.rebuy-cart__checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 56px;
  padding: 0 24px;
  text-decoration: none;
}

/* Beskedet under "Byt till prenumeration" */
.korg__besked {
  margin: 10px 0 0;
  color: #320D01;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

/* Butikens orsak när en ändring i lådan inte går igenom */
.korg__fel {
  margin: 12px 16px 0;
  color: #320D01;
  font-size: 14px;
  line-height: 20px;
}
