/* Finest Coffee & Tea — WooCommerce My Account styling.
   On-brand (Montserrat, gold #c8a35a, espresso, cream) for the login, dashboard,
   sidebar nav, orders/downloads tables, addresses and account-details forms.
   Enqueued from functions.php on is_account_page(). (AFB) */

.woocommerce-account {
  --acc-gold: #c8a35a;
  --acc-gold-dark: #9a6a2f;
  --acc-espresso: #2b231c;
  --acc-brown: #3a2f26;
  --acc-cream: #f7f1e8;
  --acc-cream-soft: #fbf8f3;
  --acc-card: #fffdf9;
  --acc-line: #e9dfd0;
  --acc-muted: #6b5d4f;
  --acc-font: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- Page shell ---------- */
.woocommerce-account .woocommerce {
  font-family: var(--acc-font) !important;
  color: var(--acc-brown);
}

/* Cream on the body too, so the area between header and footer is fully cream
   (the content block is shorter than the viewport and left white gaps). */
body.woocommerce-account {
  background: #f7f1e8 !important;
}

.woocommerce-account main,
.woocommerce-account .cms-rows,
.woocommerce-account #primary,
.woocommerce-account .content-area {
  background: var(--acc-cream) !important;
  min-height: 60vh;
}

/* The theme inserts 50px white spacer divs above and below the content
   (inline background:#ffffff). Recolour them to cream so there are no white
   strips separating the account section from the header and footer. */
.woocommerce-account .cms-rows > div[style*="background-color:#ffffff"],
.woocommerce-account .cms-rows > div[style*="background-color: #ffffff"],
.woocommerce-account .cms-rows > div[style*="background-color:#fff"] {
  background-color: #f7f1e8 !important;
}

/* Page title ("My account" / "Login" etc.) */
.woocommerce-account .entry-title,
.woocommerce-account h1.entry-title,
.woocommerce-account .page-title {
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  color: var(--acc-espresso) !important;
  text-align: center;
  margin: 8px 0 4px !important;
}

/* ---------- Two-column layout (logged in: nav + content) ---------- */
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
  display: grid !important;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1120px;
  margin: 40px auto 72px;
  padding: 0 20px;
}

/* ---------- Sidebar navigation ---------- */
.woocommerce-account .woocommerce-MyAccount-navigation {
  grid-column: 1 / 2 !important;
  grid-row: 1 !important;
  background: var(--acc-card);
  border: 1px solid var(--acc-line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(43, 35, 28, 0.08);
  position: sticky;
  top: 24px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
  list-style: none !important;
  margin: 2px 0 !important;
  padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 12px 16px;
  border-radius: 9px;
  color: var(--acc-brown) !important;
  font-family: var(--acc-font) !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  background: var(--acc-cream);
  color: var(--acc-espresso) !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background: var(--acc-gold);
  color: #2b231c !important;
  font-weight: 700;
}

/* Log out sits a touch apart */
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
  margin-top: 8px !important;
  border-top: 1px solid var(--acc-line);
  padding-top: 6px !important;
}

/* ---------- Content card ---------- */
.woocommerce-account .woocommerce-MyAccount-content {
  grid-column: 2 / 3 !important;
  grid-row: 1 !important;
  background: var(--acc-card);
  border: 1px solid var(--acc-line);
  border-radius: 14px;
  padding: 34px 36px;
  box-shadow: 0 12px 30px rgba(43, 35, 28, 0.08);
  min-height: 320px;
}

.woocommerce-account .woocommerce-MyAccount-content p,
.woocommerce-account .woocommerce-MyAccount-content li,
.woocommerce-account .woocommerce-MyAccount-content td,
.woocommerce-account .woocommerce-MyAccount-content th {
  font-family: var(--acc-font) !important;
  color: var(--acc-brown);
  line-height: 1.7;
}

