/* ============================================
   CART DRAWER
   ============================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,17,8,0.5);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(2px);
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--white);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(26,17,8,0.15);
}
.cart-drawer.open { transform: translateX(0) }
.cart-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-header-left { display:flex; align-items:center; gap:10px }
.cart-title { font-size: 17px; font-weight: 800; color: var(--text) }
.cart-count-badge {
  background: var(--maroon);
  color: rgb(var(--maroon-fg-rgb));
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}
.cart-close-btn {
  width: 34px; height: 34px;
  background: var(--light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0;
  color: var(--gray-2);
  position: relative;
  transition: var(--tr);
}
.cart-close-btn:hover { background: var(--maroon-pale); color: var(--maroon) }
/* ✕ drawn as two crossed lines instead of the font glyph — same
   off-center-glyph issue as .modal-close. */
.cart-close-btn::before,
.cart-close-btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 13px; height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.cart-close-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.cart-close-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  display: none;
}
.cart-empty-icon { font-size: 56px; opacity: 0.3 }
.cart-empty-text { font-size: 15px; font-weight: 700; color: var(--gray-2) }
.cart-empty-sub  { font-size: 13px; color: var(--gray); text-align:center }

/* Cart Item */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none }
.cart-item-img {
  width: 66px; height: 66px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--light);
  flex-shrink: 0;
}
.cart-item-img img { width:100%; height:100%; object-fit:cover }
.cart-item-img-placeholder {
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  font-size:28px;
}
.cart-item-info { flex: 1; min-width: 0 }
.cart-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-variant { font-size: 12px; color: var(--gray); margin-bottom: 5px }
.cart-item-price { font-size: 14px; font-weight: 800; color: var(--maroon) }
.cart-item-actions { display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex-shrink:0 }
.cart-item-del {
  width: 26px; height: 26px;
  background: var(--red-pale);
  color: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0;
  position: relative;
  transition: var(--tr);
}
.cart-item-del:hover { background: var(--red); color: white }
/* ✕ drawn as two crossed lines instead of the font glyph — same
   off-center-glyph issue as .modal-close. */
.cart-item-del::before,
.cart-item-del::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.cart-item-del::before { transform: translate(-50%, -50%) rotate(45deg); }
.cart-item-del::after { transform: translate(-50%, -50%) rotate(-45deg); }
.qty-ctrl { display:flex; align-items:center; gap:0; border:1.5px solid var(--border-2); border-radius: var(--r-sm); overflow:hidden }
.qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items:center; justify-content:center;
  font-size: 16px;
  color: var(--maroon);
  font-weight: 700;
  transition: var(--tr);
}
.qty-btn:hover { background: var(--maroon-pale) }
.qty-val {
  width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  line-height: 28px;
}

/* Cart Footer */
.cart-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px 20px;
  flex-shrink: 0;
}
.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.cart-summary-label { color: var(--gray-2) }
.cart-summary-val { font-weight: 700; color: var(--text) }
.cart-summary-val.discount { color: var(--green) }
.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  margin-bottom: 16px;
}
.cart-total-label { font-size: 15px; font-weight: 700; color: var(--text) }
.cart-total-price { font-size: 20px; font-weight: 800; color: var(--maroon) }
.btn-checkout {
  width: 100%;
  background: var(--maroon);
  color: rgb(var(--maroon-fg-rgb));
  font-size: 15px;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--r);
  transition: var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}
.btn-checkout:hover { background: var(--maroon-d); box-shadow: 0 4px 16px rgba(123,28,28,0.3) }
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed }
.cart-continue {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-top: 10px;
  cursor: pointer;
  transition: var(--tr);
}
.cart-continue:hover { color: var(--maroon) }
