/**
 * FYOOL My Account page — classic shortcode layout + content
 */

/* Page header (breadcrumb + title) — match the inner container padding */
.fy-woo-page--account .fy-woo-page-header {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 40px 40px 0;
}

.fy-woo-page--account .fy-woocommerce-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

/* Target inner WC wrapper (not the outer .fy-woocommerce-wrap shell).
   Explicit grid-column assignments override any WC plugin width/float that
   could confuse the auto-placement algorithm. */
.fy-woo-page--account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation {
  float: none !important;
  width: 100% !important;
  grid-column: 1;
  grid-row: 1;
}

/* Force content to the right column — prevents WC plugin width:68% causing
   grid auto-placement to swap the columns. */
.fy-woo-page--account .woocommerce-MyAccount-content {
  grid-column: 2;
  grid-row: 1;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.fy-woo-page--account .woocommerce-MyAccount-navigation li:last-child {
  border-bottom: none;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation a {
  display: block;
  padding: 14px 18px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation li.is-active a,
.fy-woo-page--account .woocommerce-MyAccount-navigation a:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.fy-woo-page--account .woocommerce-MyAccount-content {
  float: none;
  width: 100%;
  min-width: 0;
}

.fy-woo-page--account:not(.fy-account-guest) .woocommerce-MyAccount-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

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

.fy-woo-page--account .woocommerce-MyAccount-content h2,
.fy-woo-page--account .woocommerce-MyAccount-content h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 16px;
}

.fy-woo-page--account .woocommerce-MyAccount-content h2 {
  font-size: 24px;
}

.fy-woo-page--account .woocommerce-MyAccount-content h3 {
  font-size: 20px;
}

/* ─── Logged-in dashboard: navigation & content defaults ─── */
.fy-woo-page--account:not(.fy-account-guest) .woocommerce-MyAccount-navigation {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  z-index: 2;
}

body.admin-bar .fy-woo-page--account:not(.fy-account-guest) .woocommerce-MyAccount-navigation {
  top: calc(1.25rem + 32px);
}

@media (max-width: 782px) {
  body.admin-bar .fy-woo-page--account:not(.fy-account-guest) .woocommerce-MyAccount-navigation {
    top: calc(1.25rem + 46px);
  }
}

@media (max-width: 900px) {
  .fy-woo-page--account:not(.fy-account-guest) .woocommerce-MyAccount-navigation {
    position: static;
  }
}

.fy-woo-page--account .woocommerce-MyAccount-navigation a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.fy-woo-page--account .woocommerce-MyAccount-navigation li.is-active a {
  box-shadow: inset 3px 0 0 var(--blue);
}

.fy-woo-page--account
  .woocommerce-MyAccount-navigation
  li.woocommerce-MyAccount-navigation-link--customer-logout {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 6px;
}

.fy-woo-page--account
  .woocommerce-MyAccount-navigation
  li.woocommerce-MyAccount-navigation-link--customer-logout:last-child {
  border-bottom: none;
}

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

.fy-woo-page--account .woocommerce-MyAccount-content > p {
  margin: 0 0 1rem;
  line-height: 1.65;
  color: var(--text);
  max-width: 65ch;
}

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

.fy-woo-page--account .woocommerce-MyAccount-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.fy-woo-page--account .woocommerce-MyAccount-content a:not(.button):not(.woocommerce-button):not(.woocommerce-Button) {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.fy-woo-page--account .woocommerce-MyAccount-content a:not(.button):not(.woocommerce-button):not(.woocommerce-Button):hover {
  text-decoration-thickness: 2px;
}

.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table {
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table th,
.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}

.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table thead th {
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table tbody tr:last-child td,
.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table tbody tr:last-child th {
  border-bottom: none;
}

.fy-woo-page--account .woocommerce-MyAccount-content form .form-row {
  margin-bottom: 16px;
  padding: 0;
}

.fy-woo-page--account .woocommerce-MyAccount-content form .form-row:last-child {
  margin-bottom: 0;
}

/* ─── Guest login + register (PictureThis-style) ─── */
.fy-woo-page--account.fy-account-guest .fy-woocommerce-wrap,
.fy-woo-page--account.fy-account-guest .fy-woocommerce-wrap > .woocommerce {
  display: block;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: none;
  gap: 0;
}

.fy-account-auth {
  width: 100%;
  clear: both;
}

.fy-account-auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  float: none;
  clear: both;
}

.fy-account-auth-grid::before,
.fy-account-auth-grid::after {
  display: none;
  content: none;
}

.fy-account-auth-panel {
  float: none;
  width: 100%;
  clear: none;
  margin: 0;
}

.fy-account-auth--dual .fy-account-auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}

.fy-account-auth-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  height: 100%;
}

.fy-account-auth-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 24px;
  padding: 0;
}

.fy-account-auth-hint {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.fy-account-auth-panel .woocommerce-form-login,
.fy-account-auth-panel .woocommerce-form-register {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  max-width: none;
}

.fy-account-auth form .form-row {
  float: none;
  width: 100%;
  margin-right: 0;
  padding: 0;
}

.fy-account-auth-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 8px;
  clear: both;
}

.fy-account-auth-actions .woocommerce-form-login__rememberme {
  margin: 0;
  order: 1;
}

.fy-account-auth-actions .woocommerce-form-login__submit,
.fy-account-auth-actions .woocommerce-form-register__submit {
  width: 100%;
  order: 2;
  margin: 0;
}

.fy-account-auth-panel .lost_password {
  margin: 16px 0 0;
  font-size: 14px;
}

.fy-account-auth-panel .lost_password a {
  color: var(--blue);
  font-weight: 600;
}

