/* My Account page + shared AddressForm — inherits the sitewide --sw-primary. */

.sw-account-profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 32px;
}
.sw-account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sw-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex: 0 0 auto;
}
.sw-account-profile-card h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
}
.sw-account-profile-card p {
  margin: 0;
  font-size: 13.5px;
  color: #888;
}

.sw-account-section {
  margin-bottom: 32px;
}
.sw-account-section > h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 18px;
}

.sw-address-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
.sw-address-card-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.sw-address-card-default {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.1);
  color: var(--sw-primary);
}
.sw-address-card p {
  margin: 2px 0;
  font-size: 13.5px;
  color: #555;
}
.sw-address-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sw-address-card.is-default {
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 1px var(--sw-primary);
}

.sw-address-form {
  border: 1px dashed #ddd;
  border-radius: 10px;
  padding: 22px;
}
.sw-address-detect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--sw-primary);
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.06);
  color: var(--sw-primary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
}
.sw-address-detect-btn:hover:not(:disabled) {
  background: rgba(30, 58, 95, 0.12);
}
.sw-address-detect-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.sw-address-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.sw-address-form-grid input,
.sw-address-form-grid select {
  width: 100%;
  height: 44px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 13.5px;
  background: #fff;
  color: #222;
  box-sizing: border-box;
}
.sw-address-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #555;
}
.sw-address-form-required {
  color: #c0392b;
  margin-left: 2px;
}
.sw-address-form-default {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #555;
  margin-bottom: 16px;
}
.sw-address-form-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  .sw-address-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Account dashboard (sidebar + main) ---------- */
.sw-account-dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}

.sw-account-sidebar {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  /* Sticky, not fixed — it has no height/overflow of its own, so it never
     becomes a second scroll container: the page keeps exactly one
     scrollbar, driven by .sw-account-main's real content length. `top`
     clears the fixed header (--sw-header-height, set by Header.tsx /
     Home3TopHeader.tsx via ResizeObserver) plus a small gap, so it doesn't
     end up pinned underneath the header. align-self is redundant with the
     grid's own align-items:start but kept in case this class is ever reused
     outside that grid. */
  position: sticky;
  top: calc(var(--sw-header-height, 140px) + 20px);
  align-self: start;
}
.sw-account-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.sw-account-avatar-sm {
  width: 46px;
  height: 46px;
  font-size: 16px;
}
.sw-account-sidebar-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}
.sw-account-sidebar-email {
  margin: 2px 0 0;
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.sw-account-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-account-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sw-account-sidebar-link i {
  width: 16px;
  text-align: center;
  color: #aaa;
  transition: color 0.18s ease;
}
.sw-account-sidebar-link:hover {
  background: rgba(30, 58, 95, 0.08);
  color: var(--sw-primary);
  transform: translateX(2px);
}
.sw-account-sidebar-link:hover i {
  color: var(--sw-primary);
}
.sw-account-sidebar-link.active {
  background: rgba(30, 58, 95, 0.08);
  color: var(--sw-primary);
}
.sw-account-sidebar-link.active i {
  color: var(--sw-primary);
}
.sw-account-sidebar-logout {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  color: var(--sw-error, #c0392b);
}
.sw-account-sidebar-logout i {
  color: var(--sw-error, #c0392b);
}
.sw-account-sidebar-logout:hover {
  background: rgba(192, 57, 43, 0.06);
  color: var(--sw-error, #c0392b);
}

.sw-account-main {
  min-width: 0;
}
.sw-account-welcome-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 28px;
}
.sw-account-welcome-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.sw-account-welcome-card p {
  margin: 2px 0;
  font-size: 13.5px;
  color: #888;
}

.sw-account-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.sw-account-section-head h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.sw-account-section-head a {
  font-size: 13px;
  font-weight: 700;
  color: var(--sw-primary);
}

@media (max-width: 860px) {
  .sw-account-dashboard {
    grid-template-columns: 1fr;
  }
  .sw-account-sidebar {
    position: static;
  }
  .sw-account-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sw-account-sidebar-link {
    width: auto;
  }
}
