/* Header cart modal */
.header-cart,
.header-cart * {
  box-sizing: border-box;
}

.header-cart {
  z-index: 99;
  text-align: left;
}

.header-cart.is-toggled .header-cart-content {
  right: 0;
  visibility: visible;
}

.header-cart.is-toggled .header-cart-overlay {
  opacity: 1;
  visibility: visible;
}

.header-cart-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 9;
}

.header-cart-content {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 0;
  right: -100%;
  width: 90%;
  height: 100vh;
  padding: 2em var(--padding) 1em;
  background: var(--bg);
  max-width: 40rem;
  max-height: 100%;
  overflow: auto;
  transition: right 0.3s ease, visibility 0.3s;
  visibility: hidden;
  z-index: 99999;
}

.header-cart-content>*:not(button) {
  width: 100%;
}

.header-cart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1em;
}

.header-cart-title {
  padding: 0;
  margin-top: 0;
  font-size: var(--fontsize-medium) !important;
}

.header-cart-close {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: var(--fg-headline);
  transition: color 0.3s;
  z-index: 10;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.header-cart-close:hover,
.header-cart-close:focus {
  color: var(--fg-hover);
}

.header-cart-close:before,
.header-cart-close:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  transform-origin: center;
  transition: background 0.3s;
}

.header-cart-close:before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.header-cart-close:after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.header-cart-empty {
  margin-top: 2em;
  text-align: center;
}

/* Product list */
.header-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  margin-bottom: 1em;
}

.header-cart-list:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--fg, #000);
  opacity: 0.2;
}

.header-cart-item {
  position: relative;
  display: flex;
  gap: 1em;
  padding-top: 1em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--fg-muted);
}

.header-cart-item-link {
  display: flex;
  text-decoration: none;
  flex: 1;
  gap: 1em;
}

.header-cart-item-link:hover,
.header-cart-item-link:focus {
  text-decoration: none;
}

.header-cart-item a:hover .header-cart-item-title,
.header-cart-item a:focus .header-cart-item-title {
  color: var(--fg-hover);
}

.header-cart-item-image {
  flex-shrink: 0;
  width: 4em;
}

.header-cart-item-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.header-cart-item-text {
  flex: 1;
  font-size: var(--fontsize-small);
}

.header-cart-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0 1em;
}

.header-cart-item-title {
  margin: 0;
  padding: 0;
  font-size: var(--fontsize-medium) !important;
}

.header-cart-item-total {
  font: var(--font-headline);
  font-size: var(--fontsize-medium) !important;
}

.header-cart-item-price {
  display: block;
}

.header-cart-item-detail {
  display: block;
}

.header-cart-item-remove {
  position: relative;
  display: block;
  width: 1em;
  height: 1em;
  margin-left: auto;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.header-cart-item-remove:hover:before,
.header-cart-item-remove:hover:after,
.header-cart-item-remove:focus:before,
.header-cart-item-remove:focus:after {
  background: var(--fg-hover);
}

.header-cart-item-remove:before,
.header-cart-item-remove:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 1em;
  background: var(--fg-headline);
  transform-origin: center;
}

.header-cart-item-remove:before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.header-cart-item-remove:after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.header-cart-footer {
  margin-top: auto;
  margin-bottom: 1em;
}

.header-cart-footer-row {
  display: flex;
  padding-bottom: 0;
}

.header-cart-footer-heading {
  padding-right: 2rem;
}

.header-cart-footer-amount {
  margin-left: auto;
}

.header-cart-footer-note {
  font-size: 80%;
}

.header-cart-buttons {
  display: flex;
  gap: 1em;
}

.header-cart-buttons>* {
  flex: 1;
}

@media screen and (max-width: 480px) {
  .header-cart-buttons {
    flex-direction: column;
  }
}

/* Mini cart toggle button */
.woocommerce-mini-cart-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  cursor: pointer;
  color: var(--fg-headline);
}

.woocommerce-mini-cart-toggle:hover,
.woocommerce-mini-cart-toggle:focus {
  color: var(--fg-hover);
}

.woocommerce-mini-cart-toggle:hover .woocommerce-mini-cart-amount,
.woocommerce-mini-cart-toggle:focus .woocommerce-mini-cart-amount {
  background: var(--fg-hover);
  color: var(--bg);
}

.woocommerce-mini-cart-toggle .woocommerce-mini-cart-amount {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--bg);
  background: var(--fg-headline);
  min-width: unset;
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transform: translate(40%, -25%);
}

.woocommerce-mini-cart-toggle .woocommerce-mini-cart-icon {
  display: flex;
  align-items: center;
}

.woocommerce-mini-cart-toggle .woocommerce-mini-cart-icon svg {
  width: 1.25rem;
  height: auto;
  fill: currentColor;
}

.woocommerce-mini-cart-toggle .woocommerce-mini-cart-text {
  display: none;
}

/* Text changes handled by JS */
.woocommerce-mini-cart-toggle.is-toggled .woocommerce-mini-cart-text {}