/*
 * Peptide Partners WordPress Continuity 0.4.1: My Account polish.
 *
 * Loads after account-0.4.0.css and refines it in place. Presentation only:
 * no form field, name, nonce, endpoint or redirect changes. Every selector
 * starts at body.ppv2-account-surface; !important is used only where the
 * Elementor Pro My Account widget or account-0.4.0.css already uses it.
 *
 * Storefront polish pass B5 (2026-11-06): T-01/T-02 mirror, F01 (WP half),
 * F15, F38, F39, F40, F41, F42. Phone navigation (F02) is in mobile-0.3.0.css.
 *
 * Roll back by removing this file's enqueue (plugin 0.4.0).
 */

body.ppv2-account-surface {
  --pp-icon-coupon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M13 5v2'/%3E%3Cpath d='M13 17v2'/%3E%3Cpath d='M13 11v2'/%3E%3C/svg%3E");
  --pp-icon-wallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/* T-01: one button system (Next Button: pill, sentence case, 14px)    */
/* ------------------------------------------------------------------ */

body.ppv2-account-surface
  .woocommerce
  :is(.button, button[type="submit"], input[type="submit"]):not(.show-password-input):not(.pp-account-button--quiet) {
  min-height: var(--pp-button-height, 44px) !important;
  font-size: var(--pp-button-font-size, 0.875rem) !important;
  font-weight: var(--pp-button-font-weight, 600) !important;
  letter-spacing: var(--pp-button-tracking, 0) !important;
  line-height: 1.2 !important;
  padding: 0 var(--pp-button-padding-inline, 1.25rem) !important;
  text-transform: none !important;
  border-color: var(--pp-button-primary-border) !important;
  background: var(--pp-button-primary-bg) !important;
  box-shadow: var(--pp-button-primary-shadow) !important;
  transition:
    transform var(--pp-motion),
    box-shadow var(--pp-motion) !important;
}

/* Form submits are the 48px "lg" size, 15px label. */
body.ppv2-account-surface
  .woocommerce
  :is(
    .woocommerce-form-login__submit,
    .woocommerce-form-register__submit,
    .woocommerce-ResetPassword .button,
    form.woocommerce-EditAccountForm button[type="submit"],
    .woocommerce-address-fields button[type="submit"],
    .pp-research-profile-form button[type="submit"]
  ) {
  min-height: var(--pp-button-height-form, 48px) !important;
  font-size: var(--pp-button-font-size-lg, 0.9375rem) !important;
  padding-inline: 1.5rem !important;
}

body.ppv2-account-surface
  .woocommerce
  :is(.button, button[type="submit"], input[type="submit"]):not(.show-password-input):not(.pp-account-button--quiet):hover {
  border-color: var(--pp-button-primary-border) !important;
  background: var(--pp-button-primary-bg-hover) !important;
  box-shadow: var(--pp-button-primary-shadow-hover) !important;
  transform: translateY(-1px);
}

body.ppv2-account-surface
  .woocommerce
  :is(.button, button[type="submit"], input[type="submit"]):not(.show-password-input):not(.pp-account-button--quiet):active {
  box-shadow: var(--pp-button-primary-shadow-pressed) !important;
  transform: translateY(0.5px);
}

@media (prefers-reduced-motion: reduce) {
  body.ppv2-account-surface .woocommerce :is(.button, button[type="submit"], input[type="submit"]):is(:hover, :active) {
    transform: none;
  }
}

/*
 * Softer palette (2026-11-06): inside the account content, the 0.4.0
 * accents (links, kickers, required marks, notices, the active menu item,
 * quick links) read --pp-color-primary. Point it at ink here; the buy-style
 * submit above keeps the purple through the button tokens.
 */
body.ppv2-account-surface .woocommerce {
  --pp-color-primary: var(--pp-color-ink-800);
  --pp-color-primary-deep: var(--pp-color-ink-900);
}

body.ppv2-account-surface .elementor-element.elementor-widget-woocommerce-my-account {
  --links-normal-color: var(--pp-color-ink-900);
  --links-hover-color: var(--pp-color-ink-600);
}

/* The show-password toggle is a secondary control, not a purple disc. */
body.ppv2-account-surface .woocommerce .password-input button.show-password-input {
  border: 1px solid var(--pp-color-border-strong) !important;
  background: var(--pp-button-secondary-bg) !important;
  color: var(--pp-color-ink-800) !important;
  box-shadow: var(--pp-button-secondary-shadow) !important;
}

/*
 * Secondary outline pills: ink on a white-to-mist gradient. The doubled
 * classes let them outrank the 0.4.0 primary pill rule.
 */
body.ppv2-account-surface.ppv2-account-surface
  .woocommerce.woocommerce
  :is(
    .woocommerce-orders-table .button,
    .woocommerce-MyAccount-downloads .button,
    .woocommerce-PaymentMethods .button,
    .order-again .button,
    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button,
    .woocommerce-Address-title .edit
  ) {
  border-color: var(--pp-color-border-strong) !important;
  background: var(--pp-button-secondary-bg) !important;
  color: var(--pp-color-foreground) !important;
  font-size: var(--pp-button-font-size, 0.875rem) !important;
  font-weight: var(--pp-button-font-weight, 600) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: var(--pp-button-secondary-shadow) !important;
}

body.ppv2-account-surface.ppv2-account-surface
  .woocommerce.woocommerce
  :is(
    .woocommerce-orders-table .button,
    .woocommerce-MyAccount-downloads .button,
    .woocommerce-PaymentMethods .button,
    .order-again .button,
    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button,
    .woocommerce-Address-title .edit
  ):hover {
  border-color: var(--pp-color-border-strong) !important;
  background: var(--pp-button-secondary-bg-hover) !important;
  color: var(--pp-color-foreground) !important;
  box-shadow: var(--pp-button-secondary-shadow-hover) !important;
}

body.ppv2-account-surface.ppv2-account-surface
  .woocommerce.woocommerce
  :is(
    .woocommerce-orders-table .button,
    .woocommerce-MyAccount-downloads .button,
    .woocommerce-PaymentMethods .button,
    .order-again .button,
    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button,
    .woocommerce-Address-title .edit
  ):active {
  box-shadow: var(--pp-button-secondary-shadow-pressed) !important;
}

/* Focus: one 2px ring with a 2px offset (Next ring-focus), no glow. */
body.ppv2-account-surface
  :is(.woocommerce, .woocommerce-MyAccount-navigation)
  :is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: var(--pp-focus-outline, 2px solid var(--pp-color-primary)) !important;
  outline-offset: var(--pp-focus-offset, 2px) !important;
  box-shadow: none !important;
}

