/* =====================================================================
 * Kundenbereich
 *
 * WooCommerce liefert "Mein Konto" als nackte Liste plus Textblock aus.
 * Hier bekommt der Bereich dieselbe Sprache wie der Rest der Seite:
 * Karten auf Papier, Oxanium fuer Ueberschriften, Archivo Narrow fuer
 * Beschriftungen, Karminrot als einziger Akzent.
 *
 * Der Bereich liegt immer in einer hellen Sektion. Farben kommen
 * ausschliesslich aus den Variablen, damit der Hell-Dunkel-Umschalter
 * auch hier greift.
 * ===================================================================== */

/* --- Grundraster: Navigation neben Inhalt ----------------------------- */
.woocommerce-account .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: start;
  gap: var(--fy-space-4);
}

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

/* Auf der Anmeldeseite gibt es keine Navigation, dort traegt der Inhalt
 * die ganze Breite. */
.woocommerce-account:not(.logged-in) .woocommerce {
  display: block;
}

/* =====================================================================
 * Kontonavigation
 * ===================================================================== */
/* WooCommerce setzt die Navigation auf width: 30% und laesst sie links
 * fliessen. In der Rasterspalte werden daraus rund neunzig Pixel, und die
 * Beschriftungen brechen buchstabenweise um. Die Spalte fuehrt die Breite,
 * nicht das Plugin. */
.woocommerce-account .woocommerce-MyAccount-navigation {
  float: none;
  width: 100%;
}

.woocommerce-MyAccount-navigation {
  position: sticky;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + 6rem);
  padding: 0.5rem;
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
}

.woocommerce-MyAccount-navigation ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce-MyAccount-navigation li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce-MyAccount-navigation li a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  color: inherit;
  font-family: var(--fy-font-util), sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.14em;
  border-radius: var(--fy-r-sm);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  transition:
    background var(--fy-dur-s) var(--fy-ease),
    color var(--fy-dur-s) var(--fy-ease),
    border-color var(--fy-dur-s) var(--fy-ease);
}

.woocommerce-MyAccount-navigation li a:hover {
  background: rgba(189, 9, 36, 0.06);
  color: var(--fy-crimson);
}

/* Der aktive Eintrag traegt zusaetzlich einen Balken, damit die
 * Information nicht allein an der Farbe haengt. */
.woocommerce-MyAccount-navigation li.is-active a {
  background: rgba(189, 9, 36, 0.08);
  color: var(--fy-crimson);
  border-left-color: var(--fy-crimson);
}

/* Abmelden steht am Ende und ist als Nebenweg erkennbar. */
.woocommerce-MyAccount-navigation-link--customer-logout {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--fy-line-paper);
}

.woocommerce-MyAccount-navigation-link--customer-logout a {
  color: var(--fy-slate);
}

/* =====================================================================
 * Inhaltsspalte
 * ===================================================================== */
.woocommerce-account .woocommerce-MyAccount-content {
  float: none;
  width: 100%;
  min-width: 0;
}

.fy-account-intro {
  max-width: 62ch;
  margin: 0 0 var(--fy-space-3);
  line-height: 1.7;
  color: var(--fy-slate);
}

.woocommerce-MyAccount-content > p {
  max-width: 68ch;
  line-height: 1.7;
}

.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3,
.woocommerce-account .woocommerce > h2 {
  font-family: var(--fy-font-display), sans-serif;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.woocommerce-MyAccount-content a:not(.button):not(.fy-account-tile) {
  color: var(--fy-crimson);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =====================================================================
 * Begruessung und Schnellzugriffe
 *
 * Kommt aus fy-account.php. Der Dashboard-Text von WooCommerce bleibt
 * darunter stehen, er erklaert die Bereiche in Worten.
 * ===================================================================== */
.fy-account-greeting {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin: 0 0 var(--fy-space-3);
  padding-bottom: var(--fy-space-2);
  border-bottom: 1px solid var(--fy-line-paper);
}

.fy-account-greeting-name {
  font-family: var(--fy-font-display), sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.fy-account-greeting-meta {
  font-family: var(--fy-font-util), sans-serif;
  font-size: var(--fy-t-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fy-slate);
}

.fy-account-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--fy-space-2);
  margin: 0 0 var(--fy-space-4);
  padding: 0;
  list-style: none;
}

.fy-account-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  padding: var(--fy-space-3);
  background: var(--fy-paper-raised);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
  transition:
    border-color var(--fy-dur-s) var(--fy-ease),
    transform var(--fy-dur-s) var(--fy-ease);
}

