/* ============================================================
   Giỏ hàng dạng drawer (trượt từ phải) — mở bằng nút .header-shop
   Dùng chung biến màu từ homepage-refresh.css (:root --hotel-*)
   ============================================================ */

/* Badge số lượng trên nút Mua sắm */

.header-shop {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  background: var(--hotel-coral);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- Overlay ---------- */

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1069;
  background: rgba(11, 34, 43, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

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

/* ---------- Drawer ---------- */

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 40px));
  background: #fff;
  box-shadow: -18px 0 50px rgba(21, 61, 75, .22);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .38s cubic-bezier(.2, .7, .2, 1), visibility .38s ease;
}

body.cart-open .cart-drawer {
  transform: translateX(0);
  visibility: visible;
}

body.cart-open {
  overflow: hidden;
}

/* Header drawer */

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #f3e6ee;
  background: #fff8fc;
}

.cart-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #202b31;
  font-size: 17px;
  font-weight: 750;
}

.cart-head h2 i {
  color: var(--hotel-coral);
}

.cart-head h2 span {
  color: var(--hotel-muted);
  font-size: 13px;
  font-weight: 650;
}

.cart-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #f0d7e4;
  border-radius: 50%;
  background: #fff;
  color: #6a7479;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.cart-close:hover {
  background: var(--hotel-coral);
  border-color: var(--hotel-coral);
  color: #fff;
  transform: rotate(90deg);
}

/* ---------- Danh sách sản phẩm ---------- */

.cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding: 6px 22px;
  list-style: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  align-items: center;
}

.cart-item+.cart-item {
  border-top: 1px solid #f6ebf1;
}

.cart-item-thumb {
  display: block;
  overflow: hidden;
  width: 72px;
  height: 72px;
  border: 1px solid #f2e3eb;
  border-radius: 10px;
  background: #fbf7f2;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.cart-item:hover .cart-item-thumb img {
  transform: scale(1.08);
}

.cart-item-info h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.cart-item-info h3 a {
  color: #26363c;
  transition: color .2s ease;
}

.cart-item-info h3 a:hover {
  color: var(--hotel-coral);
}

.cart-item-price {
  display: block;
  margin-bottom: 8px;
  color: var(--hotel-coral);
  font-size: 14px;
  font-weight: 800;
}

.cart-item-price small {
  color: var(--hotel-muted);
  font-size: 11px;
  font-weight: 600;
}

/* Bộ chọn số lượng nhỏ gọn trong giỏ (tái dùng .quantity-control) */

.cart-item .quantity-control {
  height: 32px;
}

.cart-item .quantity-control button {
  width: 26px;
  height: 30px;
  font-size: 14px;
}

.cart-item .quantity-control input {
  width: 32px;
  height: 30px;
  font-size: 12px;
}

.cart-item-remove {
  align-self: start;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b3a0aa;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.cart-item-remove:hover {
  background: #fdf1ef;
  color: #c0392b;
}

/* Trạng thái giỏ trống (ẩn sẵn, dùng khi cần) */

.cart-empty {
  display: none;
  padding: 60px 20px;
  text-align: center;
  color: var(--hotel-muted);
}

.cart-empty i {
  display: block;
  margin-bottom: 14px;
  font-size: 44px;
  color: #eccfdd;
}

/* ---------- Chân drawer: tổng tiền + nút ---------- */

.cart-foot {
  padding: 18px 22px 20px;
  border-top: 1px solid #f3e6ee;
  background: #fff;
  box-shadow: 0 -10px 30px rgba(72, 32, 53, .06);
}

.cart-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--hotel-muted);
}

.cart-summary-row.cart-total {
  margin: 4px 0 8px;
  font-size: 15px;
  color: #202b31;
  font-weight: 750;
}

.cart-summary-row.cart-total strong {
  color: var(--hotel-coral);
  font-size: 22px;
  font-weight: 800;
}

.cart-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--hotel-muted);
  font-size: 12px;
  line-height: 1.55;
}

.cart-note i {
  margin-top: 2px;
  color: var(--hotel-coral);
}

.cart-actions {
  display: grid;
  gap: 9px;
}

.cart-btn-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--hotel-coral);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.cart-btn-checkout:hover {
  background: var(--hotel-coral-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(250, 41, 145, .28);
}

.cart-btn-shopee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #ee4d2d;
  border-radius: 6px;
  background: #fff;
  color: #ee4d2d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.cart-btn-shopee:hover {
  background: #ee4d2d;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(238, 77, 45, .26);
}

.cart-continue {
  margin: 12px 0 0;
  text-align: center;
}

.cart-continue button {
  border: 0;
  background: transparent;
  color: var(--hotel-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease;
}

.cart-continue button:hover {
  color: var(--hotel-coral);
}

.cart-continue i {
  margin-right: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
  /* homepage-refresh.css ẩn .header-shop trên mobile — hiện lại dạng nút icon giỏ hàng */
  .header-cta.header-shop {
    display: inline-flex;
    min-width: 40px;
  }

  .header-cta.header-shop i {
    display: inline-block;
  }

  .header-cta.header-shop span:not(.cart-count) {
    display: none;
  }

  .cart-drawer {
    width: calc(100vw - 26px);
  }

  .cart-head,
  .cart-items,
  .cart-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cart-item {
    grid-template-columns: 62px 1fr auto;
    gap: 11px;
  }

  .cart-item-thumb {
    width: 62px;
    height: 62px;
  }
}
