/* ============================================================
   cart.css — cart drawer, floating cart button, toast, buttons
   Load AFTER programs.css (and styles.css). Also used by checkout.html.
   Uses the site's own tokens (--ink, --rust, --paper, --gold, ...)
   with fallbacks, so it matches the new design.
   ============================================================ */

:root {
  --mz-ink: var(--ink, #10233f);
  --mz-rust: var(--rust, #b4532a);
  --mz-gold: var(--gold, #c9a24a);
  --mz-paper: var(--paper, #f7f4ed);
  --mz-paper-dark: var(--paper-dark, #ece3d1);
  --mz-hair: var(--hairline, rgba(16, 35, 63, 0.16));
  --mz-ink-72: var(--ink-72, rgba(16, 35, 63, 0.72));
}

/* ---------- ADD TO CART button on the product cards ---------- */
/* Keeps the exact look of the old "Enquire →" link */
button.program-card__link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
}
button.program-card__link.is-added { color: var(--mz-ink); }

/* The tablet rule that stretched card #3 across the grid was made for 3 cards.
   With 9 products it looked odd, so cards stay uniform. */
@media (max-width: 960px) {
  .program-card:nth-child(3) {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }
}

/* ---------- BUTTONS (shared with checkout) ---------- */
.mz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.mz-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mz-btn--ink { background: var(--mz-ink); color: var(--mz-paper); }
.mz-btn--ink:hover:not(:disabled) { background: var(--mz-gold); color: var(--mz-ink); transform: translateY(-1px); }
.mz-btn--ghost { background: transparent; color: var(--mz-ink); border-color: var(--mz-hair); }
.mz-btn--ghost:hover:not(:disabled) { border-color: var(--mz-ink); }
.mz-btn--wa { background: #25d366; color: #fff; }
.mz-btn--wa:hover:not(:disabled) { background: #128c7e; transform: translateY(-1px); }
.mz-btn:focus-visible,
.mz-fab:focus-visible,
.mz-qty button:focus-visible,
.mz-cart__close:focus-visible,
.mz-line__remove:focus-visible {
  outline: 2px solid var(--mz-gold);
  outline-offset: 2px;
}

/* ---------- FLOATING CART BUTTON ---------- */
.mz-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 8000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(247, 244, 237, 0.25);
  background: rgba(21, 75, 14, 0.6);
  color: var(--mz-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(16, 35, 63, 0.35);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.mz-fab:hover { background: var(--mz-gold); color: var(--mz-ink); transform: translateY(-2px); }
.mz-fab__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--mz-gold);
  color: var(--mz-ink);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mz-fab__count[hidden] { display: none; }
.mz-cart-open .mz-fab { opacity: 0; pointer-events: none; }

/* ---------- DRAWER ---------- */
.mz-cart {
  position: fixed;
  inset: 0;
  z-index: 9000;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.35s;
}
.mz-cart.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }

.mz-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 39, 65, 0.6);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mz-cart.is-open .mz-cart__backdrop { opacity: 1; }

.mz-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: white;
  color: var(--mz-ink);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: -30px 0 70px rgba(16, 35, 63, 0.3);
  font-family: 'Inter', sans-serif;
  outline: none;
}
.mz-cart.is-open .mz-cart__panel { transform: translateX(0); }

.mz-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: rgba(23, 77, 15, 0.911);
  color: var(--mz-paper);
}
.mz-cart__eyebrow {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mz-gold);
  margin-bottom: 6px;
}
.mz-cart__title {
  font-family:  'Inter', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.mz-cart__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(247, 244, 237, 0.3);
  background: transparent;
  color: var(--mz-paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.mz-cart__close:hover { background: var(--mz-gold); color: var(--mz-ink); border-color: var(--mz-gold); }

.mz-cart__body { flex: 1; overflow-y: auto; padding: 8px 24px; }

.mz-lines { list-style: none; margin: 0; padding: 0; }
.mz-line {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--mz-hair);
}
.mz-line:last-child { border-bottom: none; }
.mz-line__img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--mz-paper);
}
.mz-line__main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.mz-line__top { display: flex; justify-content: space-between; gap: 8px; }
.mz-line__name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
}
.mz-line__variant { font-size: 12px; color: var(--mz-ink-72); margin-top: 4px; }
.mz-line__remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--mz-ink-72);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.mz-line__remove:hover { color: var(--mz-rust); }
.mz-line__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mz-line__total { font-weight: 700; font-size: 14px; }

.mz-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mz-hair);
  border-radius: 100px;
  background: var(--mz-paper);
}
.mz-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  font-size: 16px;
  color: var(--mz-ink);
  cursor: pointer;
  transition: background 0.2s ease;
}
.mz-qty button:hover { background: var(--mz-gold); }
.mz-qty span { min-width: 28px; text-align: center; font-size: 13px; font-weight: 700; }

.mz-cart__foot { padding: 20px 24px 24px; border-top: 1px solid var(--mz-hair); background: var(--mz-paper-dark); }
.mz-cart__foot[hidden] { display: none; }
.mz-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; color: var(--mz-ink-72); }
.mz-row__amount { font-family: 'inter',  sans-serif; font-weight: 500; font-size: 24px; color: var(--mz-ink); }
.mz-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 100px;
  background: var(--mz-paper);
  color: var(--mz-ink);
}
.mz-pill.is-free { background: var(--mz-ink); color: var(--mz-paper); }
.mz-note { font-size: 12px; color: var(--mz-ink-72); margin: 6px 0 0; }
.mz-actions { display: flex; gap: 10px; margin-top: 18px; }
.mz-actions .mz-btn { flex: 1; padding: 14px 12px; }

.mz-empty { text-align: center; padding: 64px 12px; }
.mz-empty__title {
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-weight: 500;
  font-size: 22px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.mz-empty__text { font-size: 13px; color: var(--mz-ink-72); margin-bottom: 24px; }

/* ---------- TOAST ---------- */
.mz-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 8500;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 14px 12px 20px;
  background: var(--mz-ink);
  color: var(--mz-paper);
  border-radius: 100px;
  box-shadow: 0 18px 40px rgba(16, 35, 63, 0.35);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.35s ease;
}
.mz-toast.is-show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.mz-toast__btn {
  border: none;
  background: var(--mz-gold);
  color: var(--mz-ink);
  border-radius: 100px;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .mz-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .mz-toast { bottom: 84px; }
  .mz-cart__head, .mz-cart__foot { padding-left: 18px; padding-right: 18px; }
  .mz-cart__body { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .mz-cart, .mz-cart__backdrop, .mz-cart__panel, .mz-toast, .mz-fab, .mz-btn { transition: none; }
}