/**
 * Chemesis Core — My Account styles.
 * Approved Vercel account shell over real WooCommerce account endpoints.
 * Prefix: .chza-* (order-detail pieces reuse .chco-* from
 * order-confirmation.css, which is also enqueued on account pages).
 */

.chza-inner {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .chza-inner {
    padding-top: 3rem;
  }
}

/* ------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------ */
.chza-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .chza-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .chza-aside {
    grid-column: span 3;
  }

  .chza-content {
    grid-column: span 9;
  }
}

.chza-aside,
.chza-content {
  min-width: 0;
}

/* Neutralise WooCommerce's classic float columns — the grid handles layout. */
.woocommerce-MyAccount-navigation.chza-nav {
  float: none;
  width: 100%;
}

.woocommerce-MyAccount-content.chza-content {
  float: none;
  width: 100%;
}

.chza-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */
.chza-nav {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  padding: 0.75rem;
}

.chza-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chza-nav-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--ch-radius-sm);
  font-size: var(--ch-type-body-sm);
  font-weight: 500;
  color: var(--ch-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s var(--ch-ease-expo), color 0.25s var(--ch-ease-expo);
}

.chza-nav-list li a:hover {
  background: var(--ch-paper);
  color: var(--ch-ink-900);
}

.chza-nav-list li.is-active a,
.chza-nav-list li.woocommerce-MyAccount-navigation-link--active a {
  background: var(--ch-ink-900);
  color: #fff;
}

.chza-nav-icon {
  flex-shrink: 0;
}

.chza-nav-count {
  margin-left: auto;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  color: var(--ch-faint);
}

.chza-nav-list li.is-active .chza-nav-count {
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1023px) {
  .chza-nav {
    padding: 0.5rem;
  }

  .chza-nav-list {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chza-nav-list li {
    flex: 0 0 auto;
  }
}

/* ------------------------------------------------------------------
   Overview
   ------------------------------------------------------------------ */
.chza-stats {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .chza-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.chza-stat,
.chza-card {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  padding: 1.5rem;
}

.chza-stat-label {
  margin: 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chza-stat-value {
  margin: 0.75rem 0 0;
  font-family: var(--ch-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ch-ink-900);
}

.chza-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.chza-eyebrow {
  margin: 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ch-faint);
}

.chza-inline-link {
  font-size: var(--ch-type-label);
  color: var(--ch-blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chza-recent {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.chza-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--ch-line);
}

.chza-order-ref {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-body);
  font-weight: 500;
  color: var(--ch-ink-900);
  text-decoration: none;
}

.chza-order-ref:hover {
  color: var(--ch-blue-600);
}

.chza-order-date {
  display: block;
  margin-top: 0.125rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chza-recent-total {
  font-size: var(--ch-type-body);
  font-weight: 600;
  color: var(--ch-ink-900);
}

.chza-empty-inline {
  margin-top: 1rem;
}

.chza-body {
  margin: 0;
  font-size: var(--ch-type-body);
  line-height: 1.65;
  color: var(--ch-muted);
}

.chza-empty-inline .chza-cta {
  margin-top: 1.25rem;
}

/* ------------------------------------------------------------------
   Orders list
   ------------------------------------------------------------------ */
.chza-orders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chza-order {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  overflow: hidden;
}

.chza-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.25rem 1.5rem;
}

.chza-order-ident {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.chza-order-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.chza-order-items {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chza-order-total {
  font-size: var(--ch-type-body);
  font-weight: 600;
  color: var(--ch-ink-900);
}

.chza-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--ch-line);
  border-radius: 999px;
  background: #fff;
  padding: 0.25rem 0.65rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-muted);
  white-space: nowrap;
}

.chza-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ch-blue);
}

.chza-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--ch-line);
  padding: 1rem 1.5rem;
}

