/* Magic Days — Square checkout modal.
 * Themed on the single design system (theme.css --mm-* tokens) with standalone
 * literal fallbacks on every var() so the modal still renders correctly even
 * when it mounts somewhere theme.css is absent. Buttons use the mm plum pill. */

.mdck-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(67, 53, 79, 0.46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: mdck-fade 0.18s ease-out;
}
@keyframes mdck-fade { from { opacity: 0; } to { opacity: 1; } }

.mdck-modal {
  position: relative;
  width: min(440px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--mm-card, rgba(255, 255, 255, 0.93));
  border-radius: var(--mm-radius, 20px);
  box-shadow: var(--mm-shadow, 0 14px 38px rgba(120, 90, 60, 0.22), 0 3px 10px rgba(120, 90, 60, 0.12));
  padding: 26px 24px 22px;
  font-family: var(--mm-font, 'Nunito', system-ui, -apple-system, sans-serif);
  color: var(--mm-ink, #43354F);
  animation: mdck-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes mdck-pop { from { transform: translateY(14px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.mdck-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--cream-2, #FDEFD9);
  color: var(--mm-ink-soft, #6E6076);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.mdck-close:hover { background: var(--rose, #EF9A93); color: #fff; transform: rotate(90deg); }

.mdck-title {
  font-family: var(--mm-font-head, 'Fredoka', 'Nunito', sans-serif);
  font-weight: 600;
  font-size: 1.32rem;
  margin: 0 0 8px;
  color: var(--mm-ink, #43354F);
}
.mdck-lead, .mdck-secure, .mdck-ship-note {
  font-size: 0.92rem;
  color: var(--mm-ink-soft, #6E6076);
  line-height: 1.45;
}
.mdck-lead { margin: 0 0 16px; }

/* ---- order summary ---- */
.mdck-summary {
  background: var(--cream, #FFF8EF);
  border: 1px solid var(--rule, #F0E4D4);
  border-radius: var(--mm-radius-sm, 12px);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.mdck-lines { list-style: none; margin: 6px 0 0; padding: 0; }
.mdck-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 0.96rem;
}
.mdck-line-name { color: var(--mm-ink, #43354F); }
.mdck-line-price { color: var(--mm-ink-soft, #6E6076); font-variant-numeric: tabular-nums; }
.mdck-total {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px dashed var(--rule, #F0E4D4);
  font-family: var(--mm-font-head, 'Fredoka', sans-serif);
  font-weight: 600;
  font-size: 1.08rem;
}
.mdck-total-amt { color: var(--mm-plum, #8a4fb0); font-variant-numeric: tabular-nums; }
.mdck-ship-note { margin: 8px 0 0; font-size: 0.84rem; font-style: italic; }

/* ---- fields ---- */
.mdck-field { margin-bottom: 14px; }
.mdck-label {
  display: block;
  font-family: var(--mm-font-head, 'Fredoka', sans-serif);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--mm-ink-soft, #6E6076);
}
.mdck-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.78em 0.95em;
  font-family: var(--mm-font, 'Nunito', sans-serif);
  font-size: 1rem;
  color: var(--mm-ink, #43354F);
  background: #fff;
  border: 2px solid var(--rule, #F0E4D4);
  border-radius: var(--mm-radius-sm, 12px);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mdck-input:focus {
  outline: none;
  border-color: var(--mm-orchid, #b566d6);
  box-shadow: 0 0 0 3px rgba(181, 102, 214, 0.22);
}

/* ---- Square card field (Square renders an iframe inside) ---- */
.mdck-card {
  padding: 4px 2px;
  border: 2px solid var(--rule, #F0E4D4);
  border-radius: var(--mm-radius-sm, 12px);
  background: #fff;
  min-height: 46px;
}

/* ---- buttons ---- */
.mdck-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85em 1.4em;
  font-family: var(--mm-font-head, 'Fredoka', sans-serif);
  font-weight: 500;
  font-size: 1.05rem;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}
.mdck-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--mm-orchid, #b566d6) 0%, var(--mm-plum, #8a4fb0) 100%);
  box-shadow: 0 6px 18px rgba(138, 79, 176, 0.32);
}
.mdck-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(138, 79, 176, 0.42); }
.mdck-btn:disabled { opacity: 0.55; cursor: default; }
.mdck-pay { margin-top: 6px; }

/* "finish later" text link (styled here; checkout.js just adds the class) */
.mdck-later {
  margin-top: 10px;
  background: none;
  border: 0;
  color: var(--mm-plum, #8a4fb0);
  font-family: var(--mm-font, 'Nunito', sans-serif);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- wallet buttons ---- */
.mdck-wallets { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.mdck-wallets:empty { display: none; }
.mdck-wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0.7em 1.2em;
  border: none;
  border-radius: 999px;
  font-family: var(--mm-font-head, 'Fredoka', sans-serif);
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}
.mdck-wallet:hover { transform: translateY(-1px); }
.mdck-wallet-label { display: inline-flex; align-items: center; gap: 8px; }
.mdck-applepay { background: #000; color: #fff; }
/* Square renders Google Pay / Cash App Pay buttons inside these hosts. */
.mdck-wallet-host { width: 100%; min-height: 46px; }

/* ---- divider ---- */
.mdck-or {
  position: relative;
  text-align: center;
  margin: 14px 0;
  font-size: 0.82rem;
  color: var(--ink-faint, #9C90A4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mdck-or::before, .mdck-or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 32%;
  height: 1px;
  background: var(--rule, #F0E4D4);
}
.mdck-or::before { left: 0; }
.mdck-or::after { right: 0; }

/* ---- status + secure note ---- */
.mdck-status {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.4;
}
.mdck-status-err { color: var(--rose-deep, #E2776E); font-weight: 600; }
.mdck-status-ok { color: #2E9E6B; font-weight: 600; }
.mdck-secure { margin: 12px 0 0; text-align: center; font-size: 0.82rem; }

/* ---- waitlist form ---- */
.mdck-leadform { display: flex; flex-direction: column; gap: 12px; }

/* ---- responsive (phone / small tablet) ---- */
@media (max-width: 640px) {
  .mdck-overlay { padding: 12px; align-items: flex-start; }
  .mdck-modal {
    width: min(440px, 94vw);
    max-height: 92vh;
    margin-top: 2vh;
    padding: 22px 16px 18px;
    border-radius: 16px;
  }
  .mdck-title { font-size: 1.18rem; }
  /* Keep the close button reachable on tall, scrolling modals. */
  .mdck-close {
    position: sticky;
    float: right;
    top: 0;
    margin: -6px -4px 0 0;
    width: 40px;
    height: 40px;
    font-size: 24px;
    z-index: 2;
  }
  /* ≥16px inputs prevent iOS zoom-on-focus; full-width, comfortable taps. */
  .mdck-input { font-size: 16px; }
  .mdck-btn { font-size: 1.05rem; padding: 0.95em 1.4em; }
  .mdck-wallet { min-height: 48px; }
  .mdck-wallet-host { min-height: 48px; }
  .mdck-pay { min-height: 48px; }
}
