/* ── Panel ── */
.cart-panel {
  background: #fff;
  border-radius: 14px 0 0 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  -webkit-border-radius: 14px 0 0 14px;
  -moz-border-radius: 14px 0 0 14px;
  -ms-border-radius: 14px 0 0 14px;
  -o-border-radius: 14px 0 0 14px;
}

/* ── Header ── */
.cart-header {
  padding: 20px 20px 16px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-badge {
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  transition: background 0.15s;
}
.close-btn:hover {
  background: #f5f5f5;
}

/* ── Items ── */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-items::-webkit-scrollbar {
  width: 3px;
}
.cart-items::-webkit-scrollbar-track {
  background: transparent;
}
.cart-items::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.select-all-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  margin-bottom: 4px;
}

.item-check,
.select-all-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #111;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.select-all-label {
  font-size: 12px;
  color: #888;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}
.cart-item:last-child {
  border-bottom: none;
}

.item-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #f5f5f5;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 22px;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.item-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.item-price {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.item-original {
  font-size: 11px;
  color: #bbb;
  text-decoration: line-through;
}

.discount-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  background: #edfaf3;
  color: #1a7a40;
}

.item-qty {
  display: flex;
  align-items: center;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #626262;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  box-shadow: none !important;
}
.qty-btn:hover {
  background: #f5f5f5;
}

.qty-num {
  font-size: 12px !important;
  font-weight: 600 !important;
  border: none !important;
  padding: 0 !important;
  color: #111 !important;
  width: 22px !important;
  text-align: center !important;
}

/* ── Footer ── */
.cart-footer {
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  padding: 16px 20px 20px;
}

.promo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.promo-input {
  flex: 1;
  height: 34px;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  background: #f8f8f8;
  color: #111;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.promo-input::placeholder {
  color: #bbb;
}
.promo-input:focus {
  border-color: rgba(0, 0, 0, 0.3);
  background: #fff;
}

.promo-btn {
  height: 34px;
  padding: 0 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.promo-btn:hover {
  background: #f5f5f5;
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #888;
}

.total-row.main {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  padding-top: 10px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}

.savings-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #edfaf3;
  color: #1a7a40;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.checkout-btn {
  width: 100%;
  height: 42px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  letter-spacing: 0.02em;
  font-family: inherit;
}
.checkout-btn:hover {
  opacity: 0.85;
}
.checkout-btn:active {
  opacity: 0.75;
  transform: scale(0.99);
}

.black-checked {
  -webkit-appearance: none;
  appearance: none;

  width: 22px;
  height: 22px;
  border-radius: 6px;

  background-color: #f0f0f0;
  border: 2px solid #ccc;

  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-block;
  position: relative;
}

.black-checked:hover {
  border-color: #000000;
}

.black-checked:checked {
  background-color: #000000;
  border-color: #c6c6c6;
}

/* 6. Membuat ikon centang (✓) di dalamnya menggunakan pseudo-element */
.black-checked:checked::before {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  /* background: var(--text);
  color: var(--bg); */
  font-size: 9px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-toast {
  display: flex;
  align-items: center;
  background: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px 15px;
  margin-top: 10px;
  max-width: 300px;
  animation:
    fade-in 0.5s ease-out,
    fade-out 0.5s ease-in 3s;
  transition: opacity 0.3s;
  opacity: 1;
}

.popup-toast img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}

.popup-toast .toast-content {
  flex: 1;
}

.popup-toast .toast-content h4 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}

.popup-toast .toast-content p {
  margin: 0;
  font-size: 12px;
  color: #666;
}