.woocommerce-account .woocommerce-MyAccount-content a:not(.button) {
  color: var(--acc-gold-dark) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.woocommerce-account .woocommerce-MyAccount-content a:not(.button):hover {
  color: var(--acc-espresso) !important;
}

.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3,
.woocommerce-account fieldset legend {
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  color: var(--acc-espresso) !important;
  margin: 28px 0 16px !important;
}

/* ---------- Forms: labels + inputs (fixes the invisible-text bug) ---------- */
.woocommerce-account label {
  font-family: var(--acc-font) !important;
  color: var(--acc-brown) !important;
  font-weight: 600;
  font-size: 0.9rem;
}

.woocommerce-account input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.woocommerce-account textarea,
.woocommerce-account select {
  background: #ffffff !important;
  color: var(--acc-brown) !important;
  border: 1px solid var(--acc-line) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  font-family: var(--acc-font) !important;
  font-size: 0.98rem !important;
  box-shadow: none !important;
  -webkit-text-fill-color: var(--acc-brown);
}

.woocommerce-account input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
.woocommerce-account textarea:focus,
.woocommerce-account select:focus {
  border-color: var(--acc-gold) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(200, 163, 90, 0.22) !important;
}

/* Password show/hide eye: pin to the right of the field (theme stretches it) */
.woocommerce-account .password-input {
  display: block !important;
  position: relative !important;
  width: 100% !important;
}

.woocommerce-account .password-input input {
  width: 100% !important;
  padding-right: 46px !important;
}

.woocommerce-account .show-password-input {
  position: absolute !important;
  top: 50% !important;
  right: 14px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  cursor: pointer;
}

/* Keep browser autofill on-brand (white field, dark text) instead of pale blue.
   Selector is kept as specific as the base input rule so it wins the box-shadow. */
.woocommerce-account input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):-webkit-autofill,
.woocommerce-account input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):-webkit-autofill:hover,
.woocommerce-account input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px #ffffff inset !important;
  box-shadow: 0 0 0 100px #ffffff inset !important;
  -webkit-text-fill-color: var(--acc-brown) !important;
  caret-color: var(--acc-brown);
  transition: background-color 9999s ease-in-out 0s;
}

.woocommerce-account input[type="radio"],
.woocommerce-account input[type="checkbox"] {
  accent-color: var(--acc-gold);
  width: 17px;
  height: 17px;
  vertical-align: middle;
}

.woocommerce-account .woocommerce-form__label-for-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* form field description text */
.woocommerce-account form .woocommerce-form-row span em,
.woocommerce-account fieldset + span em,
.woocommerce-account em {
  color: var(--acc-muted);
}

/* ---------- Buttons ---------- */
/* Buttons match the site's primary CTA (.fh-btn on the home design):
   brown background, white text, 2px radius, hover to espresso. */
.woocommerce-account .button,
.woocommerce-account button.button,
.woocommerce-account button[type="submit"],
.woocommerce-account input[type="submit"],
.woocommerce-account a.button {
  background: var(--acc-brown-cta, #7e4d1b) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 2px !important;
  padding: 15px 34px !important;
  font-family: var(--acc-font) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease !important;
  box-shadow: none !important;
}

.woocommerce-account .button:hover,
.woocommerce-account button.button:hover,
.woocommerce-account button[type="submit"]:hover,
.woocommerce-account input[type="submit"]:hover,
.woocommerce-account a.button:hover {
  background: var(--acc-espresso) !important;
  color: #ffffff !important;
}

/* the password show/hide toggle is not a real button */
.woocommerce-account .show-password-input {
  background: transparent !important;
  padding: 0 !important;
}

/* ---------- Login (logged out) ---------- */
.woocommerce-account .woocommerce:has(.woocommerce-form-login):not(:has(.woocommerce-MyAccount-navigation)) {
  max-width: 480px;
  margin: 56px auto 80px;
  padding: 0 20px;
}

/* Centre the "Login" heading over the card + a warm welcome line */
.woocommerce-account .woocommerce:has(.woocommerce-form-login) > h2 {
  text-align: center !important;
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  font-size: 1.9rem !important;
  color: var(--acc-espresso) !important;
  margin: 0 0 6px !important;
}

.woocommerce-account .woocommerce:has(.woocommerce-form-login) > h2::after {
  content: "Sign in to view your orders, addresses and account details.";
  display: block;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--acc-muted);
  margin: 10px auto 26px;
  max-width: 340px;
  line-height: 1.5;
}

