/* ===== Everstride cart drawer (vanilla, replaces UpCart) ===== */

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

#ev-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  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: 420px;
  max-width: 100vw;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.08);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#ev-drawer.ev-open {
  transform: translateX(0);
}

#ev-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

#ev-drawer header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .02em;
}

.ev-close {
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: #111;
}

.ev-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.ev-empty {
  text-align: center;
  padding: 60px 24px;
  color: #666;
  font-size: 14px;
}

.ev-empty[hidden] { display: none; }

.ev-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ev-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f3f3;
}

.ev-item__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #f7f7f7;
}

.ev-item__info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.ev-item__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ev-item__variant {
  font-size: 11px;
  color: #777;
  margin: 0 0 6px;
}

.ev-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: fit-content;
  height: 28px;
}

.ev-item__qty button {
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  color: #111;
}

.ev-item__qty span {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

.ev-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.ev-item__price {
  font-size: 13px;
  font-weight: 600;
}

.ev-item__remove {
  background: transparent;
  border: 0;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

#ev-drawer footer {
  border-top: 1px solid #eee;
  padding: 20px 24px;
  background: #fff;
}

.ev-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.ev-subtotal__value {
  font-size: 18px;
}

.ev-checkout {
  width: 100%;
  background: #111;
  color: #fff;
  border: 0;
  padding: 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background .2s;
}

.ev-checkout:hover { background: #333; }
.ev-checkout[disabled] { background: #ccc; cursor: not-allowed; }

.ev-checkout-note {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 10px;
}

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

/* Body lock when drawer open (no scroll behind) */
body.ev-locked { overflow: hidden; }

/* Hide native cart drawer remnants of the theme (Impact's <cart-drawer>) */
cart-drawer,
[is="cart-drawer"] {
  display: none !important;
}
