/* Manokamna website - Styles for cart, checkout and order status pages */
/* =========================================================
   Cart, Checkout & Order Status styles
   Uses the colour tokens from style-optimized.css
   ========================================================= */

/* ---------- Product page: Buy Now / Add to Cart ---------- */
.mk-buy-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 30px 0 12px;
}
.mk-buy-actions .btn-large { flex: 1 1 200px; text-align: center; padding: 16px 28px; }
.mk-buy-actions button.btn { font-family: inherit; }

.mk-marketplace { margin: 8px 0 24px; }
.mk-marketplace-label {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}
.mk-marketplace.product-actions-enhanced { margin: 8px 0 24px; gap: 10px; }
.mk-marketplace .btn-large { padding: 10px 24px; font-size: 0.8rem; letter-spacing: 1px; }

/* ---------- Toast ---------- */
.mk-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--dark);
  color: var(--white);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.mk-toast a { color: var(--gold-light); font-weight: 600; white-space: nowrap; }

/* ---------- Shared page layout ---------- */
.mk-page [hidden] { display: none !important; }
.mk-page { padding: 50px 0 80px; }
.mk-page h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  color: var(--dark);
  margin-bottom: 24px;
}
.mk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.mk-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.mk-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 16px;
}

/* ---------- Cart lines ---------- */
.mk-line {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(200,134,10,0.15);
}
.mk-line:first-child { padding-top: 0; }
.mk-line:last-child { border-bottom: 0; padding-bottom: 0; }
.mk-line img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--cream);
  border-radius: 8px;
}
.mk-line-title { font-weight: 600; color: var(--dark); line-height: 1.3; }
.mk-line-title a:hover { color: var(--gold); }
.mk-line-meta { font-size: 0.85rem; color: var(--text-light); }
.mk-line-total { font-weight: 600; color: var(--dark); text-align: right; white-space: nowrap; }
.mk-line-controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.mk-line.unavailable .mk-line-title { color: #a33; }

.mk-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.mk-qty button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  font-size: 1.1rem;
  cursor: pointer;
}
.mk-qty button:hover:not(:disabled) { background: rgba(200,134,10,0.1); }
.mk-qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.mk-qty span { min-width: 28px; text-align: center; font-weight: 600; }

.mk-link-btn {
  border: 0;
  background: none;
  color: var(--text-light);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.mk-link-btn:hover { color: #a33; }

/* ---------- Summary ---------- */
.mk-summary { position: sticky; top: 100px; }
.mk-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.95rem; }
.mk-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}
.mk-note { font-size: 0.8rem; color: var(--text-light); margin-top: 8px; }
.mk-free-hint {
  font-size: 0.85rem;
  background: rgba(200,134,10,0.08);
  color: var(--gold-dark);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
}
.mk-summary .btn { display: block; width: 100%; text-align: center; margin-top: 18px; font-family: inherit; }
.mk-summary .btn-large { padding: 16px 20px; font-size: 1rem; }
.mk-summary .btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.mk-empty { text-align: center; padding: 60px 20px; }
.mk-empty p { margin-bottom: 24px; color: var(--text-light); }

/* ---------- Checkout form ---------- */
.mk-form .mk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.mk-form .full { grid-column: 1 / -1; }
.mk-form label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.mk-form input,
.mk-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--dark);
  font-family: inherit;
  font-size: 0.95rem;
}
.mk-form input:focus,
.mk-form select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,134,10,0.12);
}
.mk-form input[aria-invalid="true"] { border-color: #c0392b; }
.mk-form h2 + .mk-fields { margin-top: 4px; }
.mk-form .mk-section + .mk-section { margin-top: 28px; }

.mk-msg {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.mk-msg.show { display: block; }
.mk-msg.error { background: #fdecea; color: #a12a1d; }
.mk-msg.info { background: rgba(200,134,10,0.1); color: var(--gold-dark); }

.mk-secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.8rem; color: var(--text-light); margin-top: 12px; }

/* compact item list in checkout summary */
.mk-mini { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(200,134,10,0.12); font-size: 0.9rem; }
.mk-mini img { width: 52px; height: 52px; object-fit: contain; background: var(--cream); border-radius: 6px; flex-shrink: 0; }
.mk-mini .grow { flex: 1; min-width: 0; line-height: 1.35; }
.mk-mini .muted { color: var(--text-light); font-size: 0.8rem; }

/* ---------- Order status ---------- */
.mk-status { max-width: 620px; margin: 0 auto; text-align: center; }
.mk-status-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(200,134,10,0.12);
  color: var(--gold-dark);
}
.mk-status-icon.ok { background: #e6f4ea; color: #1e7e34; }
.mk-status-icon.bad { background: #fdecea; color: #a12a1d; }
.mk-status p.lead { color: var(--text-light); margin-bottom: 20px; }
.mk-status .mk-card { text-align: left; margin-top: 10px; }
.mk-status .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.mk-status .actions .btn { font-family: inherit; }

.mk-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(200,134,10,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: mk-spin 0.9s linear infinite;
}
@keyframes mk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mk-spinner { animation-duration: 3s; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mk-grid { grid-template-columns: 1fr; }
  .mk-summary { position: static; }
}
@media (max-width: 560px) {
  .mk-page { padding: 30px 0 60px; }
  .mk-page h1 { font-size: 1.9rem; }
  .mk-card { padding: 18px; }
  .mk-form .mk-fields { grid-template-columns: 1fr; }
  .mk-line { grid-template-columns: 64px minmax(0, 1fr); }
  .mk-line img { width: 64px; height: 64px; }
  .mk-line-total { grid-column: 2; text-align: left; }
}
