body.cart-open {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}

/* Keep the primary shopping action consistent across home, shop and product pages. */
.btn.btn-primary.add-to-cart {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease,
    box-shadow .25s ease, transform .25s ease;
}

.btn.btn-primary.add-to-cart:hover {
  border-color: #245F73;
  background: #245F73;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(36, 95, 115, .22);
  transform: translateY(-2px);
}

.btn.btn-primary.add-to-cart:focus-visible {
  outline: 3px solid rgba(36, 95, 115, .3);
  outline-offset: 3px;
}

.btn.btn-primary.add-to-cart:disabled {
  background: #7b8385;
  border-color: #7b8385;
  color: #fff;
  cursor: not-allowed;
  opacity: .72;
  transform: none;
}

.cart-layer[hidden],
.checkout-prompt-layer[hidden] {
  display: none !important;
}

.cart-layer,
.checkout-prompt-layer {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 27, 29, .62);
  backdrop-filter: blur(9px);
}

.cart-panel {
  width: min(1180px, 100%);
  max-height: min(850px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid rgba(36, 95, 115, .17);
  border-radius: 24px;
  background: #F2F0EF;
  box-shadow: 0 34px 100px rgba(11, 18, 20, .28);
}

.cart-panel-header {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(36, 95, 115, .14);
  background: rgba(242, 240, 239, .96);
  backdrop-filter: blur(14px);
}

.cart-panel-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -.035em;
}

.cart-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid #BBBDBC;
  border-radius: 50%;
  background: #fff;
  color: #245F73;
  font-size: 1.35rem;
  cursor: pointer;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  align-items: start;
}

.cart-summary-panel,
.checkout-form-panel {
  padding: clamp(22px, 3.5vw, 42px);
}

.checkout-form-panel {
  min-height: 100%;
  border-left: 1px solid rgba(36, 95, 115, .14);
  background: #fff;
}

.cart-kicker {
  color: #733E24;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.cart-summary-panel h3,
.checkout-form-panel h3 {
  margin-top: 6px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  letter-spacing: -.025em;
}

.cart-items {
  margin-top: 22px;
  display: grid;
  gap: 13px;
}

.cart-empty {
  padding: 26px 18px;
  border: 1px dashed rgba(36, 95, 115, .28);
  border-radius: 15px;
  color: #626c6f;
  text-align: center;
}

.cart-item {
  padding: 11px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 13px;
  border: 1px solid rgba(36, 95, 115, .14);
  border-radius: 15px;
  background: #fff;
}

.cart-item-image {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 11px;
  background: #e8e6e0;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cart-item-title {
  font-size: .92rem;
  line-height: 1.25;
}

.cart-item-price {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: #245F73;
  font-weight: 850;
}

.cart-regular-total {
  color: #7a8385;
  font-size: .78em;
  font-weight: 700;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.cart-item-variant {
  margin-top: 4px;
  color: #6b7476;
  font-size: .76rem;
}

.cart-item-saving {
  margin-top: 3px;
  color: #1e7658;
  font-size: .73rem;
  font-weight: 800;
}

.cart-item-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #BBBDBC;
  border-radius: 999px;
  overflow: hidden;
}

.quantity-control button {
  width: 32px;
  height: 30px;
  border: 0;
  background: #F2F0EF;
  color: #245F73;
  cursor: pointer;
}

.quantity-control span {
  min-width: 28px;
  text-align: center;
  font-size: .84rem;
  font-weight: 800;
}

.remove-item {
  border: 0;
  background: transparent;
  color: #733E24;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}

.cart-totals {
  margin-top: 22px;
  padding-top: 17px;
  display: grid;
  gap: 9px;
  border-top: 1px solid rgba(36, 95, 115, .16);
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #5f696c;
  font-size: .9rem;
}

.total-row.grand-total {
  margin-top: 5px;
  color: #202426;
  font-size: 1.08rem;
  font-weight: 900;
}

.total-row.savings-row {
  color: #1e7658;
  font-weight: 800;
}

.total-row.promo-saving-row {
  color: #733E24;
  font-weight: 800;
}

.promo-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(36, 95, 115, .16);
}

.promo-panel > label {
  display: block;
  margin-bottom: 8px;
  color: #202426;
  font-size: .84rem;
  font-weight: 850;
}

.promo-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.promo-entry input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #BBBDBC;
  border-radius: 11px;
  background: #fff;
  color: #202426;
  font: inherit;
  font-size: 16px;
  text-transform: uppercase;
}

