/* ============================================================
   Hira My Account — Stylesheet
   Theme: Hira Navy/Blue #2f6fed
   ============================================================ */

/* ── Elementor container reset ─────────────────────────────── */
.elementor-widget-hma-my-account .elementor-widget-container {
  overflow: visible !important;
  line-height: 1 !important;
}

/* ── Design tokens ─────────────────────────────────────────── */
.hma-launcher {
  --hma-accent:      #2f6fed;
  --hma-accent-dark: #1e5bc6;
  --hma-border:      #e6ebf1;
  --hma-text:        #14304f;
  --hma-muted:       #8a97a6;
  --hma-bg:          #ffffff;
  --hma-hover-bg:    #f4f8fc;

  display: inline-flex;
  position: relative;
}

/* ── Trigger button ────────────────────────────────────────── */
.hma-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  color: #3a4a5c;
  border: 1.5px solid #e6ebf1;
  border-radius: 999px;
  cursor: pointer;
  font-size: .875rem;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color .2s, background-color .2s, color .2s;
  position: relative;
  white-space: nowrap;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.hma-trigger:hover {
  border-color: #2f6fed;
}

.hma-trigger:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: 2px;
}

.hma-trigger--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.hma-trigger--avatar {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: #2f6fed;
  border-color: #2f6fed;
  color: #ffffff;
}

/* ── Avatar ────────────────────────────────────────────────── */
.hma-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2f6fed;
  color: #ffffff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ── Cart badge ────────────────────────────────────────────── */
.hma-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2f6fed;
  color: #ffffff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  text-align: center;
  line-height: 18px;
  font-weight: 700;
  pointer-events: none;
}

/* ── Drawer root ───────────────────────────────────────────── */
.hma-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}

.hma-drawer-root[aria-hidden="false"] {
  pointer-events: all;
}

/* ── Backdrop ──────────────────────────────────────────────── */
.hma-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .3s ease;
}

.hma-drawer-root[aria-hidden="false"] .hma-backdrop {
  opacity: 1;
}

/* ── Slide-out sheet ───────────────────────────────────────── */
.hma-sheet {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  max-width: 400px;
  width: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -8px 0 40px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.hma-drawer-root[aria-hidden="false"] .hma-sheet {
  transform: translateX(0);
}

/* ── Sheet header ──────────────────────────────────────────── */
.hma-sheet-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
  background: #f4f8fc;
  flex-shrink: 0;
}

.hma-sheet-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2f6fed;
  color: #ffffff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hma-sheet-header-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.hma-sheet-header-name {
  font-weight: 700;
  color: #14304f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hma-sheet-header-email {
  font-size: .78rem;
  color: #8a97a6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hma-sheet-header-text {
  flex: 1;
}

.hma-sheet-header-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #14304f;
}

.hma-sheet-header-sub {
  font-size: .82rem;
  color: #8a97a6;
  margin-top: 2px;
}

/* ── Close button ──────────────────────────────────────────── */
.hma-sheet-close {
  background: none;
  border: none;
  color: #9aa7b5;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background-color .15s;
  flex-shrink: 0;
}

.hma-sheet-close:hover {
  color: #3a4a5c;
  background: #eef2f7;
}

.hma-sheet-close:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: 2px;
}

/* ── Profile navigation ────────────────────────────────────── */
.hma-nav {
  display: flex;
  flex-direction: row;
  border-bottom: 2px solid #eef2f7;
  padding: 0 16px;
  flex-shrink: 0;
}

.hma-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: .78rem;
  color: #9aa7b5;
  font-family: inherit;
  transition: color .15s, border-bottom-color .15s;
}

.hma-nav-item.is-active {
  color: #2f6fed;
  border-bottom-color: #2f6fed;
}

.hma-nav-item:hover:not(.is-active) {
  color: #3a4a5c;
}

.hma-nav-item svg {
  opacity: .6;
  transition: opacity .15s;
}

.hma-nav-item.is-active svg {
  opacity: 1;
}

.hma-nav-item:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: -2px;
}

/* ── Profile container ─────────────────────────────────────── */
.hma-profile {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hma-panel {
  display: none;
  padding: 16px 20px;
}

.hma-panel.is-active {
  display: block;
}

/* ── Quick links ───────────────────────────────────────────── */
.hma-quick-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hma-quick-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #3a4a5c;
  transition: background .15s;
}

.hma-quick-link:hover {
  background: #f4f8fc;
}

.hma-quick-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef4fb;
  color: #2f6fed;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hma-quick-link-label {
  flex: 1;
  font-weight: 500;
  font-size: .875rem;
}

.hma-quick-link-arrow {
  color: #d3dce6;
}

.hma-logout-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 10px;
  color: #e05563;
  font-size: .875rem;
  text-decoration: none;
  border: 1px solid #f6dce0;
  border-radius: 8px;
  transition: background .15s;
}

.hma-logout-link:hover {
  background: #fdf3f4;
}

/* ── Orders list ───────────────────────────────────────────── */
.hma-orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hma-order-item {
  border-bottom: 1px solid #eef2f7;
}

.hma-order-link {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  padding: 10px 0;
  gap: 8px;
  text-decoration: none;
  align-items: center;
}

.hma-order-id {
  font-weight: 700;
  color: #14304f;
  font-size: .875rem;
}

.hma-order-date {
  font-size: .78rem;
  color: #8a97a6;
}

.hma-order-status {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #3a4a5c;
  text-align: center;
}

.hma-order-status.status-completed {
  background: #dcfce7;
  color: #166534;
}

.hma-order-status.status-processing {
  background: #dbeafe;
  color: #1e40af;
}

.hma-order-status.status-on-hold {
  background: #fef9c3;
  color: #92400e;
}

