/* checkoutdelivery: compact add-to-cart window on phones and calmer cart totals
   (setting "Compact cart window and totals"). Loaded on every page. */

/* ------------------------------------------------------------------ */
/* Cart totals (cart page, checkout summary)                           */
/* ------------------------------------------------------------------ */

body .cart-summary hr,
body .cart-detailed-totals hr {
  margin-top: 0;
  margin-bottom: 0;
}

body .cart-summary-subtotals-container,
body .cart-detailed-totals > .card-body {
  padding-top: 12px;
  padding-bottom: 12px;
}

body .cart-summary .cart-summary-line:not(.cart-total),
body .cart-detailed-totals .cart-summary-line:not(.cart-total) {
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.5;
}

body .cart-summary-totals {
  padding-top: 14px;
  padding-bottom: 14px;
}

body .cart-summary-totals .cart-summary-line.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* themes add a clearfix ::before/::after: as flex items they would push the amount to the middle */
body .cart-summary-totals .cart-summary-line.cart-total::before,
body .cart-summary-totals .cart-summary-line.cart-total::after {
  content: none;
  display: none;
}

body .cart-summary-totals .cart-summary-line.cart-total .label,
body .cart-summary-totals .cart-summary-line.cart-total .value {
  float: none;
  margin: 0;
  padding: 0;
  color: #1f2328;
  letter-spacing: 0;
  text-transform: none;
}

body .cart-summary-totals .cart-summary-line.cart-total .label {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

body .cart-summary-totals .cart-summary-line.cart-total .value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 767px) {
  body .cart-summary-totals .cart-summary-line.cart-total .label {
    font-size: 15px;
  }

  body .cart-summary-totals .cart-summary-line.cart-total .value {
    font-size: 18px;
  }
}

/* ------------------------------------------------------------------ */
/* Add-to-cart window on phones: a card with space around it           */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
  #blockcart-modal .modal-dialog {
    display: flex;
    align-items: center;
    width: auto;
    max-width: none;
    height: auto;
    min-height: calc(100% - 48px);
    margin: 24px 16px;
    /* taps beside the card reach the backdrop and close the window */
    pointer-events: none;
  }

  #blockcart-modal .modal-content {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
  }

  #blockcart-modal .modal-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 8px 12px 16px;
    border-bottom: 1px solid #eef0f2;
  }

  #blockcart-modal .modal-title {
    flex: 1 1 auto;
    margin: 0;
    padding-top: 6px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
  }

  #blockcart-modal .modal-header .close {
    order: 2;
    float: none;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    font-size: 26px;
    line-height: 40px;
    text-align: center;
    opacity: 0.6;
  }

  #blockcart-modal .modal-body {
    padding: 14px 16px 16px;
    font-size: 14px;
  }

  /* product image: small thumbnail next to the name instead of half of the window */
  #blockcart-modal .modal-body img {
    width: 80px;
    max-width: 80px;
    height: auto;
  }

  #blockcart-modal .modal-body .row:has(> [class*="col"] img) {
    display: flex;
    flex-wrap: wrap;
  }

  #blockcart-modal .modal-body [class*="col"]:has(img):not(:has([class*="col"])) {
    flex: 0 0 96px;
    width: 96px;
    max-width: 96px;
  }

  #blockcart-modal .modal-body [class*="col"]:has(img):not(:has([class*="col"])) + [class*="col"] {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  #blockcart-modal .modal-body .product-name,
  #blockcart-modal .modal-body h6,
  #blockcart-modal .modal-body .h6 {
    font-size: 15px;
    line-height: 1.35;
  }

  #blockcart-modal .modal-body p {
    margin-bottom: 6px;
  }

  #blockcart-modal .modal-body .btn {
    min-height: 46px;
    margin-top: 8px;
    padding-top: 11px;
    padding-bottom: 11px;
    border-radius: 8px;
    font-size: 15px;
  }
}

body .modal-backdrop.in,
body .modal-backdrop.show {
  opacity: 0.5;
}
