/* ============================================================
   MACRO MARKET — Link de pago
   Front-end panel (order-received + My Account) and the small
   admin bits. Tokens come from the theme's tokens.css; the
   fallbacks keep it honest anywhere they are not loaded.
   ============================================================ */

.mm-pl-panel {
  --pl-line: var(--mm-line, rgba(30, 42, 58, 0.12));
  margin: clamp(28px, 4vw, 44px) 0;
  padding: clamp(22px, 3.5vw, 34px);
  background: var(--bg1, #fff);
  border: 1px solid var(--pl-line);
  border-top: 3px solid var(--mm-deep-navy, #1e2a3a);
  border-radius: var(--r-3, 8px);
  box-shadow: var(--shadow-2, 0 6px 16px -4px rgba(30, 42, 58, 0.1));
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: var(--t-small, 14px);
  line-height: var(--lh-body, 1.55);
  color: var(--fg2, #2b3340);
}

.mm-pl-panel--ok   { border-top-color: var(--state-success, #3b7a4f); }
.mm-pl-panel--sent { border-top-color: var(--mm-gold, #c9a24a); }
.mm-pl-panel--bad  { border-top-color: var(--state-danger, #b8452e); }

/* Notices printed inside the panel (see mm_pago_link_panel). */
.mm-pl-notices { margin-bottom: 18px; }
.mm-pl-notices .woocommerce-message,
.mm-pl-notices .woocommerce-error,
.mm-pl-notices .woocommerce-info {
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: var(--r-2, 4px);
  list-style: none;
  font-size: 14px;
}
/* The parent theme (shop-inner-page.css) gives every WooCommerce notice a
   60px left padding and drops a Line Awesome glyph into it at left:25px,
   absolutely positioned. Our padding above wins the cascade on equal
   specificity because this file loads later, but the glyph is a separate
   rule that nothing here reset, so it kept its absolute position and landed
   on top of the notice text. Retire the glyph: the tinted background and the
   coloured left border already carry the state. */
.mm-pl-notices .woocommerce-message::before,
.mm-pl-notices .woocommerce-error::before,
.mm-pl-notices .woocommerce-info::before {
  content: none;
}
/* Same rule set the theme's 1px box border, which fought the left accent. */
.mm-pl-notices .woocommerce-message,
.mm-pl-notices .woocommerce-error,
.mm-pl-notices .woocommerce-info {
  border: 0;
}
.mm-pl-notices .woocommerce-message { background: rgba(59, 122, 79, 0.12); border-left: 4px solid var(--state-success, #3b7a4f); }
.mm-pl-notices .woocommerce-error   { background: rgba(184, 69, 46, 0.12); border-left: 4px solid var(--state-danger, #b8452e); }
.mm-pl-notices .woocommerce-info    { background: rgba(47, 88, 140, 0.10); border-left: 4px solid var(--accent-primary, #2f588c); }

/* ---------- Head ---------- */

.mm-pl-panel__head { margin-bottom: 16px; }

.mm-pl-panel__eyebrow {
  display: block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--t-micro, 11px);
  letter-spacing: var(--track-eyebrow, 0.28em);
  text-transform: uppercase;
  color: var(--fg3, #5b6472);
  margin-bottom: 10px;
}

.mm-pl-panel__title {
  margin: 0 0 10px;
  font-family: var(--font-display, 'Brunson', 'Anton', 'Arial Narrow', sans-serif);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: var(--w-bold, 700);
  line-height: var(--lh-heading, 1.12);
  color: var(--fg1, #1e2a3a);
}

.mm-pl-panel__lead {
  margin: 0 0 22px;
  max-width: 66ch;
  color: var(--fg2, #2b3340);
}

.mm-pl-subhead {
  margin: 26px 0 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--t-micro, 11px);
  font-weight: var(--w-semi, 600);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
  color: var(--fg3, #5b6472);
}

/* ---------- Status pill ---------- */

.mm-pl-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill, 999px);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--t-micro, 11px);
  font-weight: var(--w-semi, 600);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
}

.mm-pl-pill--wait { background: rgba(201, 146, 65, 0.16); color: #8a5a00; }
.mm-pl-pill--sent { background: rgba(201, 162, 74, 0.22); color: #6d4f10; }
.mm-pl-pill--ok   { background: rgba(59, 122, 79, 0.16); color: #0a6b3a; }
.mm-pl-pill--bad  { background: rgba(184, 69, 46, 0.14); color: #9a1c1c; }

/* ---------- Key facts ---------- */

.mm-pl-keyrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--pl-line);
  border: 1px solid var(--pl-line);
  border-radius: var(--r-2, 4px);
  overflow: hidden;
}

.mm-pl-key { background: var(--bg2, #faf6ef); padding: 16px 18px; }

.mm-pl-key__label {
  display: block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--t-micro, 11px);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
  color: var(--fg3, #5b6472);
  margin-bottom: 6px;
}

.mm-pl-key__value {
  display: block;
  font-family: var(--font-display, 'Brunson', 'Anton', sans-serif);
  font-size: 22px;
  font-weight: var(--w-bold, 700);
  color: var(--fg1, #1e2a3a);
}

.mm-pl-panel .woocommerce-Price-amount,
.mm-pl-panel .woocommerce-Price-currencySymbol { font: inherit; color: inherit; }

/* ---------- Pay button ---------- */

.mm-pl-paybtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
  padding: 16px 26px;
  background: var(--mm-deep-navy, #1e2a3a);
  color: var(--mm-warm-sand, #e7d8c4);
  border-radius: var(--r-2, 4px);
  font-family: var(--font-button, 'Akira Expanded', 'JetBrains Mono', sans-serif);
  font-size: 13px;
  font-weight: var(--w-bold, 700);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-2, 0 6px 16px -4px rgba(30, 42, 58, 0.1));
  transition: background var(--dur-fast, 120ms) var(--ease-standard, ease),
              transform var(--dur-fast, 120ms) var(--ease-standard, ease);
}

.mm-pl-paybtn:hover,
.mm-pl-paybtn:focus-visible {
  background: var(--mm-midnight-blue, #2f588c);
  color: var(--mm-warm-sand, #e7d8c4);
  transform: translateY(-1px);
}

.mm-pl-secure {
  margin: 0;
  font-size: 12px;
  color: var(--fg3, #5b6472);
  max-width: 62ch;
}

/* ---------- Items table ---------- */

.mm-pl-items {
  border: 1px solid var(--pl-line);
  border-radius: var(--r-2, 4px);
  overflow: hidden;
}

.mm-pl-items__head,
.mm-pl-items__row,
.mm-pl-items__total {
  display: grid;
  grid-template-columns: 96px 1fr 64px 130px;
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
}

.mm-pl-items__head {
  background: var(--mm-deep-navy, #1e2a3a);
  color: var(--mm-warm-sand, #e7d8c4);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
}

.mm-pl-items__row + .mm-pl-items__row,
.mm-pl-items__total { border-top: 1px solid var(--pl-line); }

.mm-pl-items__row:nth-child(even) { background: var(--bg2, #faf6ef); }

.mm-pl-items__id {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  color: var(--fg3, #5b6472);
}

.mm-pl-items__id small { display: block; font-size: 11px; }

.mm-pl-items__head > :nth-child(3),
.mm-pl-items__row > :nth-child(3) { text-align: center; }

.mm-pl-items__head > :nth-child(4),
.mm-pl-items__row > :nth-child(4) { text-align: right; white-space: nowrap; }

.mm-pl-items__total {
  grid-template-columns: 1fr auto;
  background: var(--bg3, #e7d8c4);
  font-family: var(--font-display, sans-serif);
  font-weight: var(--w-bold, 700);
  color: var(--fg1, #1e2a3a);
  font-size: 16px;
}

.mm-pl-items__total > :first-child { text-align: right; }

/* ---------- Form ---------- */

.mm-pl-form { margin-top: 8px; }

.mm-pl-form__hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--fg3, #5b6472);
}

.mm-pl-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.mm-pl-field { display: block; }

.mm-pl-field__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--t-micro, 11px);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
  color: var(--fg3, #5b6472);
}

/* The theme's global `input { padding: 0 20px }` leaks in here the same way it
   does into the Blocks checkout, so pin the geometry rather than inherit it. */
.mm-pl-panel .mm-pl-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  min-height: 46px;
  border: 1px solid var(--mm-line-strong, rgba(30, 42, 58, 0.28));
  border-radius: var(--r-2, 4px);
  background: #fff;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 15px;
  color: var(--fg1, #1e2a3a);
}

.mm-pl-panel .mm-pl-field input:focus {
  border-color: var(--mm-midnight-blue, #2f588c);
  box-shadow: 0 0 0 3px rgba(47, 88, 140, 0.18);
  outline: none;
}

.mm-pl-panel .mm-pl-btn {
  display: inline-block;
  padding: 15px 26px;
  background: var(--mm-deep-navy, #1e2a3a);
  color: var(--mm-warm-sand, #e7d8c4);
  border: 0;
  border-radius: var(--r-2, 4px);
  font-family: var(--font-button, 'Akira Expanded', 'JetBrains Mono', sans-serif);
  font-size: 13px;
  font-weight: var(--w-bold, 700);
  letter-spacing: var(--track-caps, 0.14em);
  text-transform: uppercase;
  cursor: pointer;
}

.mm-pl-panel .mm-pl-btn:hover { background: var(--mm-midnight-blue, #2f588c); }

/* ---------- The last step ----------
   The first visit is the tail of the purchase, not an errand the shopper went
   looking for, so it reads louder than the later status views: gold rule,
   bigger headline, a checkbox that must be ticked, and one obvious button. */

.mm-pl-panel--step {
  border-top-color: var(--mm-gold, #c9a24a);
  border-top-width: 4px;
}

.mm-pl-panel--step .mm-pl-panel__eyebrow { color: var(--mm-gold, #c9a24a); }

.mm-pl-panel--step .mm-pl-panel__title {
  font-size: clamp(26px, 3vw, 38px);
  max-width: 22ch;
}

.mm-pl-panel--step .mm-pl-panel__lead {
  font-size: 15px;
  max-width: 62ch;
}

/* The confirmation tick. Sized and coloured here because the theme's global
   `input { padding: 0 20px }` inflates any unstyled checkbox (same bug the
   Blocks checkout hits, see mm-woo-honduras). */
.mm-pl-confirm {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--bg2, #faf6ef);
  border: 1px solid var(--pl-line);
  border-left: 4px solid var(--mm-gold, #c9a24a);
  border-radius: var(--r-2, 4px);
  cursor: pointer;
  font-size: 14px;
  color: var(--fg1, #1e2a3a);
}

.mm-pl-panel .mm-pl-confirm input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
  min-height: 0;
  accent-color: var(--mm-deep-navy, #1e2a3a);
  cursor: pointer;
}

/* The theme paints an orange tick over checked boxes via a ::before pseudo;
   ours draws its own, so suppress it. */
.mm-pl-panel .mm-pl-confirm input[type="checkbox"]::before,
.mm-pl-panel .mm-pl-confirm input[type="checkbox"]::after {
  content: none;
  display: none;
  background: none;
}

.mm-pl-btn--finish {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 17px 32px;
  font-size: 14px;
}

.mm-pl-btn__arrow { transition: transform var(--dur-fast, 120ms) var(--ease-standard, ease); }
.mm-pl-btn--finish:hover .mm-pl-btn__arrow { transform: translateX(3px); }

/* ---------- WhatsApp ---------- */

.mm-pl-wa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--bg2, #faf6ef);
  border: 1px solid var(--pl-line);
  border-left: 4px solid #25d366;
  border-radius: var(--r-2, 4px);
}

.mm-pl-wa strong { color: var(--fg1, #1e2a3a); }
.mm-pl-wa p { margin: 4px 0 0; font-size: 13px; color: var(--fg3, #5b6472); }

.mm-pl-wa__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 12px 20px;
  background: #25d366;
  color: #fff;
  border-radius: var(--r-2, 4px);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: var(--w-semi, 600);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.mm-pl-wa__cta:hover,
.mm-pl-wa__cta:focus-visible { background: #1da851; color: #fff; }

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .mm-pl-items__head { display: none; }
  .mm-pl-items__row {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 14px;
  }
  .mm-pl-items__row > span::before {
    content: attr(data-label) ' · ';
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg4, #9aa1ab);
  }
  .mm-pl-items__row > :nth-child(2) { grid-column: 1 / -1; font-weight: 600; }
  .mm-pl-items__row > :nth-child(3),
  .mm-pl-items__row > :nth-child(4) { text-align: left; }
  .mm-pl-wa { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Admin — Links de Pago screen + order metabox
   ============================================================ */

.mm-pl-admin__sub { max-width: 74ch; color: #50575e; }
.mm-pl-admin__h2 { margin: 22px 0 10px; font-size: 15px; }

.mm-pl-admin__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-top: 8px;
}

.mm-pl-admin__main { flex: 1 1 560px; min-width: 0; }
.mm-pl-admin__side { flex: 0 1 360px; }

.mm-pl-admin__card {
  background: #fff;
  border: 1px solid #dcdcde;
  padding: 4px 16px 12px;
}

.mm-pl-admin__detail th { text-align: left; width: 170px; padding: 10px 12px; color: #555; vertical-align: top; }
.mm-pl-admin__detail td { padding: 10px 12px; }
.mm-pl-admin__detail tr + tr { border-top: 1px solid #eee; }

.mm-pl-admin__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-pl-admin__danger { color: #b32d2e; }

.mm-pl-adminpill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.mm-pl-adminpill--wait { background: #fdeecb; color: #8a5a00; }
.mm-pl-adminpill--sent { background: #f3e2b8; color: #6d4f10; }
.mm-pl-adminpill--ok   { background: #d6f0e0; color: #0a6b3a; }
.mm-pl-adminpill--bad  { background: #f6d6d6; color: #9a1c1c; }
