/**
 * v3-nmfc.css
 * ─────────────────────────────────────────────────────────────────────────────
 * Styles for the NMFC (New Mobile Fast Checkout) single-step mobile flow.
 * Only applies to pages with body.variation-v3-2yr-nmfc.
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Hide NMFC mobile flow on desktop ────────────────────────────────────── */
.nmfc-mobile-flow {
  display: none;
}

/* ── Mobile-only: show NMFC flow ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .variation-v3-2yr-nmfc .nmfc-mobile-flow {
    display: block;
    padding: 0 16px 20px;
  }

  /* Hide old mobile step 1 and bottom bar on NMFC */
  .variation-v3-2yr-nmfc .v3-mobile-step--1,
  .variation-v3-2yr-nmfc .v3-mobile-bottom-bar {
    display: none !important;
  }
}

/* ── Section spacing ─────────────────────────────────────────────────────────── */
.nmfc-section {
  margin-bottom: 16px;
}

.nmfc-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #302B2B;
  margin: 0 0 8px 0;
}

/* ── Order Summary Card (reuses DTC compact card styles) ─────────────────── */
/* The .dtc-mobile-summary__card styles are already in main.css */

/* ── NMFC Card (CP-style white surface) ─────────────────────────────────── */
.nmfc-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
}

.nmfc-card--express {
  padding: 16px 20px;
}

.nmfc-card--payment {
  padding: 20px;
}

/* ── Section Dividers (between cards, on background) ─────────────────────── */
.nmfc-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 0 8px;
}

.nmfc-section-divider::before,
.nmfc-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #cbd5e1;
}

.nmfc-section-divider__text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
}

/* ── Express Checkout Section ────────────────────────────────────────────── */
.nmfc-express {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

/* Hide the actual ECE element while skeleton is showing to prevent double height */
.nmfc-express #stripe-express-checkout-element {
  display: none;
}
.nmfc-express.ece-ready #stripe-express-checkout-element {
  display: block;
}

/* ── Wallet Email Note (inside express card) ─────────────────────────────────────────── */
.nmfc-wallet-email-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  margin: 10px 0 0;
  padding: 0 2px;
  line-height: 1.4;
}

.nmfc-wallet-email-note svg {
  flex-shrink: 0;
}

/* ── Wallet Email Badge (in email section) ─────────────────────────────────────── */
.nmfc-email-wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.nmfc-email-wallet-badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #dcfce7;
  border-radius: 50%;
  flex-shrink: 0;
}

.nmfc-email-wallet-badge__text {
  font-size: 0.82rem;
  font-weight: 500;
  color: #15803d;
  flex: 1;
}

.nmfc-email-wallet-badge__edit {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.nmfc-email-wallet-badge__edit:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Wallet-provided email input state */
.nmfc-email-section .form-input.nmfc-email-wallet-filled {
  background: #f8fafc;
  color: #334155;
  border-color: #bbf7d0;
}

.nmfc-email-section .form-input.nmfc-email-wallet-filled:focus {
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Hide My Email note */
.nmfc-email-hide-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
}

.nmfc-email-hide-note svg {
  flex-shrink: 0;
}

/* ── Email Section ───────────────────────────────────────────────────────────── */
/* .nmfc-email-card styling now comes from .nmfc-card base class */
.nmfc-email-card {
  /* inherits from .nmfc-card */
}
.nmfc-email-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 8px;
}

.nmfc-email-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.4;
}

.nmfc-email-section .v3-email-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #ef4444;
}
/* ── Payment Methods Section ─────────────────────────────────────────────── */
.nmfc-payment-options {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.nmfc-payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.nmfc-payment-option:hover {
  background: #f8fafc;
}

.nmfc-payment-option.is-selected {
  background: #f0f9ff;
}

/* Radio circle */
.nmfc-payment-option__radio {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  position: relative;
  transition: border-color 0.15s;
}

.nmfc-payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.nmfc-payment-option input[type="radio"]:checked ~ .nmfc-payment-option__radio {
  border-color: #2563eb;
}

.nmfc-payment-option input[type="radio"]:checked ~ .nmfc-payment-option__radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
}

/* Icon */
.nmfc-payment-option__icon {
  display: flex;
  align-items: center;
  color: #475569;
}

.nmfc-payment-option__icon img {
  height: 20px;
  width: auto;
}

/* Label */
.nmfc-payment-option__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

