/* ═══════════════════════════════════════════════════════
   Ehva Side Cart  v3.0.0
   ═══════════════════════════════════════════════════════ */

:root {
  --ec-pink:        #ff0a54;
  --ec-pink-light:  #fff0f4;
  --ec-pink-border: #ffd0de;
  --ec-dark:        #1a1a1a;
  --ec-grey:        #888;
  --ec-w:           400px;
  --ec-ease:        0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Overlay ── */
.ehva-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999980;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ec-ease);
}
.ehva-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── Drawer ── */
.ehva-drawer {
  position: fixed;
  top: 0; bottom: 0;
  width: var(--ec-w);
  max-width: 100vw;
  background: #fff;
  z-index: 999990;
  display: flex; flex-direction: column;
  transition: transform var(--ec-ease);
  box-shadow: -6px 0 32px rgba(0,0,0,0.12);
}
.ehva-drawer.from-right {
  right: 0; left: auto;
  border-radius: 14px 0 0 14px;
  transform: translateX(105%);
}
.ehva-drawer.from-left {
  left: 0; right: auto;
  border-radius: 0 14px 14px 0;
  box-shadow: 6px 0 32px rgba(0,0,0,0.12);
  transform: translateX(-105%);
}
.ehva-drawer.is-open { transform: translateX(0) !important; }

/* ── Header ── */
.ehva-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fff;
}
.ehva-drawer__title {
  font-family: 'Poppins', sans-serif;
  font-size: 17px; font-weight: 700; color: var(--ec-dark);
  display: flex; align-items: center; gap: 8px;
}
.ehva-count-badge {
  background: var(--ec-pink); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; line-height: 1;
}

/* ── Close button — SVG X icon, dark colour, NO background ever ── */
.ehva-drawer__close {
  /* Hard reset — beats any theme button styles */
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 50%;
  box-shadow: none !important;
  outline: none;
  margin: 0; padding: 6px;
  width: 34px; height: 34px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #555;
  transition: color 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.ehva-drawer__close:hover {
  color: var(--ec-pink);
  transform: rotate(90deg);
  background: transparent !important;
}
.ehva-drawer__close svg {
  display: block;
  pointer-events: none;
}

/* ── Scrollable body ── */
.ehva-drawer__body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.ehva-drawer__body::-webkit-scrollbar { width: 3px; }
.ehva-drawer__body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ── Milestone bar ── */
.ehva-milestone-wrap {
  padding: 14px 18px 10px;
  border-bottom: 1px solid #f5f5f5;
}
.ehva-milestone-msg {
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px; font-weight: 600;
  text-align: center; color: var(--ec-dark); margin-bottom: 10px;
}
.ehva-milestone-msg .ec-hl { color: var(--ec-pink); }
.ehva-progress-track {
  position: relative; height: 4px;
  background: #e8e8e8; border-radius: 4px; margin-bottom: 8px;
}
.ehva-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ec-pink), #ff6b9d);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.ehva-ms-tick {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #ccc; border: 2px solid #fff; transition: background 0.3s;
}
.ehva-ms-tick.unlocked { background: var(--ec-pink); }
.ehva-milestone-labels { display: flex; }
.ehva-ms-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px; color: #bbb; text-align: center;
  flex: 1; line-height: 1.35; transition: color 0.3s;
}
.ehva-ms-label.unlocked { color: var(--ec-pink); font-weight: 600; }

/* ── Gift/savings card ── */
.ehva-savings-bar {
  margin: 10px 14px 0;
  background: var(--ec-pink); color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px; font-weight: 700;
  text-align: center; padding: 5px 10px;
  border-radius: 8px 8px 0 0;
}
.ehva-gift-card {
  margin: 0 14px 10px;
  background: var(--ec-pink-light);
  border: 1.5px solid var(--ec-pink-border);
  border-radius: 0 0 10px 10px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  animation: ec-pop 0.28s ease;
}
@keyframes ec-pop {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}
.ehva-gift-card img {
  width: 50px; height: 50px; object-fit: cover;
  border-radius: 7px; flex-shrink: 0;
}
.ehva-gift-name {
  font-family: 'Poppins', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--ec-dark); margin-bottom: 4px;
}
.ehva-free-badge {
  display: inline-block;
  background: var(--ec-pink); color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 10px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
}