.fy-account-tile:hover {
  border-color: var(--fy-crimson);
  transform: translate3d(0, -2px, 0);
}

.fy-account-tile:focus-visible {
  outline: 2px solid var(--fy-crimson-glow);
  outline-offset: 3px;
}

.fy-account-tile-label {
  font-family: var(--fy-font-util), sans-serif;
  font-size: var(--fy-t-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fy-crimson);
}

.fy-account-tile-title {
  font-family: var(--fy-font-display), sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.fy-account-tile-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fy-slate);
}

/* =====================================================================
 * Anmeldung
 * ===================================================================== */
.fy-account-login-main {
  min-width: 0;
}

.fy-account-login {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: var(--fy-space-4);
}

.woocommerce-account .woocommerce-form-login {
  margin: 0;
  padding: var(--fy-space-4);
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
}

.woocommerce-account .woocommerce-form-login .form-row {
  margin: 0 0 var(--fy-space-2);
  padding: 0;
}

.woocommerce-account .woocommerce-form-login label {
  display: block;
  margin-bottom: 0.35rem;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--fy-space-2);
  font-family: var(--fy-font-body), sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
  cursor: pointer;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__rememberme input {
  width: 18px;
  height: 18px;
  accent-color: var(--fy-crimson);
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit {
  display: block;
  width: 100%;
  margin: 0;
}

.woocommerce-account .woocommerce-LostPassword {
  margin: var(--fy-space-2) 0 0;
  font-size: 0.9375rem;
}

.woocommerce-account .woocommerce-LostPassword a {
  color: var(--fy-crimson);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Die Erklaerung neben dem Formular: wozu ein Konto gut ist. */
.fy-account-aside {
  padding: var(--fy-space-4);
  background: var(--fy-ink);
  color: var(--fy-paper);
  border-radius: var(--fy-r-md);
}

.fy-account-aside-eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--fy-font-util), sans-serif;
  font-size: var(--fy-t-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fy-oak);
}

.fy-account-aside h2 {
  margin: 0 0 0.75rem;
  font-family: var(--fy-font-display), sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fy-paper);
}

.fy-account-aside p {
  margin: 0 0 var(--fy-space-2);
  line-height: 1.65;
  color: var(--fy-mist);
}

.fy-account-aside ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 var(--fy-space-3);
  padding: 0;
  list-style: none;
}

.fy-account-aside li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.55;
}

.fy-account-aside li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fy-crimson);
}

.fy-account-aside a {
  color: var(--fy-oak);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =====================================================================
 * Bestellungen, Adressen, Formulare
 * ===================================================================== */
.woocommerce-account .woocommerce-orders-table,
.woocommerce-account table.shop_table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  overflow: hidden;
}

.woocommerce-account table.shop_table th {
  padding: 0.9rem 1rem;
  background: rgba(11, 11, 12, 0.03);
  font-family: var(--fy-font-util), sans-serif;
  font-size: var(--fy-t-label);
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fy-slate);
  border-bottom: 1px solid var(--fy-line-paper);
}

.woocommerce-account table.shop_table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--fy-line-paper);
  font-variant-numeric: tabular-nums;
}

.woocommerce-account table.shop_table tr:last-child td {
  border-bottom: 0;
}

.woocommerce-account .woocommerce-Address {
  padding: var(--fy-space-3);
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
}

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

.woocommerce-account .woocommerce-Address-title h2,
.woocommerce-account .woocommerce-Address-title h3 {
  margin: 0;
}

