/* ══════════════════════════════════════════════════
   Mishka v3 — Cart page (1:1 with React /cart)
   Loaded only on the cart page, after mishka.css.
   ══════════════════════════════════════════════════ */

/* Neutralize the legacy flex container (was for the old table layout).
   Our .mk-cart does its own grid; keep .woocommerce as a centered block. */
.woocommerce-cart .woocommerce {
  display: block !important;
}

.mk-cart {
  font-family: 'Inter', sans-serif;
  color: var(--mk-fg);
}

/* ── Breadcrumb ── */
.mk-cart-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mk-muted);
  margin-bottom: 24px;
}
.mk-cart-crumbs a { color: var(--mk-muted); text-decoration: none; }
.mk-cart-crumbs a:hover { color: var(--mk-fg); }
.mk-cart-crumbs svg { opacity: 0.6; }
.mk-cart-crumbs span { color: var(--mk-fg); }

/* ── Title ── */
.mk-cart-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 8px !important;
}
@media (min-width: 768px) {
  .mk-cart-title { font-size: 44px; }
}
.mk-cart-subcount {
  font-size: 14px;
  color: var(--mk-muted);
  margin: 0 0 32px !important;
}

/* ── 2-column grid ── */
.mk-cart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 1024px) {
  .mk-cart-grid { grid-template-columns: minmax(0, 1fr) 400px; }
}
.mk-cart-lines { min-width: 0; }

/* ══ Left: line items ══ */
.mk-cart-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mk-cart-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--mk-r-2xl);
  background: var(--mk-surface);
  border: 0.5px solid var(--mk-border);
}

/* Thumbnail */
.mk-cart-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--mk-r-xl);
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  background: linear-gradient(135deg, #F5F5F5, #E0E0E0);
}
@media (min-width: 768px) {
  .mk-cart-thumb { width: 112px; height: 112px; }
}
.mk-cart-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  margin: 0 !important;
}

/* Info column */
.mk-cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mk-cart-brand {
  font-size: 11px;
  color: var(--mk-muted);
  line-height: 1.4;
}
.mk-cart-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--mk-fg) !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-cart-name:hover { text-decoration: underline; }
.mk-cart-meta {
  font-size: 12px;
  color: var(--mk-muted);
  margin-top: 2px;
}
.mk-cart-meta p { margin: 0 !important; }
.mk-cart-sku {
  font-size: 11px;
  color: var(--mk-muted);
  margin-top: 4px;
}

/* Controls row (pinned to bottom) */
.mk-cart-controls {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

/* Quantity stepper */
.mk-qty {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border-radius: var(--mk-r-lg);
  border: 0.5px solid var(--mk-border);
  background: var(--mk-bg);
  overflow: hidden;
  flex-shrink: 0;
}
.mk-qty-btn {
  width: 36px;
  height: 100%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;   /* override global/theme button bg (was rendering black) */
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: var(--mk-fg) !important;
  padding: 0 !important;
  min-width: 0 !important;
  transition: background 0.12s;
}
.mk-qty-btn:hover { background: var(--mk-surface2) !important; }
.mk-qty-btn svg { display: block; }
.mk-qty-input {
  width: 34px;
  height: 100%;
  text-align: center;
  border: none !important;
  background: transparent !important;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--mk-fg);
  padding: 0 !important;
  margin: 0 !important;
  -moz-appearance: textfield;
  appearance: textfield;
}
.mk-qty-input::-webkit-outer-spin-button,
.mk-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mk-qty-input:focus { outline: none; box-shadow: none; }
.mk-qty--single { padding: 0 14px; justify-content: center; }
.mk-qty-val { font-size: 13px; font-weight: 500; }

/* Save for later */
.mk-save-later {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--mk-muted);
  padding: 0;
  transition: color 0.12s;
  white-space: nowrap;
}
.mk-save-later:hover { color: var(--mk-fg); }

/* Line total */
.mk-line-total {
  font-size: 15px;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.mk-line-total .woocommerce-Price-amount { font-weight: 600; }

/* Remove button */
.mk-cart-remove {
  align-self: flex-start;
  width: 32px;
  height: 32px;
  border-radius: var(--mk-r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mk-muted) !important;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
  text-decoration: none !important;
}
.mk-cart-remove:hover { background: var(--mk-surface2); color: var(--mk-fg) !important; }

/* Hidden update button */
.mk-cart-update-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ── Frequently bought with this ── */
.mk-suggest { margin-top: 24px; }
.mk-suggest-heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mk-muted);
  font-weight: 500;
  margin-bottom: 12px;
}
.mk-suggest { max-width: 100%; min-width: 0; }
.mk-suggest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .mk-suggest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mk-suggest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-suggest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--mk-r-xl);
  background: var(--mk-surface);
  border: 0.5px solid var(--mk-border);
  min-width: 0;
  overflow: hidden;
}
.mk-suggest-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--mk-r-lg);
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #F5F5F5, #E0E0E0);
}
.mk-suggest-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-suggest-body { flex: 1; min-width: 0; }
.mk-suggest-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--mk-fg) !important;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-suggest-name:hover { text-decoration: underline; }
.mk-suggest-price { font-size: 12px; color: var(--mk-muted); }
.mk-suggest-add {
  width: 32px;
  height: 32px;
  border-radius: var(--mk-r-pill);
  background: var(--mk-fg);
  color: #fff !important;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.12s;
  text-decoration: none !important;
}
.mk-suggest-add:hover { opacity: 0.85; }
.mk-suggest-add.added,
.mk-suggest-add.disabled { opacity: 0.3; pointer-events: none; }

