/* Cart-specific layout refinements. */
body.cart-drawer-open,
body.cart-export-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.cart-panel-root {
  z-index: 2000;
}

.cart-panel-root.is-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2001;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(2px);
}

.cart-float-button {
  z-index: 2002;
}

.cart-drawer {
  z-index: 2003;
}

.cart-panel-root.is-open .cart-float-button {
  z-index: 2002;
}

.cart-panel-root.is-open .cart-drawer {
  z-index: 2003;
}

.cart-item-card {
  grid-template-columns: auto 54px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.cart-item-check {
  padding-top: 16px;
}

.cart-item-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}

.cart-item-main {
  gap: 6px;
}

.cart-item-title strong {
  font-size: 0.9rem;
}

.cart-item-title .cart-remove {
  width: 28px;
  height: 28px;
}

.cart-item-metrics {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cart-item-metrics span {
  display: grid;
  min-width: 0;
  min-height: 38px;
  gap: 2px;
  justify-items: start;
  padding: 5px 6px;
  border-radius: 11px;
  background: #f8fafc;
}

.cart-item-metrics em {
  overflow: hidden;
  max-width: 100%;
  color: #8a94a6;
  font-size: 0.57rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-metrics b {
  overflow: hidden;
  max-width: 100%;
  color: #111827;
  font-size: 0.72rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cart-item-action-row .cart-qty-control {
  flex: 0 0 auto;
}

.cart-item-action-row .cart-qty-control button {
  width: 30px;
  height: 30px;
}

.cart-item-action-row .cart-qty-control input {
  width: 42px;
  height: 30px;
}

.cart-line-total {
  display: flex;
  min-width: 0;
  min-height: 30px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.08);
  font-size: 0.82rem;
  font-weight: 950;
}

.cart-line-total:empty {
  border: 1px dashed rgba(193, 198, 215, 0.62);
  background: transparent;
}

.cart-export-preview-backdrop {
  z-index: 2600;
  overscroll-behavior: contain;
}

.cart-export-preview footer {
  flex-wrap: wrap;
}

.cart-share-button {
  display: none;
}

@media (max-width: 720px) {
  .cart-item-card {
    grid-template-columns: auto 48px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }

  .cart-item-thumb {
    width: 48px;
    height: 48px;
  }

  .cart-item-title strong {
    font-size: 0.84rem;
  }

  .cart-item-metrics {
    gap: 3px;
  }

  .cart-item-metrics span {
    min-height: 34px;
    padding: 4px 5px;
  }

  .cart-item-metrics em {
    font-size: 0.52rem;
  }

  .cart-item-metrics b {
    font-size: 0.66rem;
  }

  .cart-item-action-row {
    gap: 6px;
  }

  .cart-line-total {
    min-height: 28px;
    padding-inline: 8px;
    font-size: 0.74rem;
  }

  .cart-share-button {
    display: inline-flex;
  }

  .cart-export-preview footer .primary-button,
  .cart-export-preview footer .ghost-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

body.phone-preview .cart-item-card {
  grid-template-columns: auto 48px minmax(0, 1fr);
  gap: 7px;
  padding: 7px;
}

body.phone-preview .cart-item-thumb {
  width: 48px;
  height: 48px;
}

body.phone-preview .cart-item-title strong {
  font-size: 0.84rem;
}

body.phone-preview .cart-item-metrics {
  gap: 3px;
}

body.phone-preview .cart-item-metrics span {
  min-height: 34px;
  padding: 4px 5px;
}

body.phone-preview .cart-item-metrics em {
  font-size: 0.52rem;
}

body.phone-preview .cart-item-metrics b {
  font-size: 0.66rem;
}

body.phone-preview .cart-item-action-row {
  gap: 6px;
}

body.phone-preview .cart-line-total {
  min-height: 28px;
  padding-inline: 8px;
  font-size: 0.74rem;
}

body.phone-preview .cart-share-button {
  display: inline-flex;
}

body.phone-preview .cart-export-preview footer .primary-button,
body.phone-preview .cart-export-preview footer .ghost-button {
  flex: 1 1 auto;
  justify-content: center;
}