.woocommerce-account .woocommerce-Address-title .edit {
  font-family: var(--fy-font-util), sans-serif;
  font-size: var(--fy-t-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.woocommerce-account .woocommerce-EditAccountForm,
.woocommerce-account form.edit-account,
.woocommerce-account form.woocommerce-address-fields {
  padding: var(--fy-space-4);
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
}

.woocommerce-account fieldset {
  margin: var(--fy-space-3) 0 0;
  padding: var(--fy-space-3) 0 0;
  border: 0;
  border-top: 1px solid var(--fy-line-paper);
}

.woocommerce-account fieldset legend {
  padding: 0;
  font-family: var(--fy-font-display), sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

/* Leerzustand: ehrlich benennen statt eine leere Flaeche zeigen. */
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-error {
  margin: 0 0 var(--fy-space-3);
  padding: var(--fy-space-3) var(--fy-space-3) var(--fy-space-3) var(--fy-space-4);
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-left: 3px solid var(--fy-crimson);
  border-radius: var(--fy-r-md);
  list-style: none;
}

.woocommerce-account .woocommerce-info .button,
.woocommerce-account .woocommerce-message .button {
  margin-left: var(--fy-space-2);
}

/* =====================================================================
 * Kleinere Bildschirme
 * ===================================================================== */
@media (max-width: 1023px) {
  .woocommerce-account .woocommerce {
    grid-template-columns: minmax(0, 1fr);
  }

  .woocommerce-MyAccount-navigation {
    position: static;
  }

  .woocommerce-MyAccount-navigation ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }

  .fy-account-login-main {
  min-width: 0;
}

.fy-account-login {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .woocommerce-MyAccount-navigation ul {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Tabellen werden zu gestapelten Karten, nicht zu Scrollflaechen. */
  .woocommerce-account table.shop_table,
  .woocommerce-account table.shop_table tbody,
  .woocommerce-account table.shop_table tr,
  .woocommerce-account table.shop_table td {
    display: block;
    width: 100%;
  }

  .woocommerce-account table.shop_table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .woocommerce-account table.shop_table tr {
    padding: var(--fy-space-2) 0;
    border-bottom: 1px solid var(--fy-line-paper);
  }

  .woocommerce-account table.shop_table tr:last-child {
    border-bottom: 0;
  }

  .woocommerce-account table.shop_table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 1rem;
    border-bottom: 0;
    text-align: right;
  }

  /* WooCommerce liefert die Spaltenbeschriftung im Attribut mit. */
  .woocommerce-account table.shop_table td::before {
    content: attr(data-title);
    font-family: var(--fy-font-util), sans-serif;
    font-size: var(--fy-t-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fy-slate);
    text-align: left;
  }
}

/* =====================================================================
 * Dunkler Modus
 *
 * Der Kundenbereich liegt in einer hellen Sektion. Im dunklen Modus ist
 * "hell" das warme Papier, die Karten muessen dort trotzdem lesbar
 * bleiben. Die Variablen erledigen das, hier stehen nur die Faelle, in
 * denen eine Farbe fest gesetzt war.
 * ===================================================================== */
html[data-fy-theme="light"] .fy-account-aside p {
  color: rgba(255, 255, 255, 0.82);
}

html[data-fy-theme="light"] .fy-account-aside,
html[data-fy-theme="light"] .fy-account-aside h2 {
  color: #17171B;
}

html[data-fy-theme="light"] .fy-account-aside p,
html[data-fy-theme="light"] .fy-account-aside li {
  color: #45454C;
}

html[data-fy-theme="light"] .fy-account-aside-eyebrow,
html[data-fy-theme="light"] .fy-account-aside a {
  color: var(--fy-oak);
}

@media (prefers-reduced-motion: reduce) {
  .fy-account-tile,
  .woocommerce-MyAccount-navigation li a {
    transition: none;
  }

  .fy-account-tile:hover {
    transform: none;
  }
}