/* ══ Right: summary ══ */
.mk-cart-summary-col { align-self: start; }
@media (min-width: 1024px) {
  .mk-cart-summary-col { position: sticky; top: 120px; }
}
.mk-summary {
  border-radius: var(--mk-r-2xl);
  background: var(--mk-surface);
  border: 0.5px solid var(--mk-border);
  padding: 20px;
}

/* Milestones */
.mk-milestones {
  margin-bottom: 16px;
  border-radius: var(--mk-r-xl);
  border: 0.5px solid var(--mk-border);
  background: rgba(13,13,13,0.03);
  padding: 12px;
}
.mk-milestones-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mk-muted);
  margin-bottom: 8px;
}
.mk-milestones-amount { font-weight: 500; color: var(--mk-fg); }
.mk-milestones-amount .woocommerce-Price-amount { font-weight: 500; }
.mk-milestones-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--mk-muted);
  margin: 8px 0;
}
.mk-milestones-ticks .is-reached { color: var(--mk-fg); font-weight: 500; }
.mk-milestones-msg { font-size: 12px; }

/* Progress bars */
.mk-progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--mk-border);
  overflow: hidden;
}
.mk-progress--thin {
  height: 4px;
  background: rgba(13,13,13,0.1);
}
.mk-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: var(--mk-fg);
  transition: width 0.3s ease;
}

/* Free delivery */
.mk-freeship { margin-bottom: 20px; }
.mk-freeship-done {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mk-success);
  font-size: 13px;
  font-weight: 500;
}
.mk-freeship-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mk-fg);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.mk-freeship-msg .woocommerce-Price-amount { font-weight: 600; }

/* Promo */
.mk-promo { margin-bottom: 20px; }
.mk-promo-form { display: flex; gap: 8px; }
.mk-promo-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--mk-r-lg);
  border: 0.5px solid var(--mk-border) !important;
  background: var(--mk-bg);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--mk-fg);
}
.mk-promo-input:focus { outline: none; border-color: var(--mk-fg) !important; box-shadow: none; }
.mk-promo-apply {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--mk-r-lg);
  border: 0.5px solid var(--mk-border);
  background: var(--mk-bg);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--mk-fg);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.mk-promo-apply:hover { background: var(--mk-surface2); }
.mk-promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.mk-promo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mk-success);
}
.mk-promo-remove {
  font-size: 16px;
  line-height: 1;
  color: var(--mk-muted) !important;
  text-decoration: none !important;
}
.mk-promo-remove:hover { color: var(--mk-sale) !important; }

/* Totals */
.mk-totals { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.mk-total-row { display: flex; justify-content: space-between; align-items: center; }
.mk-total-row .mk-muted { color: var(--mk-muted); }
.mk-total-row--discount { color: var(--mk-success); }
.mk-total-row .woocommerce-Price-amount { font-weight: 500; }
.mk-vat-note {
  color: var(--mk-muted);
  font-size: 11px;
  line-height: 1.4;
  padding-top: 4px;
}

.mk-divider {
  height: 0;
  border-top: 0.5px solid var(--mk-border);
  margin: 16px 0;
}

.mk-grandtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.mk-grandtotal-label { font-size: 14px; font-weight: 500; }
.mk-grandtotal-value { font-size: 24px; font-weight: 600; }
.mk-grandtotal-value .woocommerce-Price-amount { font-weight: 600; }

.mk-esto { margin-top: 12px; font-size: 12px; color: var(--mk-muted); }
.mk-esto-amount { color: var(--mk-fg); font-weight: 500; }
.mk-esto-amount .woocommerce-Price-amount { font-weight: 500; }

/* Buttons */
.mk-checkout-btn {
  margin-top: 20px;
  width: 100%;
  height: 48px;
  border-radius: var(--mk-r-lg);
  background: var(--mk-fg);
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: opacity 0.15s;
}
.mk-checkout-btn:hover { opacity: 0.9; }
.mk-continue-btn {
  margin-top: 8px;
  width: 100%;
  height: 44px;
  border-radius: var(--mk-r-lg);
  border: 0.5px solid var(--mk-border);
  background: var(--mk-bg);
  color: var(--mk-fg) !important;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: background 0.12s;
}
.mk-continue-btn:hover { background: var(--mk-surface2); }

/* Secure badge */
.mk-secure {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: var(--mk-muted);
}
.mk-secure-badge { display: inline-flex; align-items: center; gap: 6px; }
