/**
 * Synergy My Account – Common styles
 * Loaded on My Account when logged in (and can be reused elsewhere).
 */

/* Dashboard row: keep each pill sized to content so XStore flex stretch does not skew alignment */
.woocommerce-account .MyAccount-dashboard-buttons,
.elementor-widget-woocommerce-my-account .MyAccount-dashboard-buttons {
  align-items: center;
}

/* Dashboard shortcuts — match Synergy gradient button styling */
.woocommerce-account .MyAccount-dashboard-buttons a.btn,
.elementor-widget-woocommerce-my-account .MyAccount-dashboard-buttons a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  align-self: center;
  gap: 0.5rem;
  box-sizing: border-box;
  min-height: 2.75rem;
  height: auto !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-align: center;
  white-space: nowrap;
  color: #fff !important;
  border: none !important;
  border-radius: 36px !important;
  box-shadow: none !important;
  background: var(
    --Gradient-Green-Gradient,
    linear-gradient(
      90deg,
      var(--Color-Brand-Secondary-Emerald, #0c9048) 0%,
      var(--Color-Brand-Secondary-Lime, #d6df2e) 100%
    )
  ) !important;
  transition: opacity 0.2s;
}

.woocommerce-account .MyAccount-dashboard-buttons a.btn:hover,
.elementor-widget-woocommerce-my-account
  .MyAccount-dashboard-buttons
  a.btn:hover {
  opacity: 0.9;
  color: #fff !important;
}

.woocommerce-account .MyAccount-dashboard-buttons a.btn .et-icon,
.elementor-widget-woocommerce-my-account
  .MyAccount-dashboard-buttons
  a.btn
  .et-icon {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  line-height: 0 !important;
}

.woocommerce-account .MyAccount-dashboard-buttons a.btn .et-icon::before,
.elementor-widget-woocommerce-my-account
  .MyAccount-dashboard-buttons
  a.btn
  .et-icon::before {
  line-height: 1;
  vertical-align: middle;
}

.woocommerce-account .MyAccount-dashboard-buttons a.btn span,
.elementor-widget-woocommerce-my-account
  .MyAccount-dashboard-buttons
  a.btn
  span {
  color: inherit;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
}

/* My Account inputs (edit account, addresses, etc.) */
.woocommerce-account .woocommerce-MyAccount-content input[type="text"],
.woocommerce-account .woocommerce-MyAccount-content input[type="email"],
.woocommerce-account .woocommerce-MyAccount-content input[type="password"],
.woocommerce-account .woocommerce-MyAccount-content input[type="tel"],
.woocommerce-account .woocommerce-MyAccount-content input[type="number"],
.woocommerce-account .woocommerce-MyAccount-content input[type="search"],
.woocommerce-account .woocommerce-MyAccount-content select,
.woocommerce-account .woocommerce-MyAccount-content textarea {
  border-radius: 8px;
  border: 1px solid #dfdfdf;
  background: #f5f5f5;
}

/* My Account submit buttons */
.woocommerce-account .woocommerce-MyAccount-content button[type="submit"],
.woocommerce-account .woocommerce-MyAccount-content input[type="submit"],
.woocommerce-account .woocommerce-MyAccount-content .button[type="submit"] {
  border-radius: 36px;
  border: none !important;
  background: var(
    --Gradient-Green-Gradient,
    linear-gradient(
      90deg,
      var(--Color-Brand-Secondary-Emerald, #0c9048) 0%,
      var(--Color-Brand-Secondary-Lime, #d6df2e) 100%
    )
  );
}

@media (min-width: 768px) {
  .woocommerce-account .woocommerce-MyAccount-content button[type="submit"],
  .woocommerce-account .woocommerce-MyAccount-content input[type="submit"],
  .woocommerce-account .woocommerce-MyAccount-content .button[type="submit"] {
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Edit account: center the submit row */
.woocommerce-account
  .woocommerce-MyAccount-content
  form.edit-account
  > p:last-of-type {
  text-align: center;
}

/* Single order view: card only around address body; titles stay outside */
.woocommerce-account
  .woocommerce-customer-details
  .woocommerce-column--billing-address
  > address,
.woocommerce-account
  .woocommerce-customer-details
  .woocommerce-column--shipping-address
  > address,
.woocommerce-account
  .woocommerce-customer-details:not(:has(.woocommerce-columns--addresses))
  > address {
  border-radius: 16px;
  border: 1px solid #d9d9d9;
  background: #f5f5f5;
  padding: 1rem 1.25rem;
  box-sizing: border-box;
  margin: 0;
  font-style: normal;
  font-family: "Noto Sans Thai", sans-serif;
}

.woocommerce-account .woocommerce-customer-details .woocommerce-column__title {
  margin-bottom: 14px;
  font-weight: 600;
}

@media (min-width: 992px) {
  .woocommerce-account
    .woocommerce-customer-details
    .woocommerce-column__title {
    font-size: 32px;
  }
}

.woocommerce-Addresses address {
  font-family: "Noto Sans Thai", sans-serif;
}

/* Edit Account: strip the default <fieldset> chrome (border / inset
 * padding / legend bevel) on EVERY fieldset inside the edit-account
 * form — covers Profile Picture, Password change, and any future
 * sections — so each section reads as a flat block with a heading. */
.woocommerce-account
  .woocommerce-MyAccount-content
  form.edit-account
  fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}

.woocommerce-account
  .woocommerce-MyAccount-content
  form.edit-account
  fieldset
  > legend {
  display: block;
  width: 100%;
  max-width: 100%;
  float: none;
  padding: 0;
  margin: 0 0 12px;
  color: #000;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
}

/*
 * Divider above "เปลี่ยนรหัสผ่าน" (Password change). Browsers render
 * <legend> as the fieldset's principal first box, so a ::before on
 * the <fieldset> paints UNDER the legend. Put the border on the
 * legend itself so the rule sits in its own row above the label.
 */
.woocommerce-account
  .woocommerce-MyAccount-content
  form.edit-account
  fieldset:not(:first-of-type) {
  margin-top: 24px;
  padding-top: 0;
}

.woocommerce-account
  .woocommerce-MyAccount-content
  form.edit-account
  fieldset:not(:first-of-type)
  > legend {
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid #e3e3e3;
}

/* ──────────────────────────────────────────────────────────────
 * Edit Account: Profile picture with overlay edit (pencil) icon
 * The <input type="file"> lives OUTSIDE the figure but is visually
 * hidden; a <label> styled as a small circle overlays the bottom
 * right of the preview image and opens the native file picker.
 * ────────────────────────────────────────────────────────────── */

.woocommerce-account .synergy-profile-pic {
  display: inline-block;
  position: relative;
}

.woocommerce-account .synergy-profile-pic__figure {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
  line-height: 0;
}

.woocommerce-account .synergy-profile-pic__img {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  background: #f5f5f5;
}

.woocommerce-account .synergy-profile-pic__edit {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(
    --Gradient-Green-Gradient,
    linear-gradient(
      90deg,
      var(--Color-Brand-Secondary-Emerald, #0c9048) 0%,
      var(--Color-Brand-Secondary-Lime, #d6df2e) 100%
    )
  );
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.woocommerce-account .synergy-profile-pic__edit:hover,
.woocommerce-account .synergy-profile-pic__edit:focus-visible {
  opacity: 0.92;
  transform: scale(1.05);
  outline: none;
}

.woocommerce-account .synergy-profile-pic__edit svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Visually hide the file input but keep it in the form/tab order. */
.woocommerce-account .synergy-profile-pic__input {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ──────────────────────────────────────────────────────────────
 * Edit Account: 2-column row (Gender | Age) and inline radio group.
 * ────────────────────────────────────────────────────────────── */
.woocommerce-account .synergy-form-row-grid {
  display: grid;
  gap: 16px;
}

.woocommerce-account .synergy-form-row-grid--two {
  grid-template-columns: 1fr 1fr;
}

.woocommerce-account .synergy-form-row-grid > .form-row {
  width: 100%;
  margin: 0;
  float: none;
}

.woocommerce-account .synergy-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.woocommerce-account .synergy-radio-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.woocommerce-account .synergy-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  line-height: 1.2;
}

.woocommerce-account .synergy-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0c9048;
  cursor: pointer;
  flex-shrink: 0;
}

.woocommerce-account .synergy-radio > span {
  font-size: 16px;
}

@media (max-width: 600px) {
  .woocommerce-account .synergy-form-row-grid--two {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────────────────────────
 * My Account → Addresses: each address card has the Edit button
 * rendered as a circular pencil icon pinned to the bottom-right
 * INSIDE the address container (not in the header row).
 * ────────────────────────────────────────────────────────────── */
.woocommerce-account .woocommerce-Address .woocommerce-Address-title.title {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

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

.woocommerce-account address.synergy-address-card {
  position: relative;
  display: block;
  border-radius: 16px;
  border: 1px solid #d9d9d9;
  background: #f5f5f5;
  padding: 1rem 1.25rem;
  padding-right: calc(1.25rem + 44px);
  padding-bottom: calc(1rem + 44px);
  box-sizing: border-box;
  margin: 0;
  font-style: normal;
  font-family: "Noto Sans Thai", sans-serif;
  line-height: 1.6;
}

.woocommerce-account address.synergy-address-card .synergy-address-card__body {
  display: block;
}

.woocommerce-account .synergy-address-card__edit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(
    --Gradient-Green-Gradient,
    linear-gradient(
      90deg,
      var(--Color-Brand-Secondary-Emerald, #0c9048) 0%,
      var(--Color-Brand-Secondary-Lime, #d6df2e) 100%
    )
  );
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  text-decoration: none !important;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.woocommerce-account .synergy-address-card__edit:hover,
.woocommerce-account .synergy-address-card__edit:focus-visible {
  opacity: 0.92;
  transform: scale(1.05);
  outline: none;
  color: #fff !important;
}

.woocommerce-account .synergy-address-card__edit svg {
  width: 16px;
  height: 16px;
  display: block;
}

.woocommerce-Address-title h2 {
  font-size: 32px;
  font-weight: 600;
}

.woocommerce-Addresses address {
  font-family: "Noto Sans Thai", sans-serif;
  padding: 20px;
  background-color: #f5f5f5;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  color: #000000;
}