/* Fields keep their border highlight; the ring replaces the 4px glow. */
body.ppv2-account-surface
  .woocommerce
  :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="url"], input[type="search"], select, textarea):not(.select2-search__field):focus {
  border-color: var(--pp-color-focus, #7240ab) !important;
  box-shadow: var(--pp-focus-ring, none) !important;
}

/* ------------------------------------------------------------------ */
/* F15: login and registration                                         */
/* ------------------------------------------------------------------ */

/*
 * The Elementor "existing customer" widget repeats Woo's own "Lost your
 * password?" link. Hide it; Woo's .lost_password link stays. [id] lifts
 * specificity above account.css's #existing-customer-message.pp-account-reset-note.
 */
body.ppv2-account-surface #existing-customer-message[id] {
  display: none !important;
}

/*
 * Turnstile: let the container take only the space its widget uses, so an
 * interaction-only widget leaves no blank slot. The iframe keeps its own size.
 */
body.ppv2-account-surface .woocommerce :is(.cf-turnstile, .sct-turnstile) {
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 0.5rem !important;
}

body.ppv2-account-surface .woocommerce :is(.cf-turnstile, .sct-turnstile):empty {
  margin: 0 !important;
}

/* Research fields in the sign-up card read as a section, not a card in a card. */
body.ppv2-account-surface .woocommerce form.register .pp-rp-group {
  margin: 0.25rem 0 1.1rem !important;
  border: 0 !important;
  border-top: 1px solid var(--pp-color-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 1.1rem 0 0 !important;
}

/* ------------------------------------------------------------------ */
/* Content wrapping: never split words or amounts inside tables        */
/* ------------------------------------------------------------------ */

body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content {
  overflow-wrap: break-word !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content :is(table, th, td) {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content :is(.amount, .woocommerce-Price-amount, time) {
  white-space: nowrap;
}

body.ppv2-account-surface .woocommerce :is(table.shop_table, table.woocommerce-orders-table) thead th {
  letter-spacing: var(--pp-tracking-label, 0.16em) !important;
  white-space: nowrap !important;
}

/* ------------------------------------------------------------------ */
/* F41: dashboard                                                      */
/* ------------------------------------------------------------------ */

/*
 * Woo's stock "From your account dashboard you can view..." paragraph only
 * repeats the shortcut tiles. Hide it only when the tiles are present.
 */
body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content:has(.pp-account-quick-links) > p:nth-of-type(2),
body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content-wrapper:has(.pp-account-quick-links) > p:nth-of-type(2) {
  display: none !important;
}

/* storefront.js wraps "(not Name? Log out)" so the greeting reads "Hello, Name". */
body.ppv2-account-surface .woocommerce .pp-account-greeting-aside {
  display: none !important;
}

body.ppv2-account-surface .woocommerce .pp-account-quick-links {
  margin-top: 1.5rem !important;
}

@media (min-width: 960px) {
  body.ppv2-account-surface .woocommerce .pp-account-quick-links ul {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.ppv2-account-surface .woocommerce a.pp-account-quick-link {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0.3rem;
    padding: 1.1rem 1.1rem 1.25rem !important;
  }

  body.ppv2-account-surface .woocommerce a.pp-account-quick-link .pp-account-quick-link__icon {
    grid-row: auto;
    margin-bottom: 0.5rem;
  }

  body.ppv2-account-surface .woocommerce a.pp-account-quick-link::after {
    top: 1.35rem;
    transform: none;
  }

  body.ppv2-account-surface .woocommerce a.pp-account-quick-link:hover::after {
    transform: translateX(3px);
  }
}

/* Coupons and store credit come from third-party endpoints: give them icons. */
body.ppv2-account-surface .woocommerce-MyAccount-navigation li[class*="woocommerce-MyAccount-navigation-link--"][class*="coupon"] a {
  --pp-nav-icon: var(--pp-icon-coupon) !important;
}

body.ppv2-account-surface .woocommerce-MyAccount-navigation li[class*="woocommerce-MyAccount-navigation-link--"]:is([class*="credit"], [class*="wallet"]) a {
  --pp-nav-icon: var(--pp-icon-wallet) !important;
}

/* ------------------------------------------------------------------ */
/* F39: order detail                                                   */
/* ------------------------------------------------------------------ */

/* "...and is currently Cancelled." shows the status as a chip. */
body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content mark.order-status {
  display: inline-flex !important;
  align-items: center;
  min-height: 1.5rem;
  margin-inline: 0.15rem;
  border: 1px solid var(--pp-color-border-strong) !important;
  border-radius: var(--pp-radius-pill) !important;
  background: var(--pp-color-surface-recessed, var(--pp-color-surface-muted)) !important;
  color: var(--pp-color-foreground) !important;
  font-size: var(--pp-text-meta, 0.75rem) !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  padding: 0.15rem 0.6rem !important;
  vertical-align: 0.1em;
}

body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table {
  display: table !important;
  width: 100% !important;
  overflow: visible !important;
  table-layout: auto !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table :is(th, td) {
  vertical-align: top;
}

body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table :is(td.product-total, tfoot td, thead th.product-total) {
  width: 1%;
  text-align: right !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table :is(td.product-total, thead th) {
  white-space: nowrap !important;
}

/* ------------------------------------------------------------------ */
/* F38: addresses                                                      */
/* ------------------------------------------------------------------ */

/* The edit link is positioned by Woo/Elementor rules; put it in flow. */
body.ppv2-account-surface .woocommerce .woocommerce-Address-title {
  flex-wrap: wrap !important;
  row-gap: 0.5rem !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-Address-title .edit {
  position: static !important;
  inset: auto !important;
  float: none !important;
  transform: none !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* F42: account details                                                */
/* ------------------------------------------------------------------ */

/* Sections are divided, not nested cards (T-07). */
body.ppv2-account-surface .woocommerce form.woocommerce-EditAccountForm fieldset {
  margin: 1rem 0 1.25rem !important;
  border: 0 !important;
  border-top: 1px solid var(--pp-color-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 1.25rem 0 0 !important;
}

/* storefront.js moves the existing "(leave blank to leave unchanged)" text into helper text, words unchanged. */
body.ppv2-account-surface .woocommerce .pp-account-label-hint {
  display: block;
  margin-top: 0.15rem;
  color: var(--pp-color-text-muted) !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}

/* Change-password disclosure added by storefront.js. */
body.ppv2-account-surface .woocommerce button.pp-account-disclosure {
  display: flex !important;
  width: 100% !important;
  min-height: 44px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--pp-radius-sm) !important;
  background: transparent !important;
  color: var(--pp-color-foreground) !important;
  font-family: var(--pp-font-sans) !important;
  font-size: 1.0625rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.3 !important;
  padding: 0 !important;
  text-align: left !important;
  text-transform: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

body.ppv2-account-surface .woocommerce button.pp-account-disclosure:hover {
  background: transparent !important;
  color: var(--pp-color-ink-600) !important;
}

body.ppv2-account-surface .woocommerce button.pp-account-disclosure::after {
  content: "";
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--pp-transition);
}

body.ppv2-account-surface .woocommerce button.pp-account-disclosure[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

body.ppv2-account-surface .woocommerce fieldset.pp-account-collapsible > legend {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

body.ppv2-account-surface .woocommerce fieldset.pp-account-collapsible > .pp-account-disclosure-panel {
  padding-top: 1rem;
}

body.ppv2-account-surface .woocommerce fieldset.pp-account-collapsible > .pp-account-disclosure-panel[hidden] {
  display: none !important;
}

/* Research profile on the account details form: same section treatment. */
body.ppv2-account-surface .woocommerce form.woocommerce-EditAccountForm fieldset.pp-research-profile .pp-rp-group__note {
  margin: 0 0 1rem !important;
  color: var(--pp-color-text-muted) !important;
  font-size: 0.8125rem !important;
}

/* ------------------------------------------------------------------ */
/* F01 (WordPress half): support chat stays off form pages              */
/* ------------------------------------------------------------------ */

/*
 * On sign-in, sign-up, lost-password, address and account-detail forms the
 * Re:amaze launcher and greeting cover fields and the submit button. Support
 * stays one tap away in the header, footer and Contact page.
 */
body.ppv2-account-surface:is(
    :not(.logged-in),
    .woocommerce-edit-address,
    .woocommerce-edit-account,
    .woocommerce-lost-password,
    .woocommerce-research-profile
  )
  :is(
    #reamaze-widget,
    #reamaze-container,
    #reamaze-iframe,
    [id^="reamaze-widget"],
    iframe[src*="reamaze"]
  ) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Elsewhere on phones, leave room to scroll the last row clear of the launcher. */
@media (max-width: 767px) {
  body.ppv2-account-surface.logged-in .woocommerce .woocommerce-MyAccount-content {
    margin-bottom: 4.5rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ppv2-account-surface .woocommerce button.pp-account-disclosure::after {
    transition: none;
  }
}

/* Research profile prompt and endpoint (pp-research-profile): same button spec. */
body.ppv2-account-surface :is(.pp-rp-gate button.pp-rp-submit, .pp-research-profile-form button.pp-rp-submit, a.pp-rp-link-button) {
  min-height: var(--pp-button-height-form, 48px) !important;
  font-size: var(--pp-button-font-size-lg, 0.9375rem) !important;
  font-weight: var(--pp-button-font-weight, 600) !important;
  letter-spacing: var(--pp-button-tracking, 0) !important;
  text-transform: none !important;
  box-shadow: none !important;
}

body.ppv2-account-surface a.pp-rp-link-button {
  min-height: var(--pp-button-height, 44px) !important;
  font-size: var(--pp-button-font-size, 0.875rem) !important;
}

/*
 * F38: the address edit link is an outline button. Outranks the 0.4.0
 * content-link rule (.woocommerce-MyAccount-content a:not(.button)...).
 */
body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content .woocommerce-Addresses .woocommerce-Address-title a.edit:not(.button) {
  display: inline-flex !important;
  min-height: var(--pp-button-height, 44px) !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--pp-color-border-strong) !important;
  border-radius: var(--pp-radius-pill) !important;
  background: var(--pp-button-secondary-bg) !important;
  color: var(--pp-color-foreground) !important;
  font-size: var(--pp-button-font-size, 0.875rem) !important;
  font-weight: var(--pp-button-font-weight, 600) !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  padding: 0 1.1rem !important;
  box-shadow: var(--pp-button-secondary-shadow) !important;
  text-decoration: none !important;
  text-transform: none !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-MyAccount-content .woocommerce-Addresses .woocommerce-Address-title a.edit:not(.button):hover {
  border-color: var(--pp-color-border-strong) !important;
  background: var(--pp-button-secondary-bg-hover) !important;
  color: var(--pp-color-foreground) !important;
  box-shadow: var(--pp-button-secondary-shadow-hover) !important;
}

/* F39: order totals read as quiet row labels, not shouted headers. */
body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table tfoot th {
  color: var(--pp-color-text-soft) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table tfoot tr:last-child :is(th, td) {
  color: var(--pp-color-foreground) !important;
  font-weight: 650 !important;
}

body.ppv2-account-surface .woocommerce .pp-account-label-hint::first-letter {
  text-transform: uppercase;
}

@media (min-width: 601px) {
  body.ppv2-account-surface .woocommerce .woocommerce-order-details table.shop_table tfoot td {
    white-space: nowrap !important;
  }
}