.chza-pagination {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ------------------------------------------------------------------
   Empty states
   ------------------------------------------------------------------ */
.chza-empty {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}

.chza-empty-heading {
  margin: 0;
  font-family: var(--ch-font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ch-ink-900);
}

.chza-empty-text {
  margin: 0.5rem auto 0;
  max-width: 28rem;
  font-size: var(--ch-type-body-sm);
  line-height: 1.65;
  color: var(--ch-muted);
}

.chza-cta {
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------------
   Order detail (reuses .chco-* card/rows/totals)
   ------------------------------------------------------------------ */
.chza-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chza-detail-title {
  margin: 0.5rem 0 0;
  font-family: var(--ch-font-display);
  font-size: var(--ch-type-h3);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ch-ink-900);
}

.chza-detail-sub {
  margin: 0.35rem 0 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-mono);
  color: var(--ch-faint);
}

.chza-detail-status {
  margin: 1rem 0 0;
  font-size: var(--ch-type-body-sm);
  line-height: 1.6;
  color: var(--ch-muted);
}

.chza-detail-status mark {
  background: transparent;
  color: inherit;
  font-weight: 600;
}

.chza-updates {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chza-note-date {
  margin: 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ch-faint);
}

.chza-note-text {
  margin-top: 0.35rem;
  font-size: var(--ch-type-mono);
  line-height: 1.65;
  color: var(--ch-muted);
}

.chza-note-text p {
  margin: 0 0 0.5rem;
}

/* ------------------------------------------------------------------
   Forms (login, lost password, addresses, account details)
   ------------------------------------------------------------------ */
.chza-inner form.woocommerce-form-login,
.chza-inner form.woocommerce-ResetPassword,
.chza-inner form.lost_reset_password {
  max-width: 28rem;
  margin: 0 auto;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  padding: 2rem;
}

.chza-inner form.woocommerce-form-login > p:first-of-type,
.chza-inner form.woocommerce-ResetPassword > p:first-of-type {
  margin: 0 0 1.25rem;
  font-size: var(--ch-type-body-sm);
  line-height: 1.6;
  color: var(--ch-muted);
}

.chza-inner .form-row {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  min-width: 0;
}

.chza-inner .form-row label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ch-muted);
  line-height: 1.5;
}

.chza-inner .form-row .required {
  color: inherit;
  text-decoration: none;
}

.chza-inner .woocommerce-input-wrapper,
.chza-inner .password-input {
  display: block;
  width: 100%;
}

body .chza-inner .form-row input.input-text,
body .chza-inner .form-row input[type="text"],
body .chza-inner .form-row input[type="email"],
body .chza-inner .form-row input[type="password"],
body .chza-inner .form-row input[type="tel"],
body .chza-inner .form-row select,
body .chza-inner .form-row textarea {
  width: 100%;
  height: var(--ch-input-height);
  padding: 0 0.9rem;
  background: #fff;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-sm);
  font-family: var(--ch-font-body);
  font-size: var(--ch-input-font);
  color: var(--ch-text);
  box-shadow: none;
  transition: border-color 0.3s var(--ch-ease-expo), box-shadow 0.3s var(--ch-ease-expo);
}

body .chza-inner select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b556a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

body .chza-inner input.input-text:hover,
body .chza-inner select:hover {
  border-color: rgba(11, 18, 32, 0.28);
}

body .chza-inner input.input-text:focus,
body .chza-inner input[type="text"]:focus,
body .chza-inner input[type="email"]:focus,
body .chza-inner input[type="password"]:focus,
body .chza-inner select:focus {
  outline: none;
  border-color: var(--ch-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 252, 0.12);
}

/* Select2-enhanced country/state selects */
body .chza-inner .select2-container {
  width: 100% !important;
}

body .chza-inner .select2-selection--single {
  display: flex;
  align-items: center;
  height: var(--ch-input-height);
  padding: 0 2.4rem 0 0.9rem;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-sm);
  background: #fff;
  font-size: var(--ch-input-font);
  color: var(--ch-text);
}

body .chza-inner .select2-selection--single .select2-selection__rendered {
  padding: 0;
  line-height: normal;
  color: var(--ch-text);
}