.promo-entry input:focus {
  border-color: #245F73;
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 95, 115, .12);
}

.promo-entry button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.promo-entry button:hover {
  background: #245F73;
}

.promo-status {
  min-height: 18px;
  margin-top: 7px;
  color: #667174;
  font-size: .76rem;
}

.promo-status.success {
  color: #176443;
  font-weight: 750;
}

.promo-status.error {
  color: #9a2d26;
  font-weight: 750;
}

.checkout-intro {
  margin-top: 7px;
  color: #667073;
  font-size: .9rem;
}

.checkout-form {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.checkout-field {
  display: grid;
  gap: 6px;
}

.checkout-field.full-width {
  grid-column: 1 / -1;
}

.checkout-field label {
  font-size: .82rem;
  font-weight: 800;
}

.checkout-field input,
.checkout-field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid #BBBDBC;
  border-radius: 11px;
  background: #fff;
  color: #202426;
  font-size: 16px;
  outline: none;
}

.checkout-field input:focus,
.checkout-field select:focus {
  border-color: #245F73;
  box-shadow: 0 0 0 3px rgba(36, 95, 115, .12);
}

.checkout-submit {
  grid-column: 1 / -1;
  min-height: 51px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: #733E24;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.checkout-submit:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.checkout-status {
  grid-column: 1 / -1;
  min-height: 20px;
  color: #245F73;
  font-size: .84rem;
}

.checkout-status.success {
  color: #176443;
  font-weight: 750;
}

.checkout-status.error {
  color: #9a2d26;
  font-weight: 750;
}

.checkout-prompt {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(36, 95, 115, .17);
  border-radius: 22px;
  background: #F2F0EF;
  box-shadow: 0 30px 90px rgba(11, 18, 20, .28);
  text-align: center;
}

.checkout-prompt-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #245F73;
  color: #fff;
  font-size: 1.3rem;
}

.checkout-prompt h2 {
  font-size: 1.8rem;
  letter-spacing: -.035em;
}

.checkout-prompt p {
  margin-top: 8px;
  color: #626c6f;
}

.checkout-prompt-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prompt-button {
  min-height: 47px;
  padding: 11px 14px;
  border: 1px solid #BBBDBC;
  border-radius: 999px;
  background: #fff;
  color: #245F73;
  font-weight: 800;
  cursor: pointer;
}

.prompt-button.primary {
  border-color: #733E24;
  background: #733E24;
  color: #fff;
}

.cart-toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2600;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 17px;
  border-radius: 12px;
  background: #fff;
  color: #202426;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .cart-layer {
    padding: 0;
    place-items: stretch;
  }

  .cart-panel {
    width: 100%;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-form-panel {
    border-top: 1px solid rgba(36, 95, 115, .14);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .cart-panel-header {
    padding: 13px 16px;
  }

  .cart-summary-panel,
  .checkout-form-panel {
    padding: 22px 16px;
  }

  .cart-item {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
  }

  .cart-item-image {
    width: 70px;
    height: 70px;
  }

  .cart-item-top {
    display: grid;
    gap: 4px;
  }

  .checkout-form {
    grid-template-columns: 1fr;
  }

  .checkout-field,
  .checkout-field.full-width,
  .checkout-submit,
  .checkout-status {
    grid-column: 1;
  }

  .checkout-prompt-layer {
    align-items: end;
    padding: 12px;
  }

  .checkout-prompt {
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: 22px;
  }

  .checkout-prompt-actions {
    grid-template-columns: 1fr;
  }

  .cart-toast {
    right: 16px;
    left: 16px;
    text-align: center;
  }
}
