.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 1000101;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  font-family: "Hind Siliguri", "Inter", system-ui, sans-serif;
  overflow: hidden;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.cart-drawer-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1a1a;
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  padding: 4px 0;
}

.cart-drawer-close:hover {
  color: #000;
}

.cart-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 24px;
  scroll-padding-top: 16px;
  scroll-padding-bottom: 24px;
}

.cart-drawer-empty {
  text-align: center;
  color: #666;
  padding: 40px 16px;
  font-size: 15px;
  line-height: 1.5;
}

.cart-drawer-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
}

.cart-drawer-item-main {
  flex: 1;
  min-width: 0;
}

.cart-drawer-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cart-drawer-item:first-child {
  padding-top: 6px;
}

.cart-drawer-item:last-child {
  border-bottom: none;
  padding-bottom: 8px;
}

.cart-drawer-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-drawer-thumb-placeholder {
  font-size: 28px;
  opacity: 0.4;
}

.cart-drawer-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.cart-drawer-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  align-self: start;
}

.cart-drawer-remove:hover {
  color: #c00;
}

.cart-drawer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cart-drawer-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.cart-drawer-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  color: #333;
  line-height: 1;
}

.cart-drawer-qty button:hover {
  background: #f5f5f5;
}

.cart-drawer-qty span {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  padding: 0 4px;
  line-height: 32px;
}

.cart-drawer-line-price {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
}

.cart-drawer-foot {
  flex-shrink: 0;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eee;
  background: #fff;
}

.cart-drawer-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 15px;
}

.cart-drawer-total-row strong {
  font-size: 18px;
  color: #1a1a1a;
}

.cart-drawer-checkout {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 16px;
  background: #f97316;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.cart-drawer-checkout:hover {
  background: #ea580c;
}

body.cart-drawer-open {
  overflow: hidden;
}

.nav-icons .cart-drawer-trigger {
  position: relative;
}
