.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(7, 7, 7, 0.62);
  backdrop-filter: blur(2px);
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3010;
  width: min(460px, 100vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  color: #161616;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.24);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 240ms ease, visibility 240ms ease;
}

.cart-drawer[aria-hidden="false"] { transform: translateX(0); visibility: visible; }
body.cart-is-open { overflow: hidden; }

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid #e5e5e5;
}

.cart-drawer__head span {
  color: #f58220;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.cart-drawer__head h2 { margin: 3px 0 0; font-size: 30px; line-height: 1; }
.cart-drawer__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #171717;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.cart-drawer__body { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.cart-items { padding: 8px 24px 0; }
.cart-item { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-bottom: 1px solid #e5e5e5; }
.cart-item__image { min-height: 104px; display: grid; place-items: center; border: 1px solid #ececec; border-radius: 12px; background: #fff; overflow: hidden; }
.cart-item__image img { width: 100%; height: 100%; max-height: 112px; object-fit: contain; }
.cart-item__image span { font-size: 34px; }
.cart-item__content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.cart-item__name { color: #171717; font-size: 15px; font-weight: 750; line-height: 1.35; text-decoration: none; }
.cart-item__price { color: #d94b00; font-size: 17px; }
.cart-item__controls { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.cart-item__controls button:not(.cart-item__remove) { width: 32px; height: 32px; border: 1px solid #d8d8d8; border-radius: 8px; background: #fff; font-size: 19px; cursor: pointer; }
.cart-item__controls output { min-width: 24px; text-align: center; font-weight: 800; }
.cart-item__remove { margin-left: 4px; border: 0; background: transparent; color: #777; font-size: 12px; text-decoration: underline; cursor: pointer; }

.cart-summary { margin-top: auto; padding: 22px 24px 28px; border-top: 1px solid #dedede; background: #fafafa; }
.cart-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.cart-summary > div span { color: #666; font-size: 14px; }
.cart-summary > div strong { font-size: 25px; }
.cart-checkout, .cart-continue { width: 100%; min-height: 52px; border: 0; border-radius: 13px; background: #f58220; color: #111; font-size: 16px; font-weight: 900; cursor: pointer; }
.cart-checkout:hover, .cart-continue:hover { background: #ff9637; }
.cart-checkout-message { margin: 12px 0 0; padding: 12px; border-left: 3px solid #f58220; background: #fff3e9; color: #3e332b; font-size: 13px; line-height: 1.45; }
.cart-checkout-message[hidden] { display: none; }

.cart-empty { margin: auto; padding: 44px 30px; text-align: center; }
.cart-empty__icon { display: block; margin-bottom: 14px; font-size: 46px; }
.cart-empty h3 { margin: 0 0 10px; font-size: 25px; }
.cart-empty p { margin: 0 0 24px; color: #666; line-height: 1.55; }

@media (max-width: 600px) {
  .cart-drawer { width: 100vw; }
  .cart-drawer__head { padding: 18px 16px 15px; }
  .cart-drawer__head h2 { font-size: 26px; }
  .cart-items { padding: 4px 16px 0; }
  .cart-item { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
  .cart-item__image { min-height: 88px; }
  .cart-summary { padding: 18px 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer { transition: none; }
}
