/* ================================================
   SLIDE-IN CART — cart.css
   ================================================ */

/* ---------- Overlay ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ---------- Panel ---------- */
.cart-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(400px, 100vw);
  height: 100dvh;
  background: #fff;
  z-index: 910;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -4px 0 32px rgba(0,0,0,.12);
}
.cart-panel.open {
  transform: translateX(0);
}

/* ---------- Header ---------- */
.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-panel__header h2 {
  font-family: var(--font-alt);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cart-panel__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.cart-panel__close:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ---------- Body (scrollable) ---------- */
.cart-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Empty State ---------- */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}
.cart-empty i {
  font-size: 3rem;
  color: var(--border);
}
.cart-empty p {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Cart Item ---------- */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }

.cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}
.cart-item__img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}
.cart-item__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
  color: var(--text);

  /* Truncate to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item__price {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 8px;
}

.cart-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.cart-item__qty button {
  width: 28px; height: 28px;
  font-size: 15px;
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.cart-item__qty button:hover {
  background: var(--black);
  color: var(--white);
}
.cart-item__qty span {
  width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 28px;
}

.cart-item__remove {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 4px;
  transition: color var(--transition);
}
.cart-item__remove:hover { color: var(--red); }

/* ---------- Footer ---------- */
.cart-panel__footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.cart-subtotal span:last-child {
  font-size: 18px;
  font-weight: 900;
  color: var(--blue);
}

.cart-free-shipping {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-actions .btn {
  width: 100%;
  padding: 14px;
  font-size: 13px;
}

/* ---------- Free shipping bar ---------- */
.cart-shipping-bar {
  margin-bottom: 14px;
}
.cart-shipping-bar p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.cart-shipping-bar p strong { color: var(--text); }
.cart-shipping-progress {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.cart-shipping-progress div {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ================================================
   SIDEBAR OVERLAY (mobile filters)
   ================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}