body .chza-inner .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.9rem;
}

body .chza-inner .select2-container--focus .select2-selection--single {
  border-color: var(--ch-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 252, 0.12);
}

/* Remember-me / helper rows */
.chza-inner .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--ch-type-body-sm);
  color: var(--ch-muted);
  margin: 0 0 1rem;
}

.chza-inner .woocommerce-LostPassword {
  margin: 0 0 1.25rem;
  font-size: var(--ch-type-body-sm);
}

.chza-inner .woocommerce-LostPassword a {
  color: var(--ch-blue-600);
}

/* Submit buttons */
body .chza-inner button.button,
body .chza-inner input[type="submit"],
body .chza-inner .woocommerce-Button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ch-btn-height);
  padding: 0 var(--ch-btn-padding);
  border: 0;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-blue);
  color: #fff;
  font-family: var(--ch-font-body);
  font-size: var(--ch-btn-font);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s var(--ch-ease-expo), box-shadow 0.3s var(--ch-ease-expo);
}

body .chza-inner button.button:hover,
body .chza-inner .woocommerce-Button:hover {
  background: var(--ch-blue-600);
  box-shadow: 0 14px 30px -14px rgba(0, 84, 252, 0.55);
}

body .chza-inner .woocommerce-form-login__submit,
body .chza-inner form.woocommerce-ResetPassword button.button,
body .chza-inner form.lost_reset_password button.button {
  width: 100%;
}

/* Addresses */
.chza-inner .woocommerce-Address {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
  background: #fff;
  padding: 1.5rem;
}

.chza-inner .woocommerce-Address-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.chza-inner .woocommerce-Address-title h3 {
  margin: 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ch-faint);
}

.chza-inner .woocommerce-Address-title a {
  font-size: var(--ch-type-body-sm);
  color: var(--ch-blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chza-inner .woocommerce-Address address {
  margin-top: 1rem;
  font-style: normal;
  font-size: var(--ch-type-body-sm);
  line-height: 1.65;
  color: var(--ch-text);
}

.chza-inner .woocommerce-Address + .woocommerce-Address {
  margin-top: 1.25rem;
}

.chza-inner .u-columns {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .chza-inner .u-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Notices */
.chza-inner .woocommerce-notices-wrapper,
.chza-inner .woocommerce-message,
.chza-inner .woocommerce-info,
.chza-inner .woocommerce-error {
  list-style: none;
}

.chza-inner .woocommerce-message,
.chza-inner .woocommerce-info,
.chza-inner .woocommerce-error {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--ch-line);
  border-left: 3px solid var(--ch-blue);
  border-radius: var(--ch-radius-sm);
  background: #fff;
  font-size: var(--ch-type-body-sm);
  line-height: 1.6;
  color: var(--ch-text);
}

.chza-inner .woocommerce-error {
  border-left-color: #d23b3b;
}

.chza-inner .woocommerce-message a,
.chza-inner .woocommerce-info a,
.chza-inner .woocommerce-error a {
  color: var(--ch-blue-600);
}

body .chza-section button,
body .chza-section button:hover,
body .chza-section button:focus,
body .chza-section button:focus-visible {
  background: transparent;
  color: inherit;
  padding: 0;
}

body .chza-section .ch-btn {
  background: var(--ch-ink-900);
  color: #fff;
  padding-inline: var(--ch-btn-padding);
}

body .chza-section .ch-btn-outline {
  background: transparent;
  color: var(--ch-ink-900);
  padding-inline: var(--ch-btn-padding);
}

body .chza-section .ch-btn-primary {
  background: var(--ch-blue);
  color: #fff;
  padding-inline: var(--ch-btn-padding);
}

body .chza-section .ch-btn-primary:hover {
  background: var(--ch-blue-600);
}

/* Sticky account nav on desktop */
@media (min-width: 1024px) {
  .chza-aside {
    position: sticky;
    top: 7rem;
    align-self: start;
  }
}
