/*
 * Header cart dropdown (common/cart.twig, .mc), also what opens after an add to cart (js/common.js show_cart_added:
 * .mc-added confirmation, .mc-item-added line). Loaded on every page by journal3/event/header.php; overrides the
 * Journal skin's table-based mini cart.
 */

.mc {
  --mc-text: #111827;
  --mc-soft: #374151;
  --mc-muted: #6b7280;
  --mc-border: #e5e7eb;
  --mc-surface-soft: #f8fafc;
  --mc-accent: #2563eb;
  --mc-accent-hover: #1d4ed8;
  --mc-success: #15803d;
  --mc-radius: 12px;
}

/* ---------- Header cart dropdown ---------- */

#cart #cart-content.mc {
  width: 400px;
  max-width: calc(100vw - 24px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  background: #fff;
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .28);
}

#cart #cart-content.mc > ul,
.mobile-cart-content-wrapper.mc > ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

#cart #cart-content.mc > ul > li,
.mobile-cart-content-wrapper.mc > ul > li {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* phones: the off-canvas panel has its own title bar */
.mobile-cart-content-wrapper.mc .mc-head {
  display: none !important;
}

/* right after an add: confirmation on top, the added line tinted */
.mc .mc-added {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px !important;
  border-bottom: 1px solid #bbf7d0 !important;
  background: #f0fdf4 !important;
  color: var(--mc-success);
  font-size: 14px;
  font-weight: 700;
}

.mc .mc-added[hidden] {
  display: none;
}

.mc .mc-added i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcfce7;
  font-size: 11px;
}

.mc .mc-item.mc-item-added {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--mc-accent);
}

.mc .mc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px !important;
  border-bottom: 1px solid var(--mc-border) !important;
}

.mc .mc-title {
  color: var(--mc-text);
  font-size: 16px;
  font-weight: 700;
}

.mc .mc-count {
  color: var(--mc-muted);
  font-size: 13px;
}

/* the item list scrolls on its own when long, so the totals and buttons stay in view */
.mc .mc-items {
  max-height: min(46vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mc .mc-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 16px;
}

.mc .mc-item + .mc-item {
  border-top: 1px solid var(--mc-border);
}

.mc .mc-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--mc-border);
  border-radius: 8px;
  background: #fff;
}

.mc .mc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  padding: 0;
}

.mc .mc-thumb-voucher {
  color: var(--mc-accent);
  font-size: 22px;
}

.mc .mc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mc .mc-name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--mc-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mc a.mc-name:hover {
  color: var(--mc-accent);
  text-decoration: none;
}

.mc .mc-options,
.mc .mc-qty {
  color: var(--mc-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.mc .mc-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.mc .mc-total {
  color: var(--mc-text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.mc .mc-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--mc-muted);
  font-size: 15px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.mc .mc-remove:hover,
.mc .mc-remove:focus-visible {
  background: #fef2f2;
  color: #dc2626;
}

.mc .mc-foot {
  padding: 12px 16px 16px !important;
  border-top: 1px solid var(--mc-border) !important;
  background: var(--mc-surface-soft) !important;
}

.mc .mc-totals {
  margin: 0 0 12px;
}

.mc .mc-total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  color: var(--mc-muted);
  font-size: 13px;
}

.mc .mc-total-row dt,
.mc .mc-total-row dd {
  margin: 0;
  font-weight: 400;
}

.mc .mc-total-row.mc-grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--mc-border);
  color: var(--mc-text);
  font-size: 17px;
}

.mc .mc-total-row.mc-grand dt,
.mc .mc-total-row.mc-grand dd {
  font-weight: 800;
}

/* view cart | checkout: one row, checkout the stronger one (Journal's .cart-content .cart-buttons is a flex column) */
:is(#cart, .mobile-cart-content-container) .mc .mc-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

/* (prefixed: the Journal skin colours the cart buttons with background-color) */
:is(#cart, .mobile-cart-content-container) .mc .mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  box-shadow: none;
  background: #fff;
  background-color: #fff;
  color: var(--mc-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}

:is(#cart, .mobile-cart-content-container) .mc .mc-btn::before,
:is(#cart, .mobile-cart-content-container) .mc .mc-btn::after {
  content: none;
}

:is(#cart, .mobile-cart-content-container) .mc .mc-btn.mc-btn-cart:hover {
  border-color: var(--mc-accent);
  background-color: #eff6ff;
  color: var(--mc-accent);
}

:is(#cart, .mobile-cart-content-container) .mc .mc-btn.mc-btn-checkout {
  border-color: var(--mc-accent);
  background-color: var(--mc-accent);
  color: #fff;
}

:is(#cart, .mobile-cart-content-container) .mc .mc-btn.mc-btn-checkout:hover {
  border-color: var(--mc-accent-hover);
  background-color: var(--mc-accent-hover);
  color: #fff;
}

.mc .mc-btn-checkout i {
  font-size: 13px;
}

.mc .mc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px !important;
  color: var(--mc-muted);
}

/* Journal's .cart-empty: keep its cart icon (::before), not its grey box */
.mc .mc-empty .cart-empty {
  margin: 0;
  padding: 0;
  background-color: transparent;
}

@media (max-width: 480px) {
  :is(#cart, .mobile-cart-content-container) .mc .mc-btn {
    font-size: 14px;
  }
}