/* ── Cart items ── */
.ehva-cart-items {
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 0;
}
.ehva-cart-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f3f3f3;
  animation: ec-slidein 0.22s ease;
}
.ehva-cart-item:last-child { border-bottom: none; }
@keyframes ec-slidein {
  from { opacity:0; transform:translateX(6px); }
  to   { opacity:1; transform:translateX(0); }
}
.ehva-item__img {
  width: 70px; height: 70px; object-fit: cover;
  border-radius: 9px; flex-shrink: 0; background: #f5f5f5;
}
.ehva-item__details { flex: 1; min-width: 0; }
.ehva-item__name {
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px; font-weight: 600; color: var(--ec-dark);
  margin-bottom: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ehva-item__prices {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin-bottom: 8px;
}
.ehva-item__price {
  font-family: 'Poppins', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--ec-pink);
}
.ehva-item__reg {
  font-size: 11px; color: #bbb; text-decoration: line-through;
}
.ehva-item__disc {
  font-family: 'Poppins', sans-serif;
  font-size: 10px; font-weight: 700; color: var(--ec-pink);
  background: var(--ec-pink-light); padding: 1px 6px; border-radius: 10px;
}

/* ── Qty stepper ─────────────────────────────────────────────────
   Uses explicit styles only — no `all: unset` which was eating
   button text on some browsers/themes.
   ────────────────────────────────────────────────────────────── */
.ehva-qty-row {
  display: flex; align-items: center; gap: 10px;
}
.ehva-qty {
  display: inline-flex; align-items: stretch;
  border: 1.5px solid var(--ec-pink);
  border-radius: 6px; overflow: hidden;
  height: 28px; width: auto;
}
.ehva-qty-btn {
  /* Explicit reset — safe across all browsers */
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--ec-pink) !important;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  text-align: center;
  transition: background-color 0.12s;
  /* Make sure text shows */
  font-family: Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ehva-qty-btn:hover {
  background-color: var(--ec-pink-light) !important;
}
.ehva-qty-btn:active {
  background-color: var(--ec-pink-border) !important;
}
.ehva-qty-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-left: 1px solid var(--ec-pink);
  border-right: 1px solid var(--ec-pink);
  border-top: none;
  border-bottom: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 12px; font-weight: 700; color: var(--ec-dark);
  text-align: center;
  user-select: none; pointer-events: none;
}

/* ── Remove button — plain text link, NO background ── */
.ehva-remove-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0; margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px;
  color: #aaa !important;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
  line-height: 1;
  vertical-align: middle;
}
.ehva-remove-btn:hover {
  color: var(--ec-pink) !important;
  background: transparent !important;
}

