/* ===== Everstride cart drawer — UpCart-look-alike ===== */

#ev-drawer-overlay,
#ev-drawer-overlay *,
#ev-drawer,
#ev-drawer * { box-sizing: border-box; }

#ev-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
#ev-drawer-overlay.ev-open {
  opacity: 1;
  pointer-events: auto;
}

#ev-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.32,.72,0,1);
  box-shadow: -10px 0 36px rgba(0,0,0,.10);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
}
#ev-drawer.ev-open { transform: translateX(0); }

/* ----- Header ----- */
.ev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0f0f0;
}
.ev-head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0;
}
.ev-head .ev-count {
  font-weight: 500;
  color: #1a1a1a;
}
.ev-close {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  color: #1a1a1a;
  border-radius: 999px;
  transition: background .15s;
}
.ev-close:hover { background: #f3f3f3; }

/* ----- Scroll body ----- */
.ev-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 24px 24px;
}
.ev-empty {
  text-align: center;
  padding: 80px 16px;
  color: #888;
  font-size: 14px;
}
.ev-empty[hidden] { display: none; }
.ev-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ----- Line item ----- */
.ev-item {
  display: grid;
  grid-template-columns: 90px 1fr 18px;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #f3f3f3;
  position: relative;
}
.ev-item__img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: #f7f7f7;
}
.ev-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ev-item__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-item__attr {
  font-size: 12px;
  color: #555;
  margin: 0;
}
.ev-item__attr strong { font-weight: 500; color: #1a1a1a; }
.ev-item__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ev-item__price-was {
  text-decoration: line-through;
  color: #999;
  font-size: 13px;
}
.ev-item__price-now {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a1a;
}
.ev-item__price-save {
  font-size: 12px;
  color: #2a9d44;
  font-weight: 600;
}
.ev-item__bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* qty pill */
.ev-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 999px;
  height: 30px;
  padding: 0 4px;
}
.ev-item__qty button {
  background: transparent;
  border: 0;
  width: 26px;
  height: 28px;
  font-size: 15px;
  cursor: pointer;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ev-item__qty button:hover { color: #DD2E63; }
.ev-item__qty span {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

/* discount badge inline with qty */
.ev-item__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #DD2E63;
  background: #fef3f3;
  border: 1px solid #fadbe2;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ev-item__badge svg { width: 11px; height: 11px; }

/* trash button (top-right of card) */
.ev-item__remove {
  background: transparent;
  border: 0;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}
.ev-item__remove:hover { color: #DD2E63; }
.ev-item__remove svg { width: 16px; height: 16px; }

/* ----- Frequently Bought With (upsell) ----- */
.ev-upsell {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}
.ev-upsell__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
}
.ev-upsell__card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #fafafa;
  border-radius: 8px;
}
.ev-upsell__card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f3f3;
}
.ev-upsell__name {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.ev-upsell__price-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
}
.ev-upsell__was { text-decoration: line-through; color: #999; }
.ev-upsell__now { color: #1a1a1a; font-weight: 700; }
#ev-drawer .ev-upsell__add,
button.ev-upsell__add {
  background: #DD2E63 !important;
  color: #fff !important;
  border: 0 !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  letter-spacing: .04em !important;
  transition: background .15s !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  height: auto !important;
  min-width: 0 !important;
  box-shadow: none !important;
}
#ev-drawer .ev-upsell__add:hover { background: #b62550 !important; }
#ev-drawer .ev-upsell__add[data-already-in="true"] {
  background: #888 !important;
  cursor: not-allowed !important;
}

/* ----- Footer ----- */
.ev-foot {
  border-top: 1px solid #f0f0f0;
  padding: 20px 24px 22px;
  background: #fff;
}
.ev-foot__discount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.ev-foot__discount[hidden] { display: none; }
.ev-foot__discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #DD2E63;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.ev-foot__discount-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ev-foot__discount-badge .ev-tier-label { white-space: nowrap; }
.ev-foot__discount-value { color: #1a1a1a; font-weight: 700; }
.ev-foot__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 0 16px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}
.ev-foot__total-value { font-size: 18px; }

#ev-drawer .ev-checkout,
button.ev-checkout {
  width: 100% !important;
  background: #DD2E63 !important;
  color: #fff !important;
  border: 0 !important;
  padding: 18px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  border-radius: 999px !important;
  transition: background .2s, transform .1s !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: auto !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
}
#ev-drawer .ev-checkout:hover { background: #b62550 !important; }
#ev-drawer .ev-checkout:active { transform: scale(.99) !important; }
#ev-drawer .ev-checkout[disabled] { background: #ccc !important; cursor: not-allowed !important; }
#ev-drawer .ev-checkout::after { content: "→"; font-size: 18px; }

.ev-checkout-error {
  color: #c00;
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  min-height: 16px;
}

/* Payment icons row (textual pills to avoid broken external CDN images) */
.ev-pay-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.ev-pay-pill {
  height: 22px;
  min-width: 38px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border-radius: 4px;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

/* Body lock + hide native cart drawer */
body.ev-locked { overflow: hidden; }
cart-drawer, [is="cart-drawer"] { display: none !important; }

/* Mobile */
@media (max-width: 600px) {
  #ev-drawer { width: 100vw; }
  .ev-head { padding: 16px 18px 14px; }
  .ev-body { padding: 0 18px 18px; }
  .ev-item { grid-template-columns: 72px 1fr 18px; gap: 12px; }
  .ev-item__img { width: 72px; height: 72px; }
}
