/* cart-modal.css — Chundra */

/* ── Cart FAB ── */
#cart-fab {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #594593;
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  z-index: 1050;
  transition: background 0.2s, transform 0.15s;
}
#cart-fab:hover { background: #318160; transform: scale(1.06); }

#cart-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d11040;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Modal shell ── */
#cart-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
}
#cart-modal.is-open { display: block; }

#cm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
}

/* ── Side panel ── */
#cm-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 480px;
  max-width: 100vw;
  background: #EBE9D4;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 30px rgba(0,0,0,0.15);
  animation: slideIn 0.22s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ── Header ── */
#cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.6rem 1.2rem;
  border-bottom: 1px solid #d8d5c3;
}
#cm-header h2 {
  font-family: "Edu AU VIC WA NT Pre", cursive;
  font-size: 1.6rem;
  font-weight: 200;
  margin: 0;
  color: #333;
}
#cm-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 0;
}
#cm-close:hover { color: #333; }

/* ── Body (scrollable) ── */
#cm-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.6rem;
  display: flex;
  flex-direction: column;
}

#cm-empty {
  text-align: center;
  padding: 3rem 0;
  color: #888;
}

/* ── Item list ── */
#cm-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.cm-item {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  padding: 0.8rem;
  position: relative;
}
.cm-item-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.cm-item-info { flex: 1; min-width: 0; }
.cm-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-item-meta { font-size: 0.78rem; color: #999; margin: 0 0 0.25rem; }
.cm-item-price { font-size: 0.9rem; margin: 0; color: #444; }
.cm-remove-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #ccc;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  align-self: flex-start;
}
.cm-remove-btn:hover { color: #d11040; }

/* ── Totals block ── */
#cm-totals {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

/* Subtotal row — with bottom border for visual separation */
#cm-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: #555;
  padding-bottom: 0.9rem;
  border-bottom: 1.5px solid #c8c5b0;
  margin-bottom: 0.9rem;
}
#cm-subtotal {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

/* Shipping to line (inline text + edit icon) */
#cm-zone-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}
#cm-zone-block label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}
#cm-zone-select {
  border: 1px solid #d0cdb8;
  background: #fafaf5;
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #333;
  outline: none;
  cursor: pointer;
  width: 100%;
}
#cm-zone-select:focus { border-color: #594593; }

/* Confirmed shipping line */
#cm-shipping-confirmed {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
#cm-shipping-confirmed.visible { display: flex; }

#cm-shipping-zone-label {
  font-size: 0.9rem;
  color: #555;
}
#cm-shipping-change-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s;
  margin-left: 2px;
}
#cm-shipping-change-btn:hover { opacity: 1; }
#cm-shipping-change-btn img {
  width: 14px;
  height: 14px;
}

/* Shipping cost row */
#cm-shipping-row {
  display: none;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.3rem;
}

#cm-shipping-cost {
  font-weight: 600;
  color: #333;
  text-align: right;
}

#cm-shipping-breakdown {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

#cm-shipping-confirm {
  display: none;
  font-size: 0.78rem;
  color: #a07030;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
#cm-shipping-confirm.visible { display: block; }
#cm-shipping-confirm p { margin: 0; }



#cm-shipping-pending {
  font-size: 0.85rem;
  color: #aaa;
  font-style: italic;
  padding: 0.3rem 0 0.5rem;
}

/* ── Footer: white box with total + button + stripe note ── */
#cm-footer {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid #d8d5c3;
  padding: 1.2rem 1.6rem 1.4rem;
  gap: 0.9rem;
}
#cm-footer.visible { display: flex; }

#cm-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  color: #222;
}
#cm-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
}

#cm-checkout-btn {
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: #594593;
  color: #fff;
  border: 0;
  text-align: center;
  transition: background 0.2s;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0.01em;
}
#cm-checkout-btn:hover:not(:disabled) { background: #318160; }
#cm-checkout-btn:disabled { opacity: 0.45; cursor: not-allowed; }

#cm-stripe-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #aaa;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}
#cm-stripe-note img {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
}

.cm-error { font-size: 0.82rem; color: #d11040; text-align: center; }

@media (max-width: 520px) {
  #cm-panel { width: 100vw; }
}

/* ── Delivery method selector ── */
#cm-delivery-method {
  margin: 0.6rem 0;
}
#cm-delivery-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin: 0 0 0.5rem;
}
#cm-delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.cm-delivery-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.9rem 0.5rem;
  border: 2px solid #d8d5c3;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  text-align: center;
}
.cm-delivery-btn:hover {
  border-color: #594593;
}
.cm-delivery-btn.active {
  border-color: #594593;
  background: #f4f1fb;
}
.cm-delivery-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.cm-delivery-name {
  font-size: 0.78rem;
  color: #444;
  font-weight: 500;
}
.cm-delivery-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #594593;
}
.cm-breakdown-text {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.cm-confirm-note {
  font-size: 0.78rem;
  color: #a07030;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.cm-confirm-note p { margin: 0; }

/* ── No shipping method message ── */
.cm-email-copy {
  color: #594593;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.cm-email-copy:hover { color: #318160; }
