/* ============================================================
   CART & CHECKOUT v2.0
   ============================================================ */
/* Cart icon + badge */
.en2-cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--en2-surface);
  border: 1px solid var(--en2-line);
  cursor: pointer;
  transition: 0.2s;
}
.en2-cart-toggle:hover {
  border-color: var(--en2-ink);
  transform: translateY(-1px);
}
.en2-cart-toggle svg {
  width: 22px;
  height: 22px;
}
.en2-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--en2-green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: var(--en2-font);
  z-index: 2;
}
.en2-cart-badge.en2-cart-pop {
  animation: en2-badge-pop 0.4s;
}
@keyframes en2-badge-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

/* Toast */
.en2-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--en2-dark);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  box-shadow: 0 12px 32px rgba(10, 43, 29, 0.3);
}
.en2-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Cart drawer */
.en2-cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100dvh;
  background: #fff;
  z-index: 300;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
}
.en2-cart-drawer.open {
  right: 0;
}
.en2-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--en2-line);
}
.en2-cart-head b {
  font-size: 1.1rem;
}
.en2-cart-close {
  width: 36px;
  height: 36px;
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--en2-muted);
  transition: 0.2s;
}
.en2-cart-close:hover {
  background: rgba(0, 0, 0, 0.1);
}
.en2-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}
.en2-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--en2-line);
}
.en2-cart-item:last-child {
  border-bottom: 0;
}
.en2-cart-item-info {
  flex: 1;
  min-width: 0;
}
.en2-cart-item-info b {
  display: block;
  font-size: 0.92rem;
  line-height: 1.3;
  margin-bottom: 2px;
}
.en2-cart-item-info span {
  font-size: 0.78rem;
  color: var(--en2-muted);
}
.en2-cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.en2-cart-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--en2-line);
  background: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--en2-ink);
  transition: 0.2s;
  line-height: 1;
  padding: 0;
}
.en2-cart-qty button:hover {
  border-color: var(--en2-ink);
  background: var(--en2-bg);
}
.en2-cart-qty span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.en2-cart-foot {
  padding: 20px 24px;
  border-top: 1px solid var(--en2-line);
  background: var(--en2-bg);
}
.en2-cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.en2-cart-total-row span {
  font-weight: 600;
  font-size: 0.9rem;
}
.en2-cart-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--en2-dark);
}
.en2-cart-scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 43, 29, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 150;
}
.en2-cart-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

/* Produk page add-to-cart button */
.en2-prod-add {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.en2-btn-add-cart {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--en2-dark);
  background: #fff;
  color: var(--en2-dark);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.en2-btn-add-cart:hover {
  background: var(--en2-dark);
  color: #fff;
  transform: translateY(-1px);
}
.en2-btn-add-cart svg {
  width: 18px;
  height: 18px;
}

/* Checkout page */
.en2-co-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .en2-co-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
.en2-co-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.en2-co-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.en2-co-form label span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--en2-ink);
}
.en2-co-form input,
.en2-co-form textarea {
  padding: 14px 16px;
  border: 1px solid var(--en2-line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--en2-surface);
  transition: 0.2s;
  color: var(--en2-ink);
}
.en2-co-form input:focus,
.en2-co-form textarea:focus {
  outline: none;
  border-color: var(--en2-green);
  box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.12);
}
.en2-co-err {
  background: #fee;
  border: 1px solid #f99;
  border-radius: 12px;
  padding: 12px 16px;
  color: #c33;
  font-size: 0.85rem;
}
.en2-co-right {
  position: sticky;
  top: 96px;
}
.en2-co-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Shipping options */
.en2-ship-options {
  margin: 16px 0;
  padding: 0;
  border: 1px solid var(--en2-line);
  border-radius: 12px;
  overflow: hidden;
}
.en2-ship-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--en2-line);
  cursor: pointer;
  transition: 0.15s;
}
.en2-ship-opt:last-child {
  border-bottom: 0;
}
.en2-ship-opt:hover {
  background: var(--en2-bg);
}
.en2-ship-opt input {
  width: 18px;
  height: 18px;
  accent-color: var(--en2-green);
}
.en2-ship-opt-info {
  flex: 1;
}
.en2-ship-opt-info b {
  display: block;
  font-size: 0.88rem;
}
.en2-ship-opt-info span {
  font-size: 0.76rem;
  color: var(--en2-muted);
}
.en2-ship-opt-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--en2-dark);
}

