/* Live Pageviral - built-in checkout page */

html, body.lpv-checkout-body {
  margin: 0; padding: 0; background: #f4f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.lpv-checkout-wrap {
  --accent: #ff3b5c;
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: #f4f4f6; color: #16171b; padding-bottom: 100px; box-sizing: border-box;
}

.lpv-checkout-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 14px; text-align: center; padding: 24px;
}
.lpv-checkout-back-link { color: var(--accent); font-weight: 700; text-decoration: none; }

.lpv-checkout-topbar {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: #fff; border-bottom: 1px solid #eee; font-weight: 700; font-size: 15px;
  position: sticky; top: 0; z-index: 5;
}
.lpv-checkout-back {
  background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 8px 4px 0; color: #16171b;
}

.lpv-checkout-product-card {
  display: flex; align-items: center; gap: 12px; background: #fff; margin: 12px 14px;
  padding: 12px; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.lpv-checkout-product-card img {
  width: 60px; height: 60px; border-radius: 10px; object-fit: contain; background: #f7f7f8;
  border: 1px solid #eee; padding: 4px; box-sizing: border-box; flex-shrink: 0;
}
.lpv-checkout-product-info { flex: 1; min-width: 0; }
.lpv-checkout-product-name { font-weight: 700; font-size: 14px; }
.lpv-checkout-product-qty { color: #888; font-size: 12.5px; margin-top: 2px; }
.lpv-checkout-product-price { color: var(--accent); font-weight: 800; font-size: 14px; white-space: nowrap; }

#lpv-checkout-form {
  background: #fff; margin: 0 14px; border-radius: 14px; padding: 4px 16px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.lpv-checkout-section { margin-top: 16px; }
.lpv-checkout-section label {
  display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px;
}
.lpv-req { color: var(--accent); }
.lpv-optional { color: #999; font-weight: 400; }

.lpv-checkout-section input[type="text"],
.lpv-checkout-section input[type="email"],
.lpv-checkout-section input[type="tel"],
.lpv-checkout-section select {
  width: 100%; padding: 11px 13px; border: 1px solid #e2e2e6; border-radius: 10px;
  font-size: 14px; box-sizing: border-box; background: #fff; color: #16171b;
}
.lpv-checkout-section input:focus, .lpv-checkout-section select:focus {
  outline: none; border-color: var(--accent);
}

.lpv-phone-row { display: flex; gap: 8px; align-items: center; }
.lpv-phone-prefix {
  flex-shrink: 0; padding: 11px 12px; border: 1px solid #e2e2e6; border-radius: 10px;
  background: #f7f7f8; font-size: 14px; font-weight: 600;
}
/* Scoped as ".lpv-phone-row .lpv-phone-cc" (not just ".lpv-phone-cc") so
   this beats the general ".lpv-checkout-section select { width: 100% }"
   rule above on specificity - without that, the country-code <select>
   stretched to the row's full width same as every other select on the
   form, squeezing the phone number input next to it down to almost
   nothing ("ralat ruang" - the spacing bug reported against this field). */
.lpv-phone-row .lpv-phone-cc {
  flex: 0 0 auto; width: auto; max-width: 92px; padding: 11px 6px; font-weight: 600;
}
.lpv-phone-row input { flex: 1; min-width: 0; }

.lpv-field-hint { font-size: 11.5px; color: #ff8a3d; margin: 6px 0 0; line-height: 1.4; }

/* Subtotal / shipping summary lines (populated live as the customer picks
   a state - see LPV_Checkout::ajax_checkout_pricing() + checkout.js) */
.lpv-checkout-summary-lines { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #eee; }
.lpv-checkout-line {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #555; padding: 3px 0;
}
.lpv-checkout-line span:last-child { font-weight: 700; color: #16171b; }

.lpv-payment-label { margin-bottom: 10px; }
.lpv-payment-method { margin-bottom: 8px; }
/* Two stacked rows: the "head" (radio + title + icon, all vertically
   centered on ONE line) and, below it, the subtitle/description - NOT one
   flex row with the radio cross-aligned to a taller multi-line block
   (the old layout), which could leave the radio looking like it sat above
   the title instead of level with it. */
.lpv-payment-option {
  display: flex; flex-direction: column; gap: 4px; border: 1px solid #e2e2e6;
  border-radius: 10px; padding: 12px; cursor: pointer;
}
.lpv-payment-option:has(input:checked) { border-color: var(--accent); background: #fff7f8; }
.lpv-payment-option-head {
  display: flex; align-items: center; gap: 10px;
}
.lpv-payment-option-head input {
  margin: 0; flex-shrink: 0; accent-color: var(--accent);
}
.lpv-payment-option-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex: 1; min-width: 0;
}
.lpv-payment-option-title { font-weight: 700; font-size: 13.5px; }
/* Indented to line up under the title (radio width + head's gap), not the
   raw left edge of the card - keeps subtitle/description text visually
   "inside" the row it belongs to rather than flush with the radio. */
.lpv-payment-option-desc { font-size: 11.5px; color: #888; padding-left: 26px; }
/* Gateway-supplied thumbnail(s)/logo(s) (bank logo, card-brand icons, etc.)
   - get_icon() can return more than one <img> concatenated (e.g. several
   card brands at once), so this wraps them in a small flex row rather than
   assuming exactly one image. */
.lpv-payment-option-icon {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.lpv-payment-option-icon img {
  max-height: 22px; width: auto; display: block; object-fit: contain;
}

/* A gateway's own extra fields (see builtin-checkout-render.php /
   $gateway->payment_fields()) - hidden unless its radio is the one
   currently selected, toggled in checkout.js (kept in JS rather than a
   pure CSS :has() sibling rule since payment_fields() markup varies too
   much per-gateway to rely on a fixed structural relationship). */
.payment_box {
  display: none;
  border: 1px solid #e2e2e6; border-top: none; border-radius: 0 0 10px 10px;
  margin-top: -8px; padding: 12px; font-size: 12.5px; color: #555;
  background: #fafafa;
}
.payment_box.lpv-payment-box-open { display: block; }

.lpv-checkout-errors {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff0f1;
  color: #c0263a; font-size: 12.5px; line-height: 1.5;
}
.lpv-checkout-errors ul { margin: 0; padding-left: 18px; }
/* response.messages is raw HTML straight from WooCommerce core (and, for
   payment-specific errors, sometimes from the gateway plugin itself) - its
   exact markup varies (a plain <ul><li>, or a notice with its own leading
   icon element). Force every direct row onto one flex line so an icon
   never ends up stacked awkwardly above/beside its own text regardless of
   the exact markup that comes back. */
.lpv-checkout-errors > *,
.lpv-checkout-errors li {
  display: flex; align-items: center; gap: 8px;
}
.lpv-checkout-errors svg,
.lpv-checkout-errors img {
  flex-shrink: 0; width: 18px; height: 18px;
}

.lpv-checkout-sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-width: 480px; margin: 0 auto; background: #fff; border-top: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.lpv-checkout-total { display: flex; flex-direction: column; }
.lpv-checkout-total-label { font-size: 11px; color: #888; }
.lpv-checkout-total-amount { font-size: 17px; font-weight: 800; }
.lpv-checkout-submit-btn {
  background: var(--accent); color: #fff; border: none; padding: 13px 26px;
  border-radius: 999px; font-size: 14.5px; font-weight: 800; cursor: pointer; flex-shrink: 0;
}
.lpv-checkout-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lpv-checkout-submit-btn.lpv-loading { opacity: 0.7; }
