/* ============================================================
   EFLC Cart Flyout v2 — cart-flyout.css
   Scoped to .cv2-* — zero collision with existing #cartContents
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.cv2-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.cv2-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Flyout panel ────────────────────────────────────────── */
.cv2-flyout {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: -6px 0 24px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.cv2-flyout.open { right: 0; }

/* ── Header bar ──────────────────────────────────────────── */
.cv2-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.cv2-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.cv2-close {
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 0 4px;
  user-select: none;
}
.cv2-close:hover { color: #111; }

/* ── Scrollable body ─────────────────────────────────────── */
.cv2-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}

/* ── Loading state ───────────────────────────────────────── */
.cv2-loading {
  padding: 48px 0;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

/* ── Empty state ─────────────────────────────────────────── */
.cv2-empty {
  padding: 48px 0;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* ── Cart item ───────────────────────────────────────────── */
.cv2-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f2;
}
.cv2-item:last-child { border-bottom: 0; }

.cv2-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

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

.cv2-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  margin-bottom: 5px;
  line-height: 1.35;
}
.cv2-name:hover { color: #c40000; }

.cv2-item-price {
  font-size: 13px;
  font-weight: 700;
  color: #c40000;
  margin-bottom: 7px;
}

/* ── Qty row ─────────────────────────────────────────────── */
.cv2-qty-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cv2-qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #333;
}
.cv2-qty-btn:hover { background: #e0e0e0; }

.cv2-qty-val {
  font-size: 13px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cv2-remove {
  margin-left: auto;
  font-size: 12px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
}
.cv2-remove:hover { color: #c40000; }

/* ── Footer ──────────────────────────────────────────────── */
.cv2-foot {
  padding: 16px 18px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.cv2-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
}
.cv2-btn-checkout,
.cv2-btn-cart {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none !important;
  box-sizing: border-box;
}
.cv2-btn-checkout {
  background: #0b57d0;
  color: #fff !important;
  margin-bottom: 8px;
}
.cv2-btn-checkout:hover { background: #0945ab; }
.cv2-btn-cart {
  background: #f0f0f0;
  color: #333 !important;
}
.cv2-btn-cart:hover { background: #e0e0e0; }

/* ── Mobile → bottom sheet ───────────────────────────────── */
@media (max-width: 600px) {
  .cv2-overlay { z-index: 20001; }
  .cv2-flyout {
    top: auto;
    right: 0;
    bottom: -110%;
    left: 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 85vh;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 30px rgba(0,0,0,.2);
    transition: bottom .28s cubic-bezier(.4,0,.2,1);
    z-index: 20002;
  }
  .cv2-flyout.open {
    bottom: 0;
  }
}
