/* Veyra — mini-cart Apple Pay express button styles.
 *
 * F-WC-MINICART-APPLEPAY (2026-07-24).
 *
 * Renders inside the FunnelKit slide-out cart footer (.fkcart-footer). Reuses
 * the same genuine, Apple-drawn black button treatment as the checkout wallet
 * button in classic.css so the two surfaces feel identical.
 *
 * Brand-clean: no "Veyra" / "Stripe" strings. SAQ-A: every selector targets
 * host-side elements only; no card data is ever near this CSS.
 */

.veyra-mce {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 10px;
}

/* F-WC-MINICART-SPAN (2026-08-04) — claim a full-width row in ANY footer.
 *
 * The express button is injected as a child of the cart's own footer, and that
 * footer is not always a plain block. Elementor's Menu Cart renders
 * `.elementor-menu-cart__footer-buttons` as `display:grid` with
 * `grid-template-columns:140px 140px`, so a plain child becomes a single 140px
 * CELL — the Apple Pay button ended up sitting beside "VIEW CART" with
 * "CHECKOUT" pushed to a second row, and `width:100%` only filled that 140px
 * cell. FunnelKit's footer is flex, others are block.
 *
 * Each declaration below is inert in the layout modes it does not apply to
 * (`grid-column` is ignored outside grid, `flex` outside flex), so one rule
 * covers all three without sniffing the host. Found on a FunnelKit store.
 */
.veyra-mce {
  grid-column: 1 / -1;
  grid-row: auto;
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
  align-self: stretch;
}

/* Genuine Apple Pay button via the native `-apple-pay-button` appearance —
 * Safari/WebKit draws the official black button + Apple Pay mark, so no brand
 * SVG and no extra CSP origin are needed. `!important` overrides FunnelKit /
 * theme button resets (many ship `button { -webkit-appearance: none }`). */
.veyra-mce button.veyra-mce-btn {
  -webkit-appearance: -apple-pay-button !important;
  appearance: -apple-pay-button !important;
  -apple-pay-button-type: buy;
  -apple-pay-button-style: black;
  display: block;
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 !important;
  border: none !important;
  border-radius: 10px;
  background: #000 !important;
  box-shadow: none;
  cursor: pointer;
  box-sizing: border-box;
}

/* Keep Apple's button pristine (HIG) — no theme hover tint / lift. */
.veyra-mce button.veyra-mce-btn:hover,
.veyra-mce button.veyra-mce-btn:active {
  filter: none;
  transform: none;
  box-shadow: none;
}

.veyra-mce .veyra-mce-btn:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.55);
  outline-offset: 2px;
}

/* Defensive fallback: a browser that exposes ApplePaySession but not the
 * native button appearance still shows a black branded button (never an empty
 * box). Should effectively never trigger. */
@supports not ((-webkit-appearance: -apple-pay-button) or (appearance: -apple-pay-button)) {
  .veyra-mce button.veyra-mce-btn {
    background: #000 !important;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
  }
  .veyra-mce button.veyra-mce-btn::after {
    content: "Buy with Apple Pay";
  }
}

/* F-WC-AP-ALLBROWSERS (2026-09-14) — Apple's own <apple-pay-button> element,
 * used in Chrome / Edge / Firefox on a computer, where the
 * `-apple-pay-button` appearance does not exist. Apple draws it in a shadow
 * root, so it is sized through Apple's documented custom properties; the rules
 * above are scoped to `button.` so none of them reach it. Same 48px / 10px as
 * the Safari button. */
.veyra-mce apple-pay-button.veyra-mce-btn {
  --apple-pay-button-width: 100%;
  --apple-pay-button-height: 48px;
  --apple-pay-button-border-radius: 10px;
  --apple-pay-button-padding: 0;
  --apple-pay-button-box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  cursor: pointer;
}

.veyra-mce .veyra-mce-error {
  color: #a4291f;
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 6px;
  min-height: 0;
  text-align: center;
}

.veyra-mce .veyra-mce-error:empty {
  display: none;
}

/* F-WC-EXPRESS-CHECKOUT (0.10.2) — the optional block at the top of the
 * classic checkout form (Apple Pay Express plugin only). A single block row
 * in its column: full column width on a phone, and never wider than the
 * column that holds the checkout fields on a computer (the script caps
 * max-width when the host container is wider than that column). The drawer
 * rules above that span grid / flex rows are reset so the block cannot claim
 * a row across both checkout columns. */
.veyra-mce.veyra-mce--checkout {
  grid-column: auto;
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 20px;
  clear: both;
}

.veyra-mce--checkout .veyra-mce-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 0;
  margin-top: 14px;
}

.veyra-mce--checkout .veyra-mce-divider__line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Same treatment as the card checkout's wallet divider (classic.css):
 * sentence case, slate-500 for AA contrast on a light checkout. */
.veyra-mce--checkout .veyra-mce-divider__label {
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}