.fy-account-auth-panel .woocommerce-privacy-policy-text,
.fy-account-auth-panel .woocommerce-privacy-policy-text p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
}

.fy-account-auth-panel .woocommerce-privacy-policy-text a {
  color: var(--blue);
  font-weight: 600;
}

.fy-woo-page--account.fy-account-guest .woocommerce-notices-wrapper {
  max-width: 960px;
  margin: 0 auto 24px;
}

/* Guest dual layout — no extra card on inner forms (panel is the card) */
.fy-woo-page--account.fy-account-guest .fy-account-auth-panel .woocommerce-form-login,
.fy-woo-page--account.fy-account-guest .fy-account-auth-panel .woocommerce-form-register {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  max-width: none;
}

/* Logged-out fallback when register is disabled (single form only) */
.fy-woo-page--account.fy-account-guest:not(:has(.fy-account-auth--dual)) .woocommerce-form-login,
.fy-woo-page--account.fy-account-guest:not(:has(.fy-account-auth--dual)) .woocommerce-form-register {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 0 auto;
  max-width: 480px;
}

.fy-woo-page--account .woocommerce-form-row {
  margin-bottom: 16px;
}

.fy-woo-page--account .woocommerce-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.fy-woo-page--account .woocommerce-form-row .required {
  color: #b91c1c;
}

.fy-woo-page--account .woocommerce-LostPassword {
  margin-top: 12px;
  font-size: 14px;
}

.fy-woo-page--account .woocommerce-LostPassword a {
  color: var(--blue);
  font-weight: 600;
}

/* Edit account / address fieldsets */
.fy-woo-page--account .woocommerce-MyAccount-content fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 0 0 24px;
}

.fy-woo-page--account .woocommerce-MyAccount-content fieldset legend {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 0 8px;
  color: var(--text);
}

/* Addresses */
.fy-woo-page--account .woocommerce-Addresses {
  display: grid;
  gap: 20px;
}

.fy-woo-page--account .woocommerce-Addresses .woocommerce-Address {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0;
}

.fy-woo-page--account .woocommerce-Addresses .woocommerce-Address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fy-woo-page--account .woocommerce-Addresses .woocommerce-Address-title h3 {
  margin: 0;
  font-size: 18px;
}

.fy-woo-page--account .woocommerce-Addresses .edit {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.fy-woo-page--account .woocommerce-Addresses address {
  font-style: normal;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

/* Orders & downloads tables */
.fy-woo-page--account .woocommerce-MyAccount-content table.shop_table,
.fy-woo-page--account .woocommerce-orders-table,
.fy-woo-page--account .woocommerce-table--order-downloads {
  width: 100%;
  margin-bottom: 24px;
}

.fy-woo-page--account .woocommerce-MyAccount-content .woocommerce-pagination {
  margin-top: 20px;
}

.fy-woo-page--account .woocommerce-MyAccount-content .woocommerce-pagination .button {
  margin-right: 8px;
}

/* Order view */
.fy-woo-page--account .woocommerce-order-details,
.fy-woo-page--account .woocommerce-customer-details {
  margin-bottom: 24px;
}

.fy-woo-page--account .woocommerce-order-details__title,
.fy-woo-page--account .woocommerce-column__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 16px;
}

.fy-woo-page--account .woocommerce-customer-details address {
  font-style: normal;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  line-height: 1.65;
}

/* Payment methods */
.fy-woo-page--account .woocommerce-MyAccount-paymentMethods {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fy-woo-page--account .woocommerce-MyAccount-paymentMethods li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.fy-woo-page--account .woocommerce-MyAccount-paymentMethods li:last-child {
  border-bottom: none;
}

/* Account action buttons */
.fy-woo-page--account .woocommerce-MyAccount-content .button,
.fy-woo-page--account .woocommerce-MyAccount-content a.button,
.fy-woo-page--account .woocommerce-MyAccount-content button.button {
  margin-top: 8px;
  margin-right: 8px;
}

.fy-woo-page--account .woocommerce-message,
.fy-woo-page--account .woocommerce-info,
.fy-woo-page--account .woocommerce-error {
  margin-bottom: 20px;
}

/* Mobile nav dropdown toggle — hidden on desktop (sidebar shows normally). */
.fy-acct-nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  .fy-woo-page--account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Reset the explicit desktop column/row placement so nav and content stack
     into a single full-width column. */
  .fy-woo-page--account .woocommerce-MyAccount-navigation,
  .fy-woo-page--account .woocommerce-MyAccount-content {
    grid-column: 1;
    grid-row: auto;
  }

  .fy-woo-page--account .woocommerce-MyAccount-content {
    padding: 22px 20px;
  }

  /* Collapse the sidebar navigation behind a dropdown toggle so the tab
     content takes the full width. */
  .fy-woo-page--account .fy-acct-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
  }

  .fy-acct-nav-toggle-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fy-acct-nav-toggle-icon {
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-left: 10px;
    flex-shrink: 0;
  }

  .fy-woo-page--account .woocommerce-MyAccount-navigation.is-open .fy-acct-nav-toggle-icon {
    transform: rotate(-135deg);
  }

  /* Nav list hidden until the toggle is opened, then drops below the button. */
  .fy-woo-page--account .woocommerce-MyAccount-navigation ul {
    display: none;
    margin-top: 8px;
  }

  .fy-woo-page--account .woocommerce-MyAccount-navigation.is-open ul {
    display: block;
  }

  .fy-account-auth--dual .fy-account-auth-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .fy-account-auth-panel {
    padding: 24px 22px;
  }
}

@media (max-width: 600px) {
  .fy-woo-page--account .woocommerce-MyAccount-content table.shop_table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