/* Brand logos */
.nmfc-payment-option__brands {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nmfc-payment-option__brands img {
  height: 24px;
  width: auto;
  border-radius: 3px;
}

/* Divider between options */
.nmfc-payment-option__divider {
  margin: 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

/* ── Card Form (inside payment options) ──────────────────────────────────── */
.nmfc-card-form {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.nmfc-card-form .v3-card-input-row {
  margin-bottom: 12px;
}

.nmfc-card-form .form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.nmfc-card-form .form-group {
  flex: 1;
  min-width: 0;
}

.nmfc-card-form .form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s;
}

.nmfc-card-form .form-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* ── Buy Now Button ──────────────────────────────────────────────────────────── */
.nmfc-buy-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
}

/* Override v3.css mobile rule that hides .v3-btn-buy off-screen */
@media (max-width: 900px) {
  .variation-v3-2yr-nmfc .nmfc-checkout-details #nmfc-buy-btn {
    position: static !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* ── CTA Wrapper (Buy Now + Express Overlay) ────────────────────────────────── */
#nmfc-buy-wrapper {
  position: relative;
  min-height: 48px;
}

/* Express overlay: block-level when visible so it sizes to its content */
#nmfc-express-overlay {
  min-height: 56px;
}

/* ── Terms text ─────────────────────────────────────────────────────────────── */
.nmfc-terms {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 12px;
  line-height: 1.5;
}

.nmfc-terms a {
  color: #2563eb;
  text-decoration: underline;
}

/* ── Desktop-only helper ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nmfc-desktop-only { display: none !important; }
}

/* ── Inline Checkout Details (mobile only, inside payment card) ───────── */
.nmfc-checkout-details {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.nmfc-checkout-details__terms {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.nmfc-checkout-details__terms a {
  color: #2563eb;
  text-decoration: underline;
}

.nmfc-checkout-details__pricing {
  margin-bottom: 14px;
}

.nmfc-checkout-details__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9rem;
  color: #475569;
}

.nmfc-checkout-details__row--total {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}

.nmfc-checkout-details__guarantee {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: #475569;
}

/* Hide inline checkout details on desktop (desktop uses separate elements below the card) */
@media (min-width: 901px) {
  .nmfc-checkout-details { display: none !important; }
}

/* ── Stripe Card Error ───────────────────────────────────────────────────── */
.nmfc-card-form .stripe-card-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

/* ── DTC Mobile Summary Card styles for NMFC (900px breakpoint) ─────────── */
/* These are needed because the main.css version is scoped to 767px */
@media (max-width: 900px) {
  .variation-v3-2yr-nmfc .dtc-mobile-summary__card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__product-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__product-name {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__original-price {
    font-size: 16px;
    color: #64748b;
    text-decoration: line-through;
    flex-shrink: 0;
    font-weight: 500;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__savings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__savings-label {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__savings-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__savings-badge {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    line-height: 1.4;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__savings-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
  }

  .variation-v3-2yr-nmfc .dtc-mobile-summary__features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
  }

  /* ── V3 Input with Icon (email tooltip) ─── */
  .nmfc-email-section .v3-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
  }

  .nmfc-email-section .v3-input-with-icon .form-input {
    padding-right: 44px;
    width: 100%;
    padding: 14px 44px 14px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.15s;
  }

  .nmfc-email-section .v3-input-with-icon .form-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }

  .nmfc-email-section .v3-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .nmfc-email-section .v3-input-icon:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  /* ── Card option: wrap to column on mobile so brands go below label ─── */
  #nmfc-opt-card.nmfc-payment-option {
    flex-wrap: wrap;
  }
  #nmfc-opt-card .nmfc-payment-option__brands {
    margin-left: 32px; /* align with label (radio 20px + gap 12px) */
    margin-top: 4px;
    width: 100%;
  }

  /* ── Stripe Element Mount Containers ─── */
  /* Border comes from the parent __number/__expiry/__cvv wrapper (v3.css mobile).
     Only provide padding and background here to avoid double outline. */
  .nmfc-card-form .stripe-element-mount {
    padding: 12px 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    min-height: 20px;
  }

  .nmfc-card-form .stripe-element-mount.StripeElement--focus {
    border: none;
    box-shadow: none;
  }

  .nmfc-card-form .stripe-element-mount.StripeElement--invalid {
    border: none;
  }

  /* Apply focus/invalid styling to the parent wrapper instead */
  .nmfc-card-form .v3-card-input-row__number:focus-within,
  .nmfc-card-form .v3-card-input-row__expiry:focus-within,
  .nmfc-card-form .v3-card-input-row__cvv:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }

  .nmfc-card-form .v3-card-input-row__number:has(.StripeElement--invalid),
  .nmfc-card-form .v3-card-input-row__expiry:has(.StripeElement--invalid),
  .nmfc-card-form .v3-card-input-row__cvv:has(.StripeElement--invalid) {
    border-color: #ef4444;
  }

  .nmfc-card-form .v3-card-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border: none;
  }

  .nmfc-card-form .v3-card-input-row__number,
  .nmfc-card-form .v3-card-input-row__expiry,
  .nmfc-card-form .v3-card-input-row__cvv {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .nmfc-card-form .v3-card-input-row__number {
    grid-column: 1 / -1;
  }

  /* V3 Select wrapper for country */
  .nmfc-card-form .v3-select-wrapper {
    position: relative;
  }

  .nmfc-card-form .v3-select {
    appearance: none;
    padding-right: 32px;
  }

  .nmfc-card-form .v3-select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
  }
}
