/* MS Quick Buy Checkout - PrestaShop 8.x */

.msqbc-hook {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: .5rem 0 0;
}

.msqbc-hook.msqbc-ready {
  margin: 0 0 .5rem;
}

.msqbc-button-stack {
  width: 100%;
}

.msqbc-button-stack .msqbc-hook {
  width: 100%;
  max-width: 100%;
}

.msqbc-button-stack .msqbc-quick-buy {
  width: 100%;
  min-height: var(--msqbc-native-height, 2.75rem);
  height: var(--msqbc-native-height, auto);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Backward compatibility if an older cached JS class remains for a moment */
.msqbc-button-row {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
}

.msqbc-button-row .msqbc-hook,
.msqbc-button-row .msqbc-quick-buy {
  width: 100%;
}

.msqbc-quick-buy {
  position: relative;
}

.msqbc-quick-buy.msqbc-loading {
  cursor: wait;
  opacity: .78;
}

.msqbc-message {
  display: none;
  width: 100%;
  margin-top: .4rem;
  font-size: .875rem;
  line-height: 1.35;
}

.msqbc-message-error {
  display: block;
  color: #9f2a2a;
  font-weight: 700;
}

.msqbc-message-info {
  display: block;
  color: #666666;
}

@media (max-width: 575px) {
  .msqbc-button-stack,
  .msqbc-button-stack .add-to-cart,
  .msqbc-button-stack .msqbc-hook,
  .msqbc-button-stack .msqbc-quick-buy,
  .msqbc-button-row,
  .msqbc-button-row .add-to-cart,
  .msqbc-button-row .msqbc-hook,
  .msqbc-button-row .msqbc-quick-buy {
    width: 100%;
  }
}


/* Sticky mobile quick-buy bar */
.msqbc-sticky-mobile {
  display: none;
}

@media (max-width: 767px) {
  body.msqbc-has-sticky-mobile {
    padding-bottom: 5.25rem;
  }

  .msqbc-sticky-mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem calc(.65rem + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, .12);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .14);
  }

  .msqbc-sticky-price {
    flex: 0 0 auto;
    min-width: 5.5rem;
    line-height: 1.1;
  }

  .msqbc-sticky-caption {
    display: block;
    color: #666666;
    font-size: .72rem;
    font-weight: 600;
  }

  .msqbc-sticky-price strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
  }

  .msqbc-sticky-mobile.msqbc-sticky-no-price .msqbc-sticky-price {
    display: none;
  }

  .msqbc-sticky-button {
    flex: 1 1 auto;
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  body.msqbc-has-sticky-mobile {
    padding-bottom: 0;
  }
}


/* Promotional price layout inside mobile sticky bar */
@media (max-width: 767px) {
  .msqbc-sticky-price {
    min-width: 6.35rem;
  }

  .msqbc-sticky-promo {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: .08rem 0 .1rem;
    line-height: 1;
  }

  .msqbc-sticky-regular {
    color: #777777;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: line-through;
    white-space: nowrap;
  }

  .msqbc-sticky-discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .12rem .32rem;
    color: #ffffff;
    background: #d63638;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }

  .msqbc-sticky-no-regular .msqbc-sticky-regular,
  .msqbc-sticky-no-discount .msqbc-sticky-discount {
    display: none;
  }

  .msqbc-sticky-has-promo .msqbc-sticky-caption {
    font-size: .68rem;
  }

  .msqbc-sticky-has-promo .msqbc-sticky-price strong {
    color: #1f9d8a;
    font-size: 1.12rem;
  }
}


/* Free shipping progress inside mobile sticky bar */
@media (max-width: 767px) {
  .msqbc-sticky-mobile {
    flex-wrap: wrap;
  }

  .msqbc-free-shipping {
    flex: 0 0 100%;
    width: 100%;
    margin-top: .45rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(0, 0, 0, .08);
  }

  .msqbc-free-shipping[hidden] {
    display: none !important;
  }

  .msqbc-free-shipping-text {
    margin-bottom: .32rem;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.2;
  }

  .msqbc-free-shipping-track {
    width: 100%;
    height: .42rem;
    overflow: hidden;
    background: #eeeeee;
    border-radius: 999px;
  }

  .msqbc-free-shipping-fill {
    display: block;
    width: 0;
    height: 100%;
    background: #1f9d8a;
    border-radius: inherit;
    transition: width .25s ease;
  }

  .msqbc-free-shipping-reached .msqbc-free-shipping-text {
    color: #178a26;
  }
}


/* Free shipping upsell popup */
body.msqbc-upsell-open {
  overflow: hidden;
}

.msqbc-upsell-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.msqbc-upsell-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}

.msqbc-upsell-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.1rem;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

.msqbc-upsell-x {
  position: absolute;
  top: .65rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: #f2f2f2;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.msqbc-upsell-dialog h3 {
  margin: 0 2.4rem .35rem 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.msqbc-upsell-subtitle {
  margin: 0 0 .65rem;
  color: #666666;
  font-size: .95rem;
}

.msqbc-upsell-remaining {
  margin: 0 0 .85rem;
  padding: .55rem .7rem;
  background: #f8f8f8;
  border-radius: .6rem;
  font-weight: 700;
}

.msqbc-upsell-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}

.msqbc-upsell-product {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid #eeeeee;
  border-radius: .75rem;
  background: #ffffff;
}

.msqbc-upsell-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  overflow: hidden;
  background: #f7f7f7;
  border-radius: .55rem;
}

.msqbc-upsell-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.msqbc-upsell-no-image {
  width: 32px;
  height: 32px;
  background: #dddddd;
  border-radius: 999px;
}

.msqbc-upsell-name {
  display: block;
  color: inherit;
  font-weight: 800;
  line-height: 1.25;
}

.msqbc-upsell-price {
  margin-top: .2rem;
  color: #1f9d8a;
  font-weight: 900;
}

.msqbc-upsell-badge {
  display: inline-block;
  margin-top: .25rem;
  padding: .15rem .4rem;
  color: #ffffff;
  background: #178a26;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

.msqbc-upsell-add {
  white-space: nowrap;
}

.msqbc-upsell-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  margin-top: .9rem;
}

@media (max-width: 575px) {
  .msqbc-upsell-modal {
    align-items: flex-end;
    padding: 0;
  }

  .msqbc-upsell-dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 1rem 1rem 0 0;
    padding: 1rem;
  }

  .msqbc-upsell-product {
    grid-template-columns: 58px 1fr;
  }

  .msqbc-upsell-image {
    width: 58px;
    height: 58px;
  }

  .msqbc-upsell-add {
    grid-column: 1 / -1;
    width: 100%;
  }

  .msqbc-upsell-actions {
    flex-direction: column;
  }

  .msqbc-upsell-actions .btn {
    width: 100%;
  }
}


/* 1.5.1: one clear checkout action in upsell popup */
.msqbc-upsell-actions {
  justify-content: stretch;
}

.msqbc-upsell-continue {
  flex: 1 1 auto;
}


/* 1.5.2: show only two upsell products first */
.msqbc-upsell-product-hidden {
  display: none !important;
}

.msqbc-upsell-show-more {
  display: inline-block;
  margin: .55rem auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #666666;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.msqbc-upsell-show-more:hover {
  color: #222222;
}