.hma-order-status.status-pending {
  background: #eef2f7;
  color: #3a4a5c;
}

.hma-order-total {
  font-weight: 700;
  text-align: right;
  color: #14304f;
  font-size: .875rem;
}

.hma-view-all-link {
  display: block;
  text-align: center;
  color: #2f6fed;
  margin-top: 12px;
  font-size: .875rem;
  text-decoration: none;
  padding: 6px;
}

.hma-view-all-link:hover {
  text-decoration: underline;
}

/* ── Settings list ─────────────────────────────────────────── */
.hma-settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hma-settings-list a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
  color: #3a4a5c;
  text-decoration: none;
  font-weight: 500;
  font-size: .875rem;
  transition: color .15s;
}

.hma-settings-list a:hover {
  color: #2f6fed;
}

/* ── Empty state ───────────────────────────────────────────── */
.hma-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 12px;
  text-align: center;
  color: #9aa7b5;
}

.hma-empty-state p {
  margin: 0;
  font-size: .875rem;
}

.hma-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: #2f6fed;
  color: #ffffff;
  border-radius: 999px;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  transition: background .2s;
}

.hma-cta-btn:hover {
  background: #1e5bc6;
}

/* ── Auth wrapper ──────────────────────────────────────────── */
.hma-auth {
  padding: 0 20px 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── Auth tabs ─────────────────────────────────────────────── */
.hma-tabs {
  display: flex;
  flex-direction: row;
  position: relative;
  border-bottom: 2px solid #e6ebf1;
  margin-bottom: 20px;
}

.hma-tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  font-weight: 600;
  color: #9aa7b5;
  cursor: pointer;
  font-size: .875rem;
  font-family: inherit;
  transition: color .15s;
  position: relative;
}

.hma-tab.is-active {
  color: #2f6fed;
}

.hma-tab:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: -2px;
}

.hma-tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: #2f6fed;
  width: 50%;
  left: 0;
  transition: left .25s ease;
}

.hma-tabs:has(.hma-tab[data-tab="signup"].is-active) .hma-tab-indicator {
  left: 50%;
}

/* ── Forms ─────────────────────────────────────────────────── */
.hma-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.hma-form.is-active {
  display: flex;
}

.hma-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hma-field label {
  font-size: .82rem;
  font-weight: 600;
  color: #3a4a5c;
}

.hma-field input {
  padding: 10px 14px;
  border: 1.5px solid #d3dce6;
  border-radius: 8px;
  font-size: .9rem;
  color: #14304f;
  background: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
}

.hma-field input:focus {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .1);
}

.hma-field--pass {
  position: relative;
}

.hma-field--pass input {
  padding-right: 40px;
}

.hma-toggle-pass {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: none;
  border: none;
  color: #9aa7b5;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color .15s;
}

.hma-toggle-pass:hover {
  color: #3a4a5c;
}

.hma-field-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hma-field-row--cols {
  align-items: stretch;
}

.hma-field-row--cols .hma-field {
  flex: 1;
}

.hma-checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
  color: #3a4a5c;
  cursor: pointer;
  line-height: 1.4;
}

.hma-checkbox-label input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #2f6fed;
}

.hma-checkbox-label a {
  color: #2f6fed;
  text-decoration: none;
}

.hma-checkbox-label a:hover {
  text-decoration: underline;
}

.hma-forgot-link {
  font-size: .78rem;
  color: #2f6fed;
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
  line-height: 1.4;
}

.hma-forgot-link:hover {
  text-decoration: underline;
}

/* ── Password strength ─────────────────────────────────────── */
.hma-strength {
  height: 4px;
  border-radius: 2px;
  background: #e6ebf1;
  margin-top: -8px;
  transition: background .3s;
}

.hma-strength[data-level="1"] {
  background: linear-gradient(to right, #ef4444 25%, #e6ebf1 25%);
}

.hma-strength[data-level="2"] {
  background: linear-gradient(to right, #f97316 50%, #e6ebf1 50%);
}

.hma-strength[data-level="3"] {
  background: linear-gradient(to right, #eab308 75%, #e6ebf1 75%);
}

.hma-strength[data-level="4"] {
  background: #22c55e;
}

/* ── Submit button ─────────────────────────────────────────── */
.hma-btn {
  width: 100%;
  padding: 12px;
  background: #2f6fed;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, opacity .2s;
  position: relative;
}

.hma-btn:hover:not(:disabled) {
  background: #1e5bc6;
}

.hma-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.hma-btn-text {
  transition: opacity .15s;
}

.hma-btn.is-loading .hma-btn-text {
  opacity: 0;
}

.hma-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: hma-spin .7s linear infinite;
  position: absolute;
}

.hma-btn.is-loading .hma-btn-spinner {
  display: block;
}

/* ── Messages ──────────────────────────────────────────────── */
.hma-msg {
  font-size: .82rem;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
  line-height: 1.4;
}

.hma-msg.is-error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

.hma-msg.is-success {
  display: block;
  background: #dcfce7;
  color: #166534;
}

/* ── Mobile bottom-sheet ───────────────────────────────────── */
@media (max-width: 768px) {
  .hma-sheet {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 90dvh;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .hma-drawer-root[aria-hidden="false"] .hma-sheet {
    transform: translateY(0);
  }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes hma-spin {
  to { transform: rotate(360deg); }
}

@keyframes hma-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hma-backdrop,
  .hma-sheet,
  .hma-trigger,
  .hma-tab-indicator,
  .hma-strength,
  .hma-btn {
    transition: none;
  }

  .hma-btn-spinner {
    animation: none;
    border-top-color: #ffffff;
  }

  @keyframes hma-spin {
    to { transform: none; }
  }
}
