/**
 * Location: /assets/css/header-account.css
 * Purpose:
 * - Professional compact header account dropdown styling.
 * - Keeps the account widget narrow, readable, responsive, and aligned with Suntech Mall branding.
 * - Uses a flat UI: no blur, no heavy shadow, no overlay shade effect.
 *
 * Related:
 * - /template-parts/header/account.php
 * - /assets/js/header-account.js
 * - /assets/css/header.css
 */

.stm-acct,
.stm-acct *{
  box-sizing: border-box;
}

.stm-acct{
  --stm-acct-navy: #071b34;
  --stm-acct-navy-soft: #102744;
  --stm-acct-orange: #ff6200;
  --stm-acct-orange-dark: #e65300;
  --stm-acct-text: #101828;
  --stm-acct-muted: #667085;
  --stm-acct-border: #d9e1ec;
  --stm-acct-soft: #fff4ed;
  --stm-acct-soft-blue: #f6f9fc;
  --stm-acct-green: #16a34a;
  --stm-acct-danger: #ef4444;

  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  line-height: 1;
}

@media (min-width: 1024px){
  .stm-header .stm-mb-actions > .stm-acct{
    margin-left: 20px;
  }
}

/* Header action button */
.stm-header .stm-acct__toggle,
.stm-acct__toggle{
  position: relative;
  appearance: none;
  -webkit-appearance: none;

  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;

  background: #fff !important;
  color: var(--stm-acct-navy) !important;
  border: 1px solid #d9dee8 !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font: inherit;
  line-height: 1 !important;
  cursor: pointer;

  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.stm-acct__toggle:hover,
.stm-acct.is-open .stm-acct__toggle{
  background: #fff7f1 !important;
  border-color: var(--stm-acct-orange) !important;
  color: var(--stm-acct-orange) !important;
  box-shadow: none !important;
}

.stm-acct__toggle:active{
  transform: translateY(1px) !important;
}

.stm-acct__toggle:focus-visible{
  border-color: var(--stm-acct-orange) !important;
  box-shadow: 0 0 0 2px rgba(255,98,0,.18) !important;
}

.stm-header .stm-acct__toggle .stm-mb-action__icon,
.stm-acct__toggle .stm-mb-action__icon,
.stm-acct__toggle .stm-acct__icon{
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
  display: block !important;
}

.stm-acct__toggle .stm-acct__icon{
  background: currentColor !important;
  -webkit-mask: var(--stm-mb-ico) center / 20px 20px no-repeat;
  mask: var(--stm-mb-ico) center / 20px 20px no-repeat;
}

/* Dropdown shell */
.stm-acct-card{
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 99999;

  width: 318px;
  max-width: calc(100vw - 24px);
  max-height: none;
  overflow: hidden;

  background: #fff;
  border: 1px solid var(--stm-acct-border);
  border-radius: 14px;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

.stm-acct-card::before{
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background: var(--stm-acct-orange);
}

.stm-acct-card[hidden]{
  display: none !important;
}

.stm-acct-card::-webkit-scrollbar{
  width: 7px;
}

.stm-acct-card::-webkit-scrollbar-thumb{
  background: #cbd5e1;
  border-radius: 999px;
}

/* Logged-in profile header */
.stm-acct-card__user{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px 10px;
  background: var(--stm-acct-soft-blue);
  border-bottom: 1px solid var(--stm-acct-border);
}

.stm-acct-avatar{
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cfd8e5;
  text-decoration: none;
}

.stm-acct-avatar__img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.stm-acct-avatar__initial{
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.stm-acct-avatar__placeholder{
  width: 23px;
  height: 23px;
  display: block;
  background: var(--stm-acct-navy);
  -webkit-mask: var(--stm-acct-placeholder) center / 23px 23px no-repeat;
  mask: var(--stm-acct-placeholder) center / 23px 23px no-repeat;
}

.stm-acct-umeta{
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stm-acct-name,
.stm-acct-email{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.stm-acct-name{
  color: var(--stm-acct-navy);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.stm-acct-name:hover{
  color: var(--stm-acct-orange);
}

.stm-acct-email{
  color: var(--stm-acct-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
}

.stm-acct-email:hover{
  color: var(--stm-acct-navy-soft);
}

.stm-acct-verified{
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  border: 1px solid #b7e4c7;
  color: #087f3f;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.stm-acct-verified__icon{
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--stm-acct-green);
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
}

/* Summary */
.stm-acct-summary{
  padding: 9px 12px 7px;
}

.stm-acct-section-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.stm-acct-section-head h3,
.stm-acct-quick h3{
  margin: 0;
  color: var(--stm-acct-navy);
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.stm-acct-section-head a{
  flex: 0 0 auto;
  color: var(--stm-acct-orange);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.stm-acct-section-head a:hover{
  color: var(--stm-acct-orange-dark);
}

.stm-acct-stats{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--stm-acct-border);
  border-radius: 10px;
  background: #fff;
}

.stm-acct-stat{
  min-width: 0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 4px;
  color: var(--stm-acct-muted);
  text-align: center;
  text-decoration: none;
  border-right: 1px solid var(--stm-acct-border);
  transition: background .15s ease, color .15s ease;
}

.stm-acct-stat:last-child{
  border-right: 0;
}

.stm-acct-stat:hover{
  background: #fff7f1;
}

.stm-acct-stat__ico{
  display: none !important;
}

.stm-acct-stat__label{
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--stm-acct-muted);
  font-size: 10.2px;
  font-weight: 650;
  line-height: 1.1;
}

.stm-acct-stat strong{
  color: var(--stm-acct-navy);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

/* Quick access */
.stm-acct-quick{
  padding: 5px 12px 8px;
}

.stm-acct-quick h3{
  margin-bottom: 6px;
}

.stm-acct-quick__grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 1px;
}

.stm-acct-quick__link{
  min-width: 0;
  min-height: 29px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  color: #334155;
  text-decoration: none;
  font-size: 12.3px;
  font-weight: 650;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}

.stm-acct-quick__link:hover{
  color: var(--stm-acct-navy);
  background: #f6f9fc;
}

.stm-acct-quick__link:hover span:nth-child(2){
  color: var(--stm-acct-navy);
  font-weight: 800;
}

.stm-acct-quick__link span:nth-child(2){
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stm-acct-quick__ico{
  width: 16px;
  height: 16px;
  display: block;
  background: #475467;
  -webkit-mask: var(--stm-acct-ico) center / 16px 16px no-repeat;
  mask: var(--stm-acct-ico) center / 16px 16px no-repeat;
  transition: background .15s ease;
}

.stm-acct-quick__link:hover .stm-acct-quick__ico{
  background: var(--stm-acct-orange);
}

.stm-acct-quick__link i{
  color: #98a2b3;
  font-style: normal;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
}

/* Support CTA */
.stm-acct-help{
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 106px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--stm-acct-border);
  background: var(--stm-acct-soft-blue);
}

.stm-acct-help__ico{
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 10px;
  background-color: #fff;
  background-image: var(--stm-acct-ico);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 19px 19px;
  border: 1px solid var(--stm-acct-border);
}

.stm-acct-help__txt{
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stm-acct-help__txt strong{
  color: var(--stm-acct-navy);
  font-size: 12.8px;
  font-weight: 850;
  line-height: 1.1;
}

.stm-acct-help__txt span{
  color: var(--stm-acct-muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
}

.stm-acct-help__btn{
  min-height: 30px;
  width: 106px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--stm-acct-orange);
  border-radius: 999px;
  color: #fff;
  background: var(--stm-acct-orange);
  font-size: 10.2px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background .15s ease, border-color .15s ease;
}

.stm-acct-help__btn:hover{
  background: var(--stm-acct-orange-dark);
  border-color: var(--stm-acct-orange-dark);
  color: #fff;
}

/* Guest dropdown */
.stm-acct-card--guest{
  width: 310px;
  border-radius: 14px;
}

.stm-acct-guest{
  padding: 15px 14px 14px;
}

.stm-acct-guest__t{
  color: var(--stm-acct-navy);
  text-align: center;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
}

.stm-acct-guest__p{
  margin-top: 5px;
  color: var(--stm-acct-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.stm-acct-form{
  margin-top: 13px;
}

.stm-acct-lbl{
  display: block;
  margin: 10px 0 6px;
  color: var(--stm-acct-navy);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.stm-acct-in{
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--stm-acct-border);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--stm-acct-navy);
  font-size: 13px;
  box-shadow: none !important;
}

.stm-acct-in:focus{
  border-color: var(--stm-acct-orange);
  box-shadow: 0 0 0 2px rgba(255,98,0,.14) !important;
}

.stm-acct-show{
  margin: 10px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.stm-acct-card button,
.stm-acct-card input[type="submit"],
.stm-acct-card .button,
.stm-acct-card .woocommerce-button{
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--stm-acct-orange) !important;
  border-radius: 10px;
  background: var(--stm-acct-orange) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none !important;
}

.stm-acct-card button:hover,
.stm-acct-card input[type="submit"]:hover,
.stm-acct-card .button:hover,
.stm-acct-card .woocommerce-button:hover{
  background: var(--stm-acct-orange-dark) !important;
  border-color: var(--stm-acct-orange-dark) !important;
}

.stm-acct-card button:focus-visible,
.stm-acct-card input[type="submit"]:focus-visible{
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,98,0,.16) !important;
}

.stm-acct-login{
  width: 100%;
}

.stm-acct-guest-links{
  margin-top: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #0a58ca;
  font-size: 12.5px;
  font-weight: 750;
}

.stm-acct-guest-links a{
  color: #0a58ca;
  text-decoration: none;
}

.stm-acct-guest-links a:hover{
  text-decoration: underline;
}

/* Tablet/mobile: compact viewport-safe placement. */
@media (max-width: 1023px){
  .stm-acct-card{
    position: fixed;
    top: 86px;
    left: 50%;
    right: auto;
    width: min(318px, 94vw);
    max-width: 94vw;
    max-height: calc(100dvh - 96px);
    overflow: auto;
    transform: translateX(-50%);
    border-radius: 14px;
  }
}

@media (max-width: 767px){
  .stm-header .stm-mb-actions > .stm-acct{
    margin-left: 0;
  }
}

@media (max-width: 560px){
  .stm-acct-card{
    top: 78px;
    width: min(318px, 94vw);
    max-height: calc(100dvh - 86px);
  }

  .stm-acct-card__user{
    gap: 10px;
    padding: 11px 12px 10px;
  }

  .stm-acct-avatar{
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .stm-acct-name{
    font-size: 14.5px;
  }

  .stm-acct-email{
    font-size: 11px;
  }

  .stm-acct-summary,
  .stm-acct-quick{
    padding-left: 11px;
    padding-right: 11px;
  }

  .stm-acct-section-head h3,
  .stm-acct-quick h3{
    font-size: 13.2px;
  }

  .stm-acct-section-head a{
    font-size: 10.8px;
  }

  .stm-acct-stat{
    min-height: 41px;
    padding: 5px 3px;
  }

  .stm-acct-stat__label{
    font-size: 9.8px;
  }

  .stm-acct-stat strong{
    font-size: 15px;
  }

  .stm-acct-quick__grid{
    column-gap: 7px;
    row-gap: 1px;
  }

  .stm-acct-quick__link{
    grid-template-columns: 18px minmax(0, 1fr) auto;
    min-height: 30px;
    gap: 6px;
    padding: 4px 4px;
    font-size: 12px;
  }

  .stm-acct-quick__ico{
    width: 15px;
    height: 15px;
    -webkit-mask-size: 15px 15px;
    mask-size: 15px 15px;
  }

  .stm-acct-help{
    grid-template-columns: 28px minmax(0, 1fr) 98px;
    gap: 7px;
    padding: 8px 11px;
  }

  .stm-acct-help__ico{
    width: 28px;
    height: 28px;
    background-size: 18px 18px;
  }

  .stm-acct-help__txt span{
    display: none;
  }

  .stm-acct-help__btn{
    width: 98px;
    min-height: 29px;
    padding: 0 7px;
    font-size: 10px;
  }
}

@media (max-width: 380px){
  .stm-acct-card{
    width: 96vw;
    max-width: 96vw;
  }

  .stm-acct-avatar{
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .stm-acct-name{
    font-size: 14px;
  }

  .stm-acct-verified{
    padding: 4px 7px;
    font-size: 10px;
  }
}

/* Tablet/mobile action-size sync */
@media (max-width: 1023px){
  .stm-header .stm-mb-actions > .stm-acct{
    margin-left: 0 !important;
    flex: 0 0 var(--stm-header-action-size-responsive, 38px) !important;
  }

  .stm-header .stm-acct__toggle,
  .stm-acct__toggle{
    width: var(--stm-header-action-size-responsive, 38px) !important;
    min-width: var(--stm-header-action-size-responsive, 38px) !important;
    max-width: var(--stm-header-action-size-responsive, 38px) !important;
    height: var(--stm-header-action-size-responsive, 38px) !important;
    min-height: var(--stm-header-action-size-responsive, 38px) !important;
    padding: 0 !important;
    border-radius: 10px !important;
    flex: 0 0 var(--stm-header-action-size-responsive, 38px) !important;
  }

  .stm-header .stm-acct__toggle .stm-mb-action__icon,
  .stm-acct__toggle .stm-mb-action__icon,
  .stm-acct__toggle .stm-acct__icon{
    width: var(--stm-header-action-icon-responsive, 18px) !important;
    height: var(--stm-header-action-icon-responsive, 18px) !important;
    flex: 0 0 var(--stm-header-action-icon-responsive, 18px) !important;
    -webkit-mask-size: var(--stm-header-action-icon-responsive, 18px) var(--stm-header-action-icon-responsive, 18px) !important;
    mask-size: var(--stm-header-action-icon-responsive, 18px) var(--stm-header-action-icon-responsive, 18px) !important;
  }
}
