.shop-cart-open[hidden],
.shop-cart-dialog [hidden] {
  display: none;
}

.shop-cart-open {
  position: fixed;
  z-index: 40;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  gap: .65rem;
  padding: .65rem .95rem;
  border-color: #d5b65e;
  background: #511b1a;
  color: #fff;
  box-shadow: 0 4px 18px #18130d40;
}

.shop-cart-open span {
  min-width: 1.55rem;
  padding: .12rem .35rem;
  border-radius: 1rem;
  background: #efdb9c;
  color: #291519;
  text-align: center;
}

.shop-cart-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shop-group .producer-grid .shop-card:has(.shop-cart-add) {
  height: auto;
  min-height: 385px;
}

.shop-group .producer-grid .shop-card .shop-cart-add {
  align-self: stretch;
  min-height: 2.75rem;
  margin-top: .5rem;
  padding: .4rem .5rem;
  text-align: center;
  font-size: .76rem;
  line-height: 1.2;
}

body:has(.shop-cart-open:not([hidden])) .site-footer-unified {
  margin-bottom: calc(4.75rem + env(safe-area-inset-bottom));
}

.shop-cart-dialog {
  width: min(620px, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: clamp(.85rem, 3vw, 1.65rem);
  overflow: auto;
  overscroll-behavior: contain;
  color: #231d18;
}

.shop-cart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.shop-cart-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.9rem);
}

.shop-cart-heading button,
.shop-cart-quantity button,
.shop-cart-remove {
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
  color: #511b1a;
  border: 1px solid #c9b39e;
  background: #fff;
}

.shop-cart-heading button {
  font-size: 1.45rem;
  flex: none;
}

.shop-cart-lines {
  list-style: none;
  margin: .85rem 0 0;
  padding: 0;
}

.shop-cart-line {
  display: grid;
  gap: .4rem;
  padding: .65rem 0;
  border-bottom: 1px solid #d7cbb7;
}

.shop-cart-product {
  display: grid;
  gap: .2rem;
  overflow-wrap: anywhere;
}

.shop-cart-product span {
  font-size: .85rem;
  color: #554739;
}

.shop-cart-line-actions,
.shop-cart-quantity {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.shop-cart-line-actions {
  flex-wrap: wrap;
  justify-content: space-between;
}

.shop-cart-quantity {
  text-align: center;
}

.shop-cart-quantity span {
  min-width: 1.2rem;
}

.shop-cart-quantity button:disabled {
  cursor: default;
  opacity: .55;
}

.shop-cart-remove {
  border-color: transparent;
  background: transparent;
  padding: 0 .25rem;
  text-decoration: underline;
}

.shop-cart-form {
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
  margin-top: .9rem;
}

.shop-cart-form p {
  margin: 0;
  font-size: .9rem;
}

.shop-cart-total {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: 1.1rem;
}

.shop-cart-form input {
  max-width: 12rem;
}

.shop-cart-contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.shop-cart-status {
  padding: .6rem .8rem;
  border-left: .2rem solid #476143;
  background: #f0f3eb;
}

.shop-cart-status-error {
  border-color: #761e1e;
  background: #fff2ef;
}

@media (max-width: 420px) {
  .shop-cart-contact {
    grid-template-columns: 1fr;
  }
}
