/*
 * The account pages (inc/account.php): sign in and register, lost password,
 * and My account's menu beside whatever it opens. WooCommerce styles this
 * markup with selectors up to (0,3,2), so every rule here starts at
 * `.woocommerce-account .woocommerce` (on the body and on the shortcode's
 * wrapper) to sit above them. Colours, fonts and buttons come from the
 * theme's presets, so a brand restyles these pages through its tokens.
 * The page sits on the site's frame (main's gutter), like the bar and the
 * head band above it.
 */

/* The page is plain white under its head band, as the catalogue and product pages are; the cards keep their line to stand out. */
body.woocommerce-account {
  background: var(--wp--preset--color--surface);
}

/* WooCommerce's block-theme sheet caps the title and the page at 1000px (`.woocommerce-account main .woocommerce`, (0,2,1)); here they run the frame's width. */
.woocommerce-account main .os-account .woocommerce {
  max-width: none;
}

.woocommerce-account main .is-style-os-hero .wp-block-post-title {
  max-width: none;
}

/* Signed in: the menu on the left, what it opens on the right. */
.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  gap: 2.5rem;
}

.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::before,
.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::after {
  content: none;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation {
  float: none;
  width: auto;
  position: sticky;
  top: calc(var(--wp--custom--bar-space) + 1rem);
  padding: 0.5rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 16px;
  background: var(--wp--preset--color--surface);
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation ul {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation li {
  margin: 0;
  padding: 0;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: var(--wp--preset--color--primary);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation li a:hover {
  background: var(--wp--preset--color--tint);
  text-decoration: none;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation li.is-active a {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  text-decoration: none;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation-link--customer-logout {
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--wp--preset--color--line);
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-navigation-link--customer-logout a {
  color: var(--wp--preset--color--secondary);
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-content {
  float: none;
  width: auto;
  padding: 2rem 2.25rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 16px;
  background: var(--wp--preset--color--surface);
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-content > :first-child {
  margin-top: 0;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-content > :last-child {
  margin-bottom: 0;
}

.woocommerce-account .woocommerce .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce .woocommerce-MyAccount-content h3 {
  margin: 0 0 1rem;
  font-size: var(--wp--preset--font-size--large);
}

/* Signed out: sign in and register side by side, each a card under its heading. */
.woocommerce-account .woocommerce .col2-set {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.woocommerce-account .woocommerce .col2-set::before,
.woocommerce-account .woocommerce .col2-set::after {
  content: none;
}

.woocommerce-account .woocommerce .col2-set .col-1,
.woocommerce-account .woocommerce .col2-set .col-2 {
  float: none;
  width: auto;
}

.woocommerce-account .woocommerce #customer_login h2 {
  margin: 0 0 1rem;
  font-size: var(--wp--preset--font-size--x-large);
}

.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register,
.woocommerce-account .woocommerce form.lost_reset_password {
  margin: 0;
  padding: 2rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 16px;
  background: var(--wp--preset--color--surface);
}

/* With registration off, or resetting a password, the one form sits alone at a readable width, on the frame's left edge. */
.woocommerce-account .woocommerce > form.login,
.woocommerce-account .woocommerce > form.lost_reset_password {
  max-width: 30rem;
}

.woocommerce-account .woocommerce form.lost_reset_password > p:first-child {
  margin-top: 0;
}

/* Fields: a label over a full-width input, the theme's line colour, the primary colour when focused. */
.woocommerce-account .woocommerce form .form-row {
  margin: 0 0 1.25rem;
  padding: 0;
}

.woocommerce-account .woocommerce form .form-row label {
  margin: 0 0 0.4rem;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  line-height: 1.4;
}

.woocommerce-account .woocommerce form .form-row .required {
  visibility: visible;
  color: var(--wp--preset--color--sale);
  text-decoration: none;
}

.woocommerce-account .woocommerce form .form-row .input-text,
.woocommerce-account .woocommerce form .form-row select {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 10px;
  background-color: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-account .woocommerce form .form-row .input-text:focus,
.woocommerce-account .woocommerce form .form-row select:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent);
}

.woocommerce-account .woocommerce form .form-row.woocommerce-invalid .input-text {
  border-color: var(--wp--preset--color--sale);
}

.woocommerce-account .woocommerce form .form-row-first,
.woocommerce-account .woocommerce form .form-row-last {
  width: calc(50% - 0.625rem);
}

.woocommerce-account .woocommerce form .password-input {
  position: relative;
  display: block;
}

.woocommerce-account .woocommerce form .show-password-input {
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
}

/* A field's note: plain and quiet, not WooCommerce's italic. */
.woocommerce-account .woocommerce form #account_display_name_description em {
  display: block;
  margin-top: 0.4rem;
  color: var(--wp--preset--color--secondary);
  font-size: var(--wp--preset--font-size--small);
  font-style: normal;
}

.woocommerce-account .woocommerce form fieldset {
  clear: both;
  margin: 1.75rem 0 1.5rem;
  padding: 1.25rem 1.5rem 0.25rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 14px;
}

.woocommerce-account .woocommerce form legend {
  padding: 0 0.5rem;
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Log in, then Remember me beside it; WooCommerce prints them the other way round. */
.woocommerce-account .woocommerce form.login .form-row:has(.woocommerce-form-login__submit) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.woocommerce-account .woocommerce form.login .form-row:has(.woocommerce-form-login__submit)::before,
.woocommerce-account .woocommerce form.login .form-row:has(.woocommerce-form-login__submit)::after {
  content: none;
}

.woocommerce-account .woocommerce form .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 400;
}

.woocommerce-account .woocommerce form .woocommerce-form-login__rememberme input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--wp--preset--color--primary);
}

.woocommerce-account .woocommerce form .woocommerce-form-login__submit {
  order: -1;
  float: none;
  margin: 0;
}

.woocommerce-account .woocommerce form .lost_password {
  margin: 0;
  font-size: var(--wp--preset--font-size--small);
}

.woocommerce-account .woocommerce .woocommerce-privacy-policy-text p {
  margin: 0 0 1.25rem;
  color: var(--wp--preset--color--secondary);
  font-size: var(--wp--preset--font-size--small);
}

/* Orders and downloads: a bordered table with a tinted head row. */
.woocommerce-account .woocommerce table.shop_table {
  width: 100%;
  margin: 0;
  border: 1px solid var(--wp--preset--color--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  font-size: var(--wp--preset--font-size--small);
}

.woocommerce-account .woocommerce table.shop_table th {
  padding: 0.85rem 1rem;
  background: var(--wp--preset--color--tint);
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.woocommerce-account .woocommerce table.shop_table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--wp--preset--color--line);
}

.woocommerce-account .woocommerce table.shop_table tbody th {
  background: transparent;
  border-top: 1px solid var(--wp--preset--color--line);
}

.woocommerce-account .woocommerce table.shop_table .button {
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.5rem 0.9rem;
  font-size: var(--wp--preset--font-size--eyebrow);
}

/* Addresses: one tinted card each, the heading and its Edit link on one line. */
.woocommerce-account .woocommerce .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.woocommerce-account .woocommerce .woocommerce-Address {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: var(--wp--preset--color--tint);
}

.woocommerce-account .woocommerce .woocommerce-Address-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.woocommerce-account .woocommerce .woocommerce-Address-title::before,
.woocommerce-account .woocommerce .woocommerce-Address-title::after {
  content: none;
}

.woocommerce-account .woocommerce .woocommerce-Address-title h2,
.woocommerce-account .woocommerce .woocommerce-Address-title h3 {
  margin: 0;
  font-size: var(--wp--preset--font-size--large);
}

.woocommerce-account .woocommerce .woocommerce-Address-title .edit {
  float: none;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
}

.woocommerce-account .woocommerce address {
  font-style: normal;
  line-height: 1.6;
}

/* WooCommerce's classic notices, where a block theme still prints them. */
.woocommerce-account .woocommerce .woocommerce-message,
.woocommerce-account .woocommerce .woocommerce-info,
.woocommerce-account .woocommerce .woocommerce-error {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem 1rem 3rem;
  border: 0;
  border-left: 4px solid var(--wp--preset--color--primary);
  border-radius: 10px;
  background: var(--wp--preset--color--tint);
  color: var(--wp--preset--color--primary);
}

.woocommerce-account .woocommerce .woocommerce-error {
  border-left-color: var(--wp--preset--color--sale);
}

.woocommerce-account .woocommerce .woocommerce-message::before,
.woocommerce-account .woocommerce .woocommerce-info::before,
.woocommerce-account .woocommerce .woocommerce-error::before {
  top: 1rem;
  left: 1.1rem;
  color: inherit;
}

/* Phones and small tablets: one column, the menu as a row of chips above the page it opens. */
@media (max-width: 781px) {
  .woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .woocommerce-account .woocommerce .woocommerce-MyAccount-navigation {
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .woocommerce-account .woocommerce .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .woocommerce-account .woocommerce .woocommerce-MyAccount-navigation li a {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--wp--preset--color--line);
    border-radius: 999px;
    background: var(--wp--preset--color--surface);
  }

  .woocommerce-account .woocommerce .woocommerce-MyAccount-navigation-link--customer-logout {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .woocommerce-account .woocommerce .woocommerce-MyAccount-content {
    padding: 1.5rem 1.25rem;
  }

  .woocommerce-account .woocommerce .col2-set {
    grid-template-columns: minmax(0, 1fr);
  }

  .woocommerce-account .woocommerce form.login,
  .woocommerce-account .woocommerce form.register,
  .woocommerce-account .woocommerce form.lost_reset_password {
    padding: 1.5rem 1.25rem;
  }

  .woocommerce-account .woocommerce form .form-row-first,
  .woocommerce-account .woocommerce form .form-row-last {
    float: none;
    width: 100%;
  }
}