.woocommerce-account .woocommerce-form-login {
  background: var(--acc-card) !important;
  border: 1px solid var(--acc-line) !important;
  border-radius: 14px !important;
  padding: 34px 36px !important;
  box-shadow: 0 14px 34px rgba(43, 35, 28, 0.1) !important;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit {
  width: 100%;
  margin-top: 6px;
}

.woocommerce-account .woocommerce-LostPassword {
  margin-top: 16px;
  text-align: center;
}

/* ---------- Lost / reset password ---------- */
.woocommerce-account .woocommerce:has(.woocommerce-ResetPassword):not(:has(.woocommerce-MyAccount-navigation)) {
  max-width: 480px;
  margin: 56px auto 80px;
  padding: 0 20px;
}

.woocommerce-account .woocommerce:has(.woocommerce-ResetPassword) > h2 {
  text-align: center !important;
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  font-size: 1.9rem !important;
  color: var(--acc-espresso) !important;
  margin: 0 0 16px !important;
}

.woocommerce-account .woocommerce-ResetPassword {
  background: var(--acc-card) !important;
  border: 1px solid var(--acc-line) !important;
  border-radius: 14px !important;
  padding: 34px 36px !important;
  box-shadow: 0 14px 34px rgba(43, 35, 28, 0.1) !important;
}

.woocommerce-account .woocommerce-ResetPassword > p:first-child {
  color: var(--acc-muted);
  margin-bottom: 22px;
}

.woocommerce-account .woocommerce-ResetPassword .woocommerce-Button {
  width: 100%;
  margin-top: 4px;
}

/* ---------- Tables (orders, downloads, subscriptions, payment methods) ---------- */
.woocommerce-account .woocommerce-MyAccount-content table.shop_table,
.woocommerce-account .woocommerce-orders-table,
.woocommerce-account table.woocommerce-table {
  border: 1px solid var(--acc-line) !important;
  border-radius: 12px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
  background: var(--acc-card);
  width: 100%;
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table th,
.woocommerce-account .woocommerce-orders-table th {
  background: var(--acc-cream) !important;
  color: var(--acc-espresso) !important;
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  padding: 14px 16px !important;
  border: 0 !important;
  text-align: left;
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table td,
.woocommerce-account .woocommerce-orders-table td {
  padding: 14px 16px !important;
  border: 0 !important;
  border-top: 1px solid var(--acc-line) !important;
  color: var(--acc-brown);
}

.woocommerce-account .woocommerce-MyAccount-content table.shop_table td.woocommerce-orders-table__cell-order-actions {
  text-align: right;
}

.woocommerce-account table.shop_table .button {
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
}

/* Space out multiple action buttons in a cell (orders / subscription details)
   so they don't sit flush against each other */
.woocommerce-account table.shop_table td .button,
.woocommerce-account table.shop_table td button.button,
.woocommerce-account table.shop_table td input.button,
.woocommerce-account .subscription_details td .button {
  display: inline-block !important;
  margin: 4px 10px 4px 0 !important;
  vertical-align: middle;
}

.woocommerce-account table.shop_table td .button:last-child {
  margin-right: 0 !important;
}

/* ---------- Edit-address / edit-account form rows ---------- */
.woocommerce-account form .form-row {
  margin: 0 0 18px !important;
}

.woocommerce-account .woocommerce-address-fields__field-wrapper,
.woocommerce-account .woocommerce-account-fields {
  margin-bottom: 6px;
}

.woocommerce-account form h3 {
  margin: 0 0 18px !important;
}

/* Force a proper columnar table on desktop (the theme stacks it by default) */
@media (min-width: 861px) {
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table thead {
    display: table-header-group !important;
  }
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table tr {
    display: table-row !important;
  }
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table th,
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table td {
    display: table-cell !important;
    text-align: left !important;
  }
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table td::before {
    content: none !important;
    display: none !important;
  }
  .woocommerce-account .woocommerce-MyAccount-content table.shop_table td.woocommerce-orders-table__cell-order-actions {
    text-align: right !important;
  }
}

/* ---------- Addresses ---------- */
.woocommerce-account .woocommerce-Addresses.u-columns {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 22px !important;
  margin: 16px 0 0 !important;
}

/* Each address is a clean card (theme uses .u-column1/.u-column2) */
.woocommerce-account .woocommerce-Addresses .u-column1,
.woocommerce-account .woocommerce-Addresses .u-column2,
.woocommerce-account .woocommerce-Address {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  background: var(--acc-cream-soft) !important;
  border: 1px solid var(--acc-line) !important;
  border-radius: 12px !important;
  padding: 24px 26px !important;
}

/* Pin the two cards side by side on the same row (theme order staggers them) */
.woocommerce-account .woocommerce-Addresses .u-column1 {
  grid-column: 1 !important;
  grid-row: 1 !important;
}
.woocommerce-account .woocommerce-Addresses .u-column2 {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

/* Kill the white box around the address heading */
.woocommerce-account .woocommerce-Address-title.title,
.woocommerce-account .woocommerce-Address-title {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 12px !important;
  display: flex !important;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.woocommerce-account .woocommerce-Address-title h2,
.woocommerce-account .woocommerce-Address-title h3 {
  font-family: var(--acc-font) !important;
  font-weight: 700 !important;
  font-size: 1.2rem !important;
  color: var(--acc-espresso) !important;
  margin: 0 !important;
}

.woocommerce-account .woocommerce-Address-title .edit {
  font-size: 0.85rem !important;
  white-space: nowrap;
}

.woocommerce-account .woocommerce-Address address {
  font-style: normal;
  background: transparent !important;
  color: var(--acc-brown);
  line-height: 1.7;
  margin: 0;
}

/* ---------- Notices (No orders / downloads etc.) ---------- */
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-error {
  border-radius: 10px !important;
  border: 1px solid var(--acc-line) !important;
  border-top: 3px solid var(--acc-gold) !important;
  background: var(--acc-cream-soft) !important;
  font-family: var(--acc-font) !important;
  color: var(--acc-brown) !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 20px 24px !important;
  line-height: 1.6;
}

/* Drop the default WooCommerce notice icon (renders as an odd box) */
.woocommerce-account .woocommerce-message::before,
.woocommerce-account .woocommerce-info::before,
.woocommerce-account .woocommerce-error::before {
  content: none !important;
  display: none !important;
}

.woocommerce-account .woocommerce-message .button,
.woocommerce-account .woocommerce-info .button,
.woocommerce-account .woocommerce-error .button {
  margin-left: auto !important;
  flex: 0 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 24px auto 52px;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation,
  .woocommerce-account .woocommerce-MyAccount-content {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation {
    position: static;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: block;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation li a {
    padding: 13px 16px;
    font-size: 0.95rem;
  }
  .woocommerce-account .woocommerce-MyAccount-content {
    padding: 24px 20px;
  }
  /* Stack First/Last name and address columns full width on mobile */
  .woocommerce-account form .form-row-first,
  .woocommerce-account form .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
    margin-bottom: 18px !important;
  }
  /* Notices: text then full-width button, comfortable spacing */
  .woocommerce-account .woocommerce-message,
  .woocommerce-account .woocommerce-info,
  .woocommerce-account .woocommerce-error {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .woocommerce-account .woocommerce-message .button,
  .woocommerce-account .woocommerce-info .button,
  .woocommerce-account .woocommerce-error .button {
    margin-left: 0 !important;
    width: 100%;
    text-align: center;
  }
  .woocommerce-account .woocommerce-Addresses.u-columns {
    grid-template-columns: 1fr !important;
  }
  .woocommerce-account .woocommerce-Addresses .u-column1,
  .woocommerce-account .woocommerce-Addresses .u-column2 {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}
