/* ========================================================
   CL Cart Drawer — matches choicelegacy.com.bd design
   ======================================================== */

/* ---------- Overlay ---------- */
.cl-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1099;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cl-cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Drawer wrapper (full viewport) ---------- */
.cl-cart-drawer-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}
.cl-cart-drawer-wrapper .cl-cart-drawer {
  pointer-events: auto;
}

/* ---------- Drawer panel ---------- */
.cl-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.cl-cart-drawer.active {
  transform: translateX(0);
}

/* ---------- Header ---------- */
.cl-cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.cl-cart-drawer__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text_color, #1a1a1a);
  margin: 0;
  letter-spacing: -0.2px;
}
.cl-cart-drawer__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  color: #333;
  transition: background 0.2s, color 0.2s;
}
.cl-cart-drawer__close:hover {
  background: var(--base_color, #FB6F92);
  color: #fff;
}

/* ---------- Body (scrollable) ---------- */
.cl-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Single item ---------- */
.cl-cart-drawer__item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}
.cl-cart-drawer__item-image {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f8f8;
}
.cl-cart-drawer__item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Item details ---------- */
.cl-cart-drawer__item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cl-cart-drawer__item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text_color, #1a1a1a);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cl-cart-drawer__item-name:hover {
  color: var(--base_color, #FB6F92);
}
.cl-cart-drawer__item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--base_color, #FB6F92);
  margin: 2px 0;
}

/* ---------- Qty row ---------- */
.cl-cart-drawer__item-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.cl-cart-drawer__qty-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}
.cl-cart-drawer__qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.cl-cart-drawer__qty-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #fafafa;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
}
.cl-cart-drawer__qty-btn:hover:not(:disabled) {
  background: #eee;
}
.cl-cart-drawer__qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cl-cart-drawer__qty-input {
  width: 36px;
  height: 30px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #fff;
  outline: none;
}

/* ---------- Item actions (Remove / Wishlist) ---------- */
.cl-cart-drawer__item-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.cl-cart-drawer__item-remove,
.cl-cart-drawer__item-wishlist {
  font-size: 12px;
  font-weight: 500;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s;
}
.cl-cart-drawer__item-remove:hover,
.cl-cart-drawer__item-wishlist:hover {
  color: var(--base_color, #FB6F92);
}

/* ---------- Cart Note ---------- */
.cl-cart-drawer__note {
  padding: 18px 0 4px;
}
.cl-cart-drawer__note-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  display: block;
}
.cl-cart-drawer__note-input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #333;
  resize: vertical;
  min-height: 52px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.cl-cart-drawer__note-input:focus {
  border-color: var(--base_color, #FB6F92);
  box-shadow: 0 0 0 2px rgba(251, 111, 146, 0.15);
}
.cl-cart-drawer__note-input::placeholder {
  color: #bbb;
}

/* ---------- Footer ---------- */
.cl-cart-drawer__footer {
  flex-shrink: 0;
  padding: 18px 24px 24px;
  border-top: 1px solid #eee;
  background: #fff;
}

/* ---------- Summary ---------- */
.cl-cart-drawer__summary {
  margin-bottom: 18px;
}
.cl-cart-drawer__summary-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text_color, #1a1a1a);
  margin: 0 0 12px;
}
.cl-cart-drawer__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.cl-cart-drawer__summary-label {
  font-size: 14px;
  font-weight: 500;
  color: #666;
}
.cl-cart-drawer__summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text_color, #1a1a1a);
}
.cl-cart-drawer__summary-row--total {
  border-top: 1px solid #eee;
  margin-top: 4px;
  padding-top: 10px;
}
.cl-cart-drawer__summary-row--total .cl-cart-drawer__summary-label {
  font-weight: 600;
  color: var(--text_color, #1a1a1a);
}
.cl-cart-drawer__summary-row--total .cl-cart-drawer__summary-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--base_color, #FB6F92);
}

/* ---------- Buttons ---------- */
.cl-cart-drawer__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cl-cart-drawer__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.cl-cart-drawer__btn--outline {
  border: 1.5px solid var(--base_color, #FB6F92);
  background: transparent;
  color: var(--base_color, #FB6F92);
}
.cl-cart-drawer__btn--outline:hover {
  background: var(--base_color, #FB6F92);
  color: #fff;
}
.cl-cart-drawer__btn--solid {
  border: 1.5px solid var(--base_color, #FB6F92);
  background: var(--base_color, #FB6F92);
  color: #fff;
}
.cl-cart-drawer__btn--solid:hover {
  background: #e0456e;
  border-color: #e0456e;
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
  .cl-cart-drawer {
    width: 100%;
  }
  .cl-cart-drawer__footer {
    padding-bottom: 80px; /* space for fixed bottom nav */
  }
  .cl-cart-drawer__body {
    padding-bottom: 12px;
  }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .cl-cart-drawer {
    width: 380px;
  }
  .cl-cart-drawer__footer {
    padding-bottom: 80px; /* space for fixed bottom nav */
  }
}

/* Ensure drawer sits above mobile bottom nav (z-index 9998) */
.cl-cart-drawer-wrapper {
  z-index: 11000;
}
.cl-cart-drawer {
  z-index: 11001;
}
.cl-cart-drawer-overlay {
  z-index: 10999;
}

/* ---------- Legacy compat: hide old shoping_cart when new drawer is used ---------- */
.shoping_wrapper.d-none {
  display: none !important;
  pointer-events: none;
}

/* ---------- Smooth remove/wishlist animation ---------- */
.cl-cart-drawer__item {
  transition: all 0.3s ease;
  overflow: hidden;
}
.cl-cart-drawer__item[data-removing="true"] {
  opacity: 0;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}