/* Payment methods */
.en2-pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 0;
}
@media (max-width: 600px) {
  .en2-pay-methods {
    grid-template-columns: 1fr;
  }
}
.en2-pay-card {
  padding: 16px;
  border: 1px solid var(--en2-line);
  border-radius: 12px;
  text-align: center;
  transition: 0.2s;
  cursor: pointer;
}
.en2-pay-card b {
  display: block;
  font-size: 0.85rem;
  margin: 6px 0 2px;
}
.en2-pay-card span {
  font-size: 0.74rem;
  color: var(--en2-muted);
}
.en2-pay-card.active {
  border-color: var(--en2-green);
  background: rgba(0, 168, 89, 0.04);
  box-shadow: 0 0 0 2px rgba(0, 168, 89, 0.15);
}
.en2-pay-card svg,
.en2-pay-card .ic {
  font-size: 1.6rem;
}

/* Bank transfer details */
.en2-bank-detail {
  display: none;
  background: var(--en2-bg);
  border: 1px solid var(--en2-line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}
.en2-bank-detail.show {
  display: block;
}
.en2-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--en2-line);
  font-size: 0.85rem;
}
.en2-bank-row:last-child {
  border-bottom: 0;
}
.en2-bank-row b {
  color: var(--en2-dark);
}
.en2-bank-copy {
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--en2-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--en2-muted);
  transition: 0.2s;
}
.en2-bank-copy:hover {
  border-color: var(--en2-ink);
  color: var(--en2-ink);
}

/* 3.0 commerce components align with the storefront system. */
.en2-cart-drawer {
  max-width: 100vw;
  background: var(--en2-bg);
}
.en2-cart-drawer .en2-btn,
.en2-co-form .en2-btn {
  border-radius: 2px;
  background: var(--en2-dark);
  box-shadow: none;
}
.en2-toast {
  background: var(--en2-dark);
  border-radius: 3px;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  z-index: 400;
}
.en2-cart-qty button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 2px;
}
.en2-cart-close {
  min-width: 44px;
  min-height: 44px;
}
.en2-cart-item-info {
  min-width: 0;
  overflow-wrap: anywhere;
}
.en2-cart-item-info b {
  font-weight: 500;
}
.en2-ship-opt,
.en2-pay-card,
.en2-co-right,
.en2-co-form input,
.en2-co-form textarea {
  border-radius: 2px;
  box-shadow: none;
}
.en2-pay-card {
  font-family: inherit;
  text-align: left;
  color: var(--en2-ink);
  min-width: 0;
  cursor: pointer;
}
.en2-pay-card.active {
  border-color: var(--en2-dark);
  background: #e9edde;
}
.en2-bank-detail {
  border-radius: 2px;
  background: #eeeee5;
  font-size: 12px;
}
.en2-co-right {
  position: static;
  min-width: 0;
  background: #efefe7;
  padding: 28px;
}
.en2-co-form input,
.en2-co-form textarea {
  font-size: 16px;
}
.en2-co-form label > span {
  font-size: 13px;
}
.en2-co-err {
  color: #8a2c1b;
}
.en2-co-grid {
  align-items: start;
}
.en2-cart-qty {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .en2-co-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 32px;
  }
  .en2-co-left,
  .en2-co-right {
    width: 100%;
  }
  .en2-co-right {
    padding: 20px;
  }
  .en2-cart-item {
    gap: 10px;
  }
  .en2-cart-item-info b {
    font-size: 12px;
  }
  .en2-cart-qty {
    gap: 4px;
  }
  .en2-pay-methods {
    grid-template-columns: 1fr;
  }
  .en2-pay-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
  }
  .en2-ship-opt {
    gap: 8px;
    padding: 14px;
  }
  .en2-ship-opt-info b {
    font-size: 12px;
  }
  .en2-ship-opt-info span {
    font-size: 11px;
  }
  .en2-ship-opt-price {
    font-size: 11px;
  }
}
.en2-cart-toggle {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.en2-btn-add-cart {
  flex: 0 0 auto;
  justify-content: space-between;
  min-height: 44px;
  border-radius: 2px;
  padding: 10px 12px;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
}
.en2-btn-add-cart:hover {
  transform: none;
}
.en2-prod-body .en2-btn-add-cart {
  margin-top: auto;
}
.en2-ship-options,
.en2-co-err,
.en2-cart-close {
  border-radius: 2px;
}
.en2-ship-opt input {
  flex-shrink: 0;
  padding: 0;
}
.en2-pay-card.active {
  box-shadow: none;
}
@media (max-width: 700px) {
  .en2-btn-add-cart {
    font-size: 11px;
    padding: 10px 8px;
  }
  .en2-cart-items {
    padding: 12px 16px;
  }
}
.en-remove-item {
  display: block;
  background: none;
  border: 0;
  padding: 8px 0;
  font-size: 11px;
  text-decoration: underline;
  color: var(--en2-muted);
  min-height: 32px;
}
.en2-cart-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.en2-pay-card {
  background: var(--en2-bg);
}
