/* ==========================================================================
   LaunchX Fly Cart — WPC Fly Cart Style
   ========================================================================== */

/* ----------------------------------------
   A. Fly Cart Overlay (backdrop) — light, subtle
   ---------------------------------------- */
.lx-fly-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.15);
  z-index: 9998;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lx-fly-overlay.show {
  opacity: 1; visibility: visible;
}

/* ----------------------------------------
   B. Fly Cart Bubble (right-edge toggle)
   ---------------------------------------- */
.lx-flycart {
  position: fixed;
  right: 0; top: 200px;
  z-index: 9997;
  display: flex;
  align-items: stretch;
}
.lx-fly-bubble {
  width: 48px;
  background: var(--lx-brand-primary, #e60012);
  color: #fff;
  border-radius: 12px 0 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px 14px 10px;
  cursor: pointer;
  box-shadow: -4px 0 20px rgba(230,0,18,0.30);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  border: none; font-family: inherit;
  position: relative;
  gap: 4px;
}
.lx-fly-bubble:hover {
  background: var(--lx-brand-dark, #b8000e);
  box-shadow: -6px 0 28px rgba(230,0,18,0.45);
  transform: translateX(-2px);
}
.lx-fly-bubble .fas {
  font-size: 20px;
  display: block;
}
.lx-fly-bubble__count {
  position: absolute;
  top: -6px; left: -6px;
  background: var(--lx-color-black, #111);
  color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
  border: 2px solid #fff;
}
.lx-fly-bubble__amt {
  font-size: 9px; font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ----------------------------------------
   C. Fly Cart Panel (compact popup, NOT full-screen drawer)
   ---------------------------------------- */
.lx-fly-panel {
  position: fixed;
  top: 80px; right: 12px;
  width: 340px;
  max-height: calc(100vh - 120px);
  background: var(--lx-color-white, #fff);
  z-index: 9999;
  display: flex; flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.25s ease;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
}
.lx-fly-panel.show {
  transform: translateX(0);
  opacity: 1;
}

/* Panel header */
.lx-fly-head {
  display: flex;
  justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: var(--lx-brand-primary, #e60012);
  color: #fff;
  flex-shrink: 0;
  border-radius: 14px 14px 0 0;
}
.lx-fly-head__left {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700;
}
.lx-fly-head__left .fas { font-size: 18px; }
.lx-fly-head__count {
  font-size: 12px; font-weight: 400;
  opacity: 0.85;
}
.lx-fly-head__close {
  background: rgba(255,255,255,0.18);
  border: none; color: #fff;
  font-size: 22px; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
  padding: 0; line-height: 1;
}
.lx-fly-head__close:hover {
  background: rgba(255,255,255,0.32);
}

/* "Added to cart" notification bar */
.lx-fly-notify {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: #e8f8ee;
  color: #1a7d3c;
  font-size: 13px; font-weight: 600;
  border-bottom: 1px solid #c6edcf;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}
.lx-fly-notify.show {
  transform: translateY(0);
  opacity: 1;
}
.lx-fly-notify .fas {
  font-size: 18px;
  color: #27ae60;
  flex-shrink: 0;
}

/* Panel body (scrollable) */
.lx-fly-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  min-height: 80px;
  max-height: 280px;
}
.lx-fly-body::-webkit-scrollbar { width: 4px; }
.lx-fly-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Skeleton loader */
.lx-fly-skeleton {
  display: none;
  flex-direction: column; gap: 16px;
  padding: 8px 0;
}
.lx-fly-skeleton.show { display: flex; }
.lx-fly-skeleton__item {
  display: flex; gap: 14px; align-items: flex-start;
}
.lx-fly-skeleton__img {
  width: 64px; height: 64px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: lxSkeleton 1.5s ease infinite;
  flex-shrink: 0;
}
.lx-fly-skeleton__info {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  padding-top: 4px;
}
.lx-fly-skeleton__line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: lxSkeleton 1.5s ease infinite;
}
@keyframes lxSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.lx-fly-empty {
  display: none;
  flex-direction: column; align-items: center;
  padding: 40px 20px;
  text-align: center;
}
.lx-fly-empty.show { display: flex; }
.lx-fly-empty__icon {
  width: 72px; height: 72px;
  margin-bottom: 16px;
  color: var(--lx-color-border, #e8e8e8);
}
.lx-fly-empty__icon svg {
  width: 100%; height: 100%;
}
.lx-fly-empty__text {
  font-size: 14px; color: var(--lx-color-gray, #999);
  margin-bottom: 16px;
}

/* Cart items list */
.lx-fly-items-list {
  display: flex; flex-direction: column;
}

/* ----------------------------------------
   D. Shared Mini-Item (both fly panel & header dropdown)
   ---------------------------------------- */
.lx-mini-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lx-color-border, #eee);
  align-items: flex-start;
  position: relative;
  animation: lxItemIn 0.25s ease;
}
.lx-mini-item:last-child { border-bottom: none; padding-bottom: 0; }
@keyframes lxItemIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lx-mini-item__img {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--lx-color-light-gray, #f8f8f8);
  padding: 4px;
  flex-shrink: 0;
  border: 1px solid var(--lx-color-border, #eee);
  transition: border-color 0.15s ease;
}
.lx-mini-item__img:hover { border-color: var(--lx-brand-primary, #e60012); }
.lx-mini-item__body { flex: 1; min-width: 0; }
.lx-mini-item__name {
  font-size: 13px; font-weight: 600;
  color: var(--lx-color-black, #111);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
  margin-bottom: 4px;
  transition: color 0.15s ease;
}
.lx-mini-item__name:hover { color: var(--lx-brand-primary, #e60012); }
.lx-mini-item__badges {
  display: flex; flex-wrap: wrap; gap: 3px;
  margin-bottom: 6px;
}
.lx-mini-item__badge {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px; line-height: 1.4;
}
.lx-mini-item__badge--sale  { background: #e60012; color: #fff; }
.lx-mini-item__badge--update { background: #1a73e8; color: #fff; }
.lx-mini-item__badge--shipping { background: #27ae60; color: #fff; }
.lx-mini-item__badge--us { background: #111; color: #fff; }

.lx-mini-item__row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.lx-mini-item__qty-wrap {
  display: flex; align-items: center; gap: 0;
}
.lx-mini-item__qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--lx-color-border, #ddd);
  border-radius: 4px;
  background: var(--lx-color-white, #fff);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--lx-color-dark, #333);
  transition: all 0.15s ease;
  padding: 0; line-height: 1;
}
.lx-mini-item__qty-btn:hover {
  border-color: var(--lx-brand-primary, #e60012);
  color: var(--lx-brand-primary, #e60012);
}
.lx-mini-item__qty-btn:active { background: var(--lx-color-light-gray, #f5f5f5); }
.lx-mini-item__qty-input {
  width: 34px; height: 26px;
  text-align: center;
  border: 1px solid var(--lx-color-border, #ddd);
  border-left: none; border-right: none;
  font-size: 12px; font-weight: 600;
  color: var(--lx-color-dark, #333);
}
.lx-mini-item__price {
  font-size: 14px; font-weight: 700;
  color: var(--lx-brand-primary, #e60012);
  white-space: nowrap;
  text-align: right;
}
.lx-mini-item__remove {
  position: absolute; top: 12px; right: 0;
  background: none; border: none;
  color: var(--lx-color-gray, #ccc);
  cursor: pointer; font-size: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; padding: 0;
}
.lx-mini-item__remove:hover {
  color: var(--lx-brand-primary, #e60012);
  background: rgba(230,0,18,0.06);
}

/* ----------------------------------------
   E. Undo Toast (after removing item)
   ---------------------------------------- */
.lx-fly-undo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--lx-color-dark, #333);
  color: #fff;
  font-size: 13px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}
.lx-fly-undo.show {
  transform: translateY(0);
  opacity: 1;
}
.lx-fly-undo__text { flex: 1; }
.lx-fly-undo__btn {
  background: none; border: 1px solid rgba(255,255,255,0.4);
  color: #fff; cursor: pointer;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 12px; font-weight: 600;
  transition: all 0.15s ease;
}
.lx-fly-undo__btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.7);
}

/* ----------------------------------------
   F. Fly Cart Footer
   ---------------------------------------- */
.lx-fly-foot {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  background: #fafafa;
  border-top: 1px solid var(--lx-color-border, #eee);
  border-radius: 0 0 14px 14px;
}
/* Coupon field */
.lx-fly-coupon {
  display: flex; gap: 0;
  margin-bottom: 14px;
}
.lx-fly-coupon__input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--lx-color-border, #ddd);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 12px; color: var(--lx-color-dark, #333);
  outline: none;
  transition: border-color 0.15s ease;
}
.lx-fly-coupon__input:focus { border-color: var(--lx-brand-primary, #e60012); }
.lx-fly-coupon__input::placeholder { color: var(--lx-color-gray, #999); }
.lx-fly-coupon__btn {
  padding: 8px 14px;
  background: var(--lx-brand-primary, #e60012);
  color: #fff; border: none;
  border-radius: 0 6px 6px 0;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.lx-fly-coupon__btn:hover { background: var(--lx-brand-dark, #b8000e); }

/* Subtotal */
.lx-fly-subtotal {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  font-size: 14px; color: var(--lx-color-dark, #333);
}
.lx-fly-subtotal strong {
  font-size: 20px;
  color: var(--lx-brand-primary, #e60012);
}

/* Action buttons */
.lx-fly-actions {
  display: flex; gap: 8px;
  margin-bottom: 10px;
}
.lx-fly-actions .lx-btn { flex: 1; }

/* Continue shopping link */
.lx-fly-continue {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--lx-color-gray, #999);
  text-decoration: none;
  padding: 6px 0 0;
  transition: color 0.15s ease;
}
.lx-fly-continue:hover { color: var(--lx-brand-primary, #e60012); }

/* ----------------------------------------
   G. Header Cart Dropdown (updated)
   ---------------------------------------- */
.hdr-cart {
  position: relative;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  font-weight: 600; color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.hdr-cart:hover { background: rgba(255,255,255,0.1); }
.hdr-cart__link {
  color: inherit;
  text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.hdr-cart-count {
  background: var(--lx-brand-primary, #e60012);
  color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}

/* Dropdown wrapper */
.hdr-drop {
  display: block;
  position: absolute;
  top: calc(100% + 12px); right: 0;
  width: 340px;
  background: var(--lx-color-white, #fff);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  z-index: 10000;
  overflow: hidden;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}
.hdr-drop.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.hdr-drop::before {
  content: '';
  position: absolute; top: -7px; right: 24px;
  width: 14px; height: 14px;
  background: var(--lx-color-white, #fff);
  border-radius: 3px;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,0.05);
  z-index: 1;
}

/* Dropdown header */
.hdr-drop__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--lx-color-border, #eee);
  position: relative; z-index: 2;
  background: var(--lx-color-white, #fff);
}
.hdr-drop__title {
  font-size: 15px; font-weight: 700; color: var(--lx-color-black, #111);
  display: flex; align-items: center; gap: 8px;
}
.hdr-drop__title .fas { color: var(--lx-brand-primary, #e60012); font-size: 17px; }
.hdr-drop__title span { font-weight: 400; color: var(--lx-color-gray, #999); font-size: 12px; }
.hdr-drop__close {
  background: none; border: none;
  font-size: 20px; color: var(--lx-color-gray, #999);
  cursor: pointer; width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; padding: 0; line-height: 1;
}
.hdr-drop__close:hover { color: var(--lx-color-black, #111); background: var(--lx-color-light-gray, #f5f5f5); }

/* Dropdown body */
.hdr-drop__body {
  max-height: 280px; overflow-y: auto;
  padding: 0 18px;
}
.hdr-drop__body::-webkit-scrollbar { width: 4px; }
.hdr-drop__body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Dropdown footer */
.hdr-drop__foot {
  padding: 14px 18px;
  border-top: 1px solid var(--lx-color-border, #eee);
}
.hdr-drop__subtotal {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  font-size: 14px; color: var(--lx-color-dark, #333);
}
.hdr-drop__subtotal strong {
  font-size: 18px; color: var(--lx-brand-primary, #e60012);
}
.hdr-drop__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.hdr-drop__actions .lx-btn { flex: 1; text-align: center; font-size: 12px; padding: 8px 10px; }

/* ----------------------------------------
   H. Responsive
   ---------------------------------------- */
@media (max-width: 768px) {
  .lx-fly-panel {
    width: calc(100vw - 24px);
    right: 12px; top: 60px;
    max-height: calc(100vh - 80px);
    border-radius: 12px;
  }
  .lx-fly-panel.show { border-radius: 12px; }
  .lx-fly-head { border-radius: 12px 12px 0 0; }
  .lx-fly-foot { border-radius: 0 0 12px 12px; }
  .lx-fly-body { max-height: 220px; }
  .lx-fly-bubble { display: none; }
  .hdr-drop {
    width: calc(100vw - 32px);
    right: -140px;
    position: fixed; top: 60px;
  }
  .hdr-drop::before { right: 156px; }
  .hdr-drop__body { max-height: 260px; }
}
@media (max-width: 400px) {
  .hdr-drop__actions { flex-direction: column; }
}
