/**
 * Cart drawer — match original side cart (reference image 1)
 */

.ew-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.ew-cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.ew-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.ew-cart-drawer.is-open {
  transform: translateX(0);
}

.ew-cart-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px 0;
  background: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid #e8e8e8;
}

.ew-cart-drawer-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 3px solid #0c2028;
  margin-bottom: -1px;
}

.ew-cart-drawer-title-icon {
  display: inline-flex;
  color: #0c2028;
}

.ew-cart-drawer-title {
  margin: 0;
  font-family: var(--font-open-sans, 'Open Sans', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: #0c2028;
  line-height: 1.2;
}

.ew-cart-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: -4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #647176;
  padding: 0;
}

.ew-cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.ew-drawer-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ew-drawer-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #ececec;
}

.ew-drawer-thumb {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}

.ew-drawer-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.ew-drawer-meta {
  flex: 1;
  min-width: 0;
}

.ew-drawer-name {
  font-size: 14px;
  font-weight: 700;
  color: #0c2028;
  line-height: 1.35;
  margin-bottom: 4px;
}

.ew-drawer-name a {
  color: #0c2028 !important;
  text-decoration: none !important;
}

.ew-drawer-variant {
  font-size: 13px;
  color: #8a9399;
  margin-bottom: 6px;
}

.ew-drawer-price {
  font-size: 15px;
  font-weight: 700;
  color: #0c2028;
  margin-bottom: 10px;
}

.ew-drawer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ew-qty-stepper.ew-qty-drawer {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}

.ew-qty-stepper.ew-qty-drawer button {
  width: 30px;
  height: 30px;
  border: none;
  background: #f3f3f3;
  color: #0c2028;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.ew-qty-stepper.ew-qty-drawer .ew-qty-input {
  width: 40px;
  height: 30px;
  border: none;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  text-align: center;
  font-size: 14px;
  padding: 0;
  -moz-appearance: textfield;
  background: #fff;
}

.ew-qty-stepper.ew-qty-drawer .ew-qty-input::-webkit-outer-spin-button,
.ew-qty-stepper.ew-qty-drawer .ew-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ew-drawer-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a9399 !important;
  width: 28px;
  height: 28px;
}

.ew-drawer-remove:hover {
  color: #e0241a !important;
}

.ew-cart-drawer-footer {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  min-height: 72px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

.ew-cart-drawer-footer.is-hidden {
  display: none;
}

.ew-drawer-subtotal {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  background: #fff;
}

.ew-drawer-subtotal-label {
  font-size: 13px;
  color: #647176;
  margin-bottom: 2px;
}

.ew-drawer-subtotal-amount {
  font-size: 18px;
  font-weight: 700;
  color: #0c2028;
}

.ew-drawer-checkout-btn {
  flex: 0 0 48%;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #82c341 !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none !important;
  letter-spacing: 0.5px;
  padding: 0 16px;
}

.ew-drawer-checkout-btn:hover {
  background: #6fad32 !important;
  color: #fff !important;
}

.ew-cart-empty {
  text-align: center;
  padding: 48px 24px;
}

.ew-cart-empty p {
  margin: 0 0 20px;
  color: #647176;
  font-size: 16px;
}

.ew-drawer-continue {
  display: inline-block;
  padding: 10px 20px;
  background: #82c341;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 2px;
  font-weight: 600;
}

body.ew-cart-open {
  overflow: hidden;
}

.ew-cart-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.ant-badge.cart-badge {
  position: relative;
  display: inline-flex;
}

.ew-cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e0241a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
}

@media (max-width: 480px) {
  .ew-cart-drawer {
    max-width: 100%;
  }
}
