/* Carrinho lateral */
@media (min-width: 768px) {
  #cart-drawer.cart-drawer-root {
    zoom: calc(1 / 0.88);
    transform-origin: top right;
  }
}

#cart-drawer.cart-drawer-root {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: 120;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#cart-drawer.cart-drawer-root[data-state='open'] {
  display: flex !important;
  align-items: stretch;
  justify-content: flex-end;
}

#cart-drawer.cart-drawer-root > .cart-drawer-panel {
  width: min(100vw, 26.5rem) !important;
  max-width: 26.5rem !important;
  margin-left: auto !important;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

#cart-drawer.cart-drawer-root[data-state='open'] > .cart-drawer-panel {
  transform: translateX(0);
}

.cart-drawer-header {
  min-height: 3.5rem;
}

.cart-drawer-body {
  padding-block: 0.5rem !important;
}

.cart-drawer-item {
  display: grid;
  grid-template-columns: 3.35rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cart-drawer-item:last-child {
  border-bottom: 0;
}

.cart-drawer-item__media {
  width: 3.35rem;
  height: 3.35rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.cart-drawer-item__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-drawer-item__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.4rem;
}

.cart-drawer-item__row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.cart-drawer-item__name {
  margin: 0;
  min-width: 0;
  flex: 1;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-drawer-item__line-total {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--primary));
  white-space: nowrap;
}

.cart-drawer-item__row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.cart-drawer-item__price {
  margin: 0;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.48);
  white-space: nowrap;
}

.cart-drawer-item__price-each {
  color: rgba(255, 255, 255, 0.32);
}

.cart-drawer-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cart-drawer-item__qty-btn,
.cart-drawer-item__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cart-drawer-item__qty-btn {
  width: 1.7rem;
  height: 1.7rem;
}

.cart-drawer-item__qty-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.cart-drawer-item__qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-drawer-item__qty-input {
  width: 1.9rem;
  height: 1.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.cart-drawer-item__remove {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: 0.1rem;
  border-color: rgba(248, 113, 113, 0.22);
  color: #fca5a5;
}

.cart-drawer-item__remove:hover {
  background: rgba(248, 113, 113, 0.1);
}

.cart-drawer-empty {
  display: flex;
  min-height: min(48vh, 20rem);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  text-align: center;
}

.cart-drawer-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(69, 209, 255, 0.2);
  background: rgba(69, 209, 255, 0.08);
}

.cart-drawer-empty__title {
  margin: 0.85rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.cart-drawer-empty__text {
  margin: 0.35rem 0 0;
  max-width: 15rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.52);
}

.cart-drawer-empty__cta {
  margin-top: 1rem;
  min-height: 2.65rem;
  padding-inline: 1.15rem;
  border-radius: 0.8rem;
}

#cart-drawer.cart-drawer-root.is-empty .cart-drawer-footer {
  display: none;
}

@media (max-width: 639px) {
  #cart-drawer.cart-drawer-root > .cart-drawer-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