/* ── Upsells ── */
.ehva-upsells {
  padding: 12px 14px;
  border-top: 1px solid #f3f3f3;
}
.ehva-upsells__title {
  font-family: 'Poppins', sans-serif;
  font-size: 12px; font-weight: 700; color: var(--ec-dark);
  margin-bottom: 10px;
}
.ehva-upsell-card {
  background: var(--ec-pink-light);
  border: 1.5px solid var(--ec-pink-border);
  border-radius: 10px; padding: 10px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.ehva-upsell-card img {
  width: 54px; height: 54px; object-fit: cover;
  border-radius: 7px; flex-shrink: 0;
}
.ehva-upsell-info { flex: 1; min-width: 0; }
.ehva-upsell-name {
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px; font-weight: 600; color: var(--ec-dark);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ehva-upsell-prices { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ehva-upsell-price {
  font-family: 'Poppins', sans-serif;
  font-size: 12px; font-weight: 700; color: var(--ec-pink);
}
.ehva-upsell-reg { font-size: 10.5px; color: #bbb; text-decoration: line-through; }
.ehva-upsell-save {
  background: #22c55e; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 20px;
  font-family: 'Poppins', sans-serif;
}
.ehva-upsell-atc {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ec-pink) !important;
  background-color: var(--ec-pink) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 10.5px; font-weight: 700;
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s, transform 0.12s;
  flex-shrink: 0; box-shadow: none;
}
.ehva-upsell-atc:hover { opacity: 0.87; transform: scale(1.03); }
.ehva-upsell-atc:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Empty ── */
.ehva-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px 20px; text-align: center;
}
.ehva-empty__icon { font-size: 46px; margin-bottom: 14px; opacity: 0.22; }
.ehva-empty__title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--ec-dark); margin-bottom: 5px;
}
.ehva-empty__sub { font-size: 12.5px; color: var(--ec-grey); margin-bottom: 18px; }
.ehva-btn-shop {
  display: inline-block;
  background: var(--ec-pink) !important; color: #fff !important;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px; font-weight: 700;
  padding: 11px 26px; border-radius: 100px;
  text-decoration: none !important;
  transition: opacity 0.15s, transform 0.15s;
}
.ehva-btn-shop:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Footer ── */
.ehva-drawer__footer {
  border-top: 1px solid #f0f0f0;
  padding: 12px 18px 18px; flex-shrink: 0; background: #fff;
}
.ehva-prepaid-nudge {
  background: #dcfce7; color: #15803d;
  font-family: 'Poppins', sans-serif;
  font-size: 11px; font-weight: 700;
  text-align: center; padding: 6px 10px;
  border-radius: 6px; margin-bottom: 10px;
}
.ehva-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px;
}
.ehva-total-label {
  font-family: 'Poppins', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--ec-dark);
}
.ehva-total-amount {
  font-family: 'Poppins', sans-serif;
  font-size: 17px; font-weight: 800; color: var(--ec-dark);
}
.ehva-tax-note { font-size: 10.5px; color: #bbb; margin-bottom: 12px; font-family: 'Poppins', sans-serif; }
.ehva-btn-checkout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  background: var(--ec-pink) !important; color: #fff !important;
  font-family: 'Poppins', sans-serif;
  font-size: 14px; font-weight: 800; letter-spacing: 1px;
  padding: 15px 20px; border-radius: 100px;
  text-decoration: none !important;
  border: none;
  box-shadow: 0 4px 18px rgba(255,10,84,0.3);
  transition: opacity 0.15s, transform 0.15s;
}
.ehva-btn-checkout:hover { opacity: 0.92; transform: translateY(-1px); }
.ehva-btn-arrow { font-size: 18px; line-height: 1; }

/* ── Loading dots ── */
.ehva-loading {
  display: flex; justify-content: center; align-items: center;
  gap: 7px; padding: 60px 20px;
}
.ehva-loading span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ec-pink); opacity: 0.35;
  animation: ec-bounce 0.85s infinite ease-in-out;
}
.ehva-loading span:nth-child(2) { animation-delay: 0.14s; }
.ehva-loading span:nth-child(3) { animation-delay: 0.28s; }
@keyframes ec-bounce {
  0%,80%,100% { transform:scale(0.5); opacity:0.3; }
  40%          { transform:scale(1);  opacity:1; }
}

/* ── Floating bubble — positioned via JS inline style (XY coordinates) ── */
#ehva-cart-bubble {
  -webkit-appearance: none;
  appearance: none;
  position: fixed;
  z-index: 999970;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ec-pink) !important;
  background-color: var(--ec-pink) !important;
  color: #fff;
  border: none !important;
  box-shadow: 0 4px 16px rgba(255,10,84,0.38);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
}
#ehva-cart-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 7px 22px rgba(255,10,84,0.48);
}
#ehva-cart-bubble.is-hidden {
  opacity: 0; pointer-events: none; transform: scale(0.75);
}
#ehva-cart-bubble svg {
  width: 21px; height: 21px; display: block;
  pointer-events: none;
}
.ehva-bubble-count {
  position: absolute; top: -4px; right: -4px;
  background: #fff; color: var(--ec-pink);
  font-family: 'Poppins', sans-serif;
  font-size: 9.5px; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 3px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ec-pink); line-height: 1;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  :root { --ec-w: 100vw; }
  .ehva-drawer.from-right,
  .ehva-drawer.from-left { border-radius: 0; }
}
