.sf-cart-flyout {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.sf-cart-flyout[hidden] {
  display: none;
}

.sf-cart-flyout__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 38, 43, 0.5);
}

.sf-cart-flyout__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--sf-bg);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sf-cart-flyout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sf-border);
}

.sf-cart-flyout__header h2 {
  margin: 0;
  font-family: var(--sf-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sf-text);
}

.sf-cart-flyout__close {
  display: inline-flex;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sf-text);
  padding: 0.4rem;
}

.sf-cart-flyout__body {
  padding: 1.25rem 1.5rem;
  color: var(--sf-text);
}

.sf-cart-flyout__body .widget_shopping_cart_content {
  font-family: var(--sf-font);
}

.sf-cart-flyout__body ul.woocommerce-mini-cart {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.sf-cart-flyout__body ul.woocommerce-mini-cart li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--sf-border);
  position: relative;
}

.sf-cart-flyout__body ul.woocommerce-mini-cart li img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--sf-border);
}

.sf-cart-flyout__body ul.woocommerce-mini-cart li a:not(.remove) {
  color: var(--sf-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.sf-cart-flyout__body ul.woocommerce-mini-cart li .quantity {
  display: block;
  font-size: 0.82rem;
  color: var(--sf-text-muted);
  margin-top: 0.25rem;
}

.sf-cart-flyout__body ul.woocommerce-mini-cart li a.remove {
  position: absolute;
  top: 0.85rem;
  right: 0;
  color: var(--sf-text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
}

.sf-cart-flyout__body .woocommerce-mini-cart__empty-message {
  color: var(--sf-text-muted);
}

.sf-cart-flyout__body .woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--sf-text);
  padding-top: 1rem;
  margin: 0 0 1.25rem;
}

.sf-cart-flyout__body .woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
}

.sf-cart-flyout__body .woocommerce-mini-cart__buttons a {
  display: block;
  text-align: center;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--sf-text);
  color: var(--sf-text);
}

.sf-cart-flyout__body .woocommerce-mini-cart__buttons a.checkout {
  background: var(--sf-accent);
  border-color: var(--sf-accent);
  color: var(--sf-text-inverse);
}

/* Trigger — a sticky tab on the right edge for PC, a floating round
   button bottom-right on mobile. Reuses .sf-cart-count (already styled,
   already wired into the site's live cart-count fragment) for the badge. */

.sf-cart-fab {
  position: fixed;
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: var(--sf-accent) !important;
  color: var(--sf-text-inverse) !important;
}

.sf-cart-fab svg {
  display: block;
  stroke: currentColor !important;
}

@media (min-width: 861px) {
  .sf-cart-fab {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    padding: 1rem 0.7rem;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.12);
  }
}

@media (max-width: 860px) {
  .sf-cart-fab {
    /* Astra ships its own floating scroll-to-top button at the same
       bottom-right corner (#ast-scroll-top, renders after this in the
       DOM so it paints on top) — sitting higher up clears it entirely
       instead of fighting over z-index/stacking order. */
    bottom: 5.5rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    z-index: 99999;
  }

  .sf-header__cart {
    display: none;
  }
}
