/* theme-fix-cart-drawer.css — Cart v3, đợt 3 (Claude-C). Ngăn giỏ #CartDrawer.
   Nạp từ snippets/ajax-cart-template.liquid. Chỉ scope #CartDrawer.
   KHÔNG đặt màu nút .cart__checkout (Claude-A giữ trong theme-fix-cards.css). */

/* Vùng thông báo cho trình đọc màn hình */
#CartDrawer .ajaxcart__status {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Dòng sản phẩm: chừa góc phải cho nút xoá */
#CartDrawer .ajaxcart__row { position: relative; }
#CartDrawer .ajaxcart__row .ajaxcart__product-info { padding-right: 44px; min-height: 40px; }
#CartDrawer .ajaxcart__product-vendor { display: none; }

#CartDrawer .ajaxcart__remove {
  position: absolute;
  top: 8px;
  right: -10px;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: var(--anker-muted, #5b6770);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
#CartDrawer .ajaxcart__remove:hover { color: var(--anker-red, #e32636); background: var(--anker-surface, #f4f7f9); }
#CartDrawer .ajaxcart__remove:focus-visible { outline: 2px solid var(--anker-blue-deep, #007fae); outline-offset: -2px; }

/* Bộ chọn số lượng: − ô + theo đúng thứ tự DOM, mỗi ô 44px */
#CartDrawer .ajaxcart__qty {
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
}
#CartDrawer .ajaxcart__qty-num,
#CartDrawer .ajaxcart__qty-adjust { height: 44px; order: 0; }
#CartDrawer .ajaxcart__qty-num { width: 44px; line-height: 44px; font-size: 16px; }
#CartDrawer .ajaxcart__qty-adjust { width: 44px; font-size: 12px; }
#CartDrawer .ajaxcart__qty-adjust:focus-visible,
#CartDrawer .ajaxcart__qty-num:focus-visible { outline: 2px solid var(--anker-blue-deep, #007fae); outline-offset: -2px; }

/* Giá nằm cùng hàng với bộ chọn, thiếu chỗ thì xuống dòng (không đổ cột ở 320px) */
#CartDrawer .ajaxcart__row .grid--full.display-table {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
#CartDrawer .ajaxcart__row .grid--full.display-table > .ajaxcart__price {
  flex: 1 1 auto;
  margin-left: auto;
  text-align: right;
}

/* Ghi chú thu gọn */
#CartDrawer .ajaxcart__note { margin: 14px 0 0; }
#CartDrawer .ajaxcart__note-toggle {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--anker-blue-deep, #007fae);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
#CartDrawer .ajaxcart__note-toggle::-webkit-details-marker { display: none; }
#CartDrawer .ajaxcart__note-toggle::before {
  content: "+";
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
#CartDrawer .ajaxcart__note[open] .ajaxcart__note-toggle::before { content: "\2212"; }
#CartDrawer .ajaxcart__note-toggle:focus-visible { outline: 2px solid var(--anker-blue-deep, #007fae); outline-offset: 2px; border-radius: 6px; }
#CartDrawer label.ajaxcart__note-label {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
#CartDrawer .ajaxcart__note #CartSpecialInstructions { min-height: 72px; font-size: 16px; }

/* Hàng tổng: số tiền sát phải */
#CartDrawer .ajaxcart__footer .grid--full > .grid__item:last-child { margin-left: auto; text-align: right; }

/* "Xem giỏ hàng" dưới nút Thanh toán */
#CartDrawer .ajaxcart__view-cart {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  color: var(--anker-blue-deep, #007fae);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#CartDrawer .ajaxcart__view-cart:hover,
#CartDrawer .ajaxcart__view-cart:focus,
#CartDrawer .ajaxcart__empty-link:hover,
#CartDrawer .ajaxcart__empty-link:focus { color: var(--anker-ink, #0b1118); opacity: 1; }

/* Giỏ trống */
#CartDrawer .ajaxcart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 24px;
  padding: 32px 20px;
  color: var(--anker-muted, #5b6770);
  background: var(--anker-surface, #f4f7f9);
  border: 1px dashed var(--anker-border, #dde5ea);
  border-radius: 14px;
  text-align: center;
}
#CartDrawer .ajaxcart__empty::before {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  background: var(--anker-blue-deep, #007fae);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.2 10.1a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.5L21 7H6'/%3E%3Ccircle cx='9.5' cy='19' r='1.25' fill='black' stroke='none'/%3E%3Ccircle cx='17.5' cy='19' r='1.25' fill='black' stroke='none'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.2 10.1a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.5L21 7H6'/%3E%3Ccircle cx='9.5' cy='19' r='1.25' fill='black' stroke='none'/%3E%3Ccircle cx='17.5' cy='19' r='1.25' fill='black' stroke='none'/%3E%3C/svg%3E") center/contain no-repeat;
}
#CartDrawer .ajaxcart__empty p { margin: 0; }
#CartDrawer .ajaxcart__empty-title { color: var(--anker-ink, #0b1118); font-size: 17px; font-weight: 700; }
#CartDrawer .ajaxcart__empty-text { font-size: 14px; line-height: 1.45; }
#CartDrawer .ajaxcart__empty-cta {
  display: flex;
  width: 100%;
  max-width: 280px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 0 20px;
  color: #fff;
  background: var(--anker-blue-deep, #007fae);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
#CartDrawer .ajaxcart__empty-cta:hover,
#CartDrawer .ajaxcart__empty-cta:focus { color: #fff; background: #006a92; opacity: 1; }
#CartDrawer .ajaxcart__empty-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--anker-blue-deep, #007fae);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#CartDrawer .ajaxcart__empty-cta:focus-visible,
#CartDrawer .ajaxcart__empty-link:focus-visible,
#CartDrawer .ajaxcart__view-cart:focus-visible { outline: 2px solid var(--anker-blue-deep, #007fae); outline-offset: 2px; }

/* Hộp thoại nhận focus khi mở: không vẽ khung quanh cả ngăn */
#CartDrawer:focus { outline: none; }

/* Mobile tối */
@media (max-width: 767px) {
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__remove { color: #a9b6bf; }
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__remove:hover { color: #ff8a94; background: #17232d; }
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__note-toggle,
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__view-cart,
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__empty-link { color: #5cc8f0; }
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__empty { color: #a9b6bf; background: #121c25; border-color: #2c3a45; }
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__empty-title { color: #f1f6f8; }
  html[data-mobile-theme="dark"] #CartDrawer .ajaxcart__empty::before { background: #5cc8f0; }
}
