.cart-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--white);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.cart-button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--white);
  color: var(--brand-red);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.header-cart-label {
  display: inline-block;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.cart-overlay {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, .75);
  opacity: 0;
  transition: opacity .28s ease;
}

.cart-drawer {
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  height: 100dvh;
  min-height: 100%;
  background: var(--soft-gray);
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  transform: translateX(100%);
  transition: transform .28s ease;
}

.cart-overlay.is-open {
  opacity: 1;
}

.cart-overlay.is-open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  min-height: 82px;
  background: var(--white);
  color: var(--ink);
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.cart-drawer-header h2 {
  margin: 0;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
}

.close-cart-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 4px;
}

.close-cart-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty-cart-message {
  flex: 1;
  margin: 0;
  padding: 100px 24px;
  color: rgba(0, 0, 0, .6);
  text-align: center;
}

.cart-item-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 10px;
  list-style: none;
}

.cart-item-list li {
  margin-bottom: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px 12px;
  min-height: 108px;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 0px 0px rgba(0, 0, 0, .14);
}

.cart-item-image {
  align-self: center;
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.cart-item-details {
  min-width: 0;
  align-self: center;
}

.cart-item-name,
.cart-item-price,
.cart-item-stock {
  display: block;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
}

.cart-item-name {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
}

.cart-item-price {
  margin-top: 6px;
  color: var(--brand-red);
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.cart-item-stock {
  margin-top: 2px;
  color: #579c59;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.cart-item-stock.is-low-stock {
  color: var(--brand-red);
}

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

.cart-quantity-controls {
  display: inline-flex;
  align-items: center;
  gap: 0px;
}

.cart-quantity-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: var(--ink);
  padding: 0;
}

.cart-quantity-button-decrease {
  background-image: url("../images/cart-quantity-minus_thin.png");
}

.cart-quantity-button-increase {
  background-image: url("../images/cart-quantity-plus-thin.png");
}

.cart-quantity-button:hover:not(:disabled) {
  filter: contrast(1.25);
}

.cart-quantity-button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.cart-quantity-value {
  width: 42px;
  min-width: 42px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  outline: none;
  appearance: textfield;
  box-shadow: inset 0 -2px 0 var(--soft-gray);
}

.cart-quantity-value:focus {
  box-shadow: inset 0 -2px 0 var(--brand-red);
}

.cart-quantity-value::-webkit-inner-spin-button,
.cart-quantity-value::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.cart-delete-button {
  border: 0;
  border-radius: 5px;
  background: #e5e5e5;
  color: var(--ink);
  padding: 10px 15px;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.cart-delete-button:hover {
  background: #d8d8d8;
}

.cart-min-order {
  margin-top: auto;
  margin-bottom: 0;
  background: var(--soft-gray);
  color: var(--muted-text);
  padding: 10px 16px 6px;
  text-align: center;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.25;
}

.cart-footer {
  display: block;
  background: var(--white);
  padding: 14px 16px 18px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
}

.cart-total-row span {
  min-width: 0;
}

.cart-total-row strong {
  flex: 0 0 auto;
  color: var(--brand-red);
  font-weight: 600;
}

.cart-checkout-button,
.clear-cart-button {
  width: 100%;
  border-radius: 5px;
  padding: 13px 14px;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.cart-checkout-button {
  margin-top: 16px;
  border: 0;
  background: var(--brand-green);
  color: var(--white);
  box-shadow: 0 0px 0px rgba(0, 0, 0, .18);
}

.cart-checkout-button:hover:not(:disabled) {
  background: #77bf79;
}

.cart-checkout-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.clear-cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
}

.clear-cart-button::before {
  width: 18px;
  height: 18px;
  content: "";
  background-image: url("../images/cart-clear-all.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.clear-cart-button:hover:not(:disabled) {
  border-color: var(--brand-red);
  background: var(--brand-red);
  color: var(--white);
}

.clear-cart-button:hover:not(:disabled)::before {
  filter: invert(1);
}

.clear-cart-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
@media (prefers-reduced-motion: reduce) {
  .cart-overlay,
  .cart-drawer {
    transition: none;
  }
}
