/**
 * Abakan Online — страница «Профиль и избранное».
 * Все правила изолированы корнем .ao-user-profile.
 * Разметка и стили .ao-company-card остаются общими с каталогом.
 */

.ao-user-profile {
  --ao-accent: #2757d7;
  --ao-accent-dark: #1e45b4;
  --ao-accent-soft: #eaf0ff;
  --ao-border: #e3e8f0;
  --ao-text: #182033;
  --ao-muted: #687086;
  --ao-page: #f3f5f9;
  --ao-surface: #ffffff;
  width: 100%;
  padding: 28px 0 56px;
  color: var(--ao-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}


.ao-user-profile *,
.ao-user-profile *::before,
.ao-user-profile *::after {
  box-sizing: border-box;
}

.ao-user-profile__intro {
  margin-bottom: 28px;
}

.ao-user-profile__intro h1 {
  margin: 0 0 10px;
  color: var(--ao-text);
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.ao-user-profile__intro p {
  max-width: 760px;
  margin: 0;
  color: var(--ao-muted);
  font-size: 16px;
  line-height: 1.55;
}

.ao-user-profile__navigation,
.ao-user-profile__reviews-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-block: 1rem 1.5rem;
}

.ao-user-profile__navigation a,
.ao-user-profile__reviews-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  background: #fff;
  color: #26354a;
  font-weight: 700;
  text-decoration: none;
}

.ao-user-profile__navigation a:hover,
.ao-user-profile__navigation a:focus-visible,
.ao-user-profile__reviews-nav a:hover,
.ao-user-profile__reviews-nav a:focus-visible {
  border-color: #2563eb;
  color: #1d4ed8;
}

.ao-user-profile__section {
  scroll-margin-top: 6rem;
  margin-top: 2rem;
}

.ao-user-profile__section textarea {
  display: block;
  width: 100%;
  min-height: 7rem;
  margin-block: 0.5rem;
}

.ao-user-profile__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
  gap: 28px;
  align-items: start;
}

.ao-user-profile__main {
  min-width: 0;
}

.ao-user-profile__favorites {
  min-width: 0;
}

.ao-user-profile__favorites.ao-catalog-filter {
  /* Favorites reuse catalog card styles, but they are not a filter toolbar.
     The mobile catalog rule sets display:grid on .ao-catalog-filter, which
     otherwise splits the favorites heading and list into separate columns. */
  display: block;
  grid-template-columns: none;
  margin: 0;
}

.ao-user-profile__section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ao-user-profile__section-heading h2 {
  margin: 0;
  color: var(--ao-text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.ao-user-profile__count {
  display: inline-flex;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ao-accent-soft);
  color: var(--ao-accent);
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.ao-user-profile__count[hidden],
.ao-user-profile__loading[hidden],
.ao-user-profile__empty[hidden],
.ao-user-profile__favorites-list[hidden],
.ao-user-profile__favorites-note[hidden] {
  display: none !important;
}

.ao-user-profile__loading {
  margin: 0;
  padding: 22px 0;
  color: var(--ao-muted);
  font-size: 14px;
}

.ao-user-profile__loading.is-error {
  color: #a33b47;
}

.ao-user-profile__favorites-list {
  display: grid;
  gap: 12px;
}

.ao-user-profile__empty {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--ao-border);
  border-bottom: 1px solid var(--ao-border);
}

.ao-user-profile__empty > .icon-heart {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--ao-accent-soft);
  color: var(--ao-accent);
  font-size: 23px;
}

.ao-user-profile__empty h3 {
  margin: 0 0 5px;
  color: var(--ao-text);
  font-size: 18px;
  line-height: 1.25;
}

.ao-user-profile__empty p,
.ao-user-profile__favorites-note {
  margin: 0;
  color: var(--ao-muted);
  font-size: 14px;
  line-height: 1.5;
}

.ao-user-profile__favorites-note {
  margin-top: 14px;
}

.ao-user-profile__account {
  position: sticky;
  top: 112px;
  min-width: 0;
}

.ao-user-profile__account-inner {
  padding: 26px;
  border: 1px solid var(--ao-border);
  border-radius: 18px;
  background: var(--ao-surface);
  box-shadow: 0 14px 34px rgba(31, 48, 86, 0.07);
}

.ao-user-profile__account-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--ao-accent-soft);
  color: var(--ao-accent);
  font-size: 24px;
}

.ao-user-profile__account h2 {
  margin: 0 0 8px;
  color: var(--ao-text);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.ao-user-profile__account > .ao-user-profile__account-inner > p:not(.ao-user-profile__eyebrow):not(.ao-user-profile__privacy) {
  margin: 0 0 22px;
  color: var(--ao-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ao-user-profile__eyebrow {
  margin: 0 0 6px;
  color: var(--ao-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ao-user-profile__native-login form,
.ao-user-profile__native-login fieldset {
  display: grid;
  gap: 16px;
}

.ao-user-profile__native-login fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ao-user-profile__native-login .control-group,
.ao-user-profile__native-login .control-label,
.ao-user-profile__native-login .controls {
  margin: 0;
}

.ao-user-profile__native-login .control-group {
  display: grid;
  gap: 7px;
}

.ao-user-profile__native-login label {
  margin: 0;
  color: var(--ao-text);
  font-size: 14px;
  font-weight: 650;
}

.ao-user-profile__native-login input[type="text"],
.ao-user-profile__native-login input[type="email"],
.ao-user-profile__native-login input[type="password"] {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border: 1px solid #cfd7e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ao-text);
  padding: 10px 13px;
  font: inherit;
  box-shadow: none;
}

.ao-user-profile__native-login input:focus {
  border-color: var(--ao-accent);
  outline: 3px solid rgba(39, 87, 215, 0.14);
  outline-offset: 0;
}

.ao-user-profile__native-login .input-group {
  display: flex;
  flex-wrap: nowrap;
}

.ao-user-profile__native-login .input-group input {
  width: 1%;
  min-width: 0;
  flex: 1 1 auto;
}

.ao-user-profile__native-login .form-check,
.ao-user-profile__native-login .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ao-user-profile__native-login input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ao-accent);
}

.ao-user-profile__native-login .btn-primary {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ao-accent);
  border-radius: 12px;
  background: var(--ao-accent);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
}

.ao-user-profile__native-login .com-users-login__options,
.ao-user-profile__native-login ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.ao-user-profile__native-login a {
  color: var(--ao-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.ao-user-profile__primary-button,
.ao-user-profile__secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
}

.ao-user-profile__primary-button {
  border: 1px solid var(--ao-accent);
  background: var(--ao-accent);
  color: #fff !important;
}

.ao-user-profile__primary-button:hover,
.ao-user-profile__primary-button:focus-visible {
  border-color: var(--ao-accent-dark);
  background: var(--ao-accent-dark);
  color: #fff !important;
}

.ao-user-profile__secondary-button {
  border: 1px solid var(--ao-border);
  background: #fff;
  color: var(--ao-text);
}

.ao-user-profile__secondary-button:hover,
.ao-user-profile__secondary-button:focus-visible {
  border-color: #cbd5e6;
  background: #f7f9fd;
}

.ao-user-profile__primary-button:focus-visible,
.ao-user-profile__secondary-button:focus-visible,
.ao-user-profile__account-links a:focus-visible {
  outline: 3px solid rgba(39, 87, 215, 0.18);
  outline-offset: 2px;
}

.ao-user-profile__account-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}

.ao-user-profile__account-links a {
  color: var(--ao-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.ao-user-profile__account-links a:hover {
  color: var(--ao-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ao-user-profile__privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--ao-border);
  color: var(--ao-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ao-user-profile__privacy .icon-lock {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--ao-accent);
}

.ao-user-profile__details {
  display: grid;
  gap: 0;
  margin: 22px 0;
  border-top: 1px solid var(--ao-border);
}

.ao-user-profile__details > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ao-border);
}

.ao-user-profile__details dt,
.ao-user-profile__details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.ao-user-profile__details dt {
  color: var(--ao-muted);
  font-weight: 500;
}

.ao-user-profile__details dd {
  color: var(--ao-text);
  font-weight: 650;
}

.ao-user-profile__logout-form {
  margin-top: 10px;
}

@media (max-width: 991.98px) {
  .ao-user-profile {
    padding: 20px 0 42px;
  }

  .ao-user-profile__intro {
    margin-bottom: 22px;
  }

  .ao-user-profile__intro h1 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .ao-user-profile__intro p {
    font-size: 14px;
  }

  .ao-user-profile__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .ao-user-profile__account {
    position: static;
  }

  .ao-user-profile__section-heading h2 {
    font-size: 21px;
  }

  .ao-user-profile__account-inner {
    padding: 22px;
    border-radius: 16px;
  }
}

@media (max-width: 479.98px) {
  .ao-user-profile__account-inner {
    padding: 18px;
  }

  .ao-user-profile__empty {
    gap: 12px;
  }

  .ao-user-profile__empty > .icon-heart {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ao-user-profile *,
  .ao-user-profile *::before,
  .ao-user-profile *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* ==========================================================================
   Profile UX v2 — штатные Bootstrap tabs + единая карточная система.
   Вкладки используют глобальные .ao-home-tabs*; здесь только scope профиля.
   ========================================================================== */

.ao-user-profile--authorized {
  max-width: 100%;
}

.ao-user-profile__tabs {
  margin-top: 8px;
}

.ao-user-profile__tabs > .ao-home-tabs__head {
  margin-bottom: 24px;
}

.ao-user-profile__tabs > .ao-home-tabs__content {
  min-width: 0;
}

.ao-user-profile__personal {
  max-width: 760px;
  padding: 26px;
  border: 1px solid var(--ao-border);
  border-radius: 18px;
  background: var(--ao-surface);
}

.ao-user-profile__personal-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ao-user-profile__personal-header .ao-user-profile__account-icon {
  margin: 0;
}

.ao-user-profile__personal h2 {
  margin: 0;
  color: var(--ao-text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.ao-user-profile__personal .ao-user-profile__details {
  max-width: 620px;
  margin-bottom: 14px;
}

.ao-user-profile__text-actions,
.ao-user-profile__review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.ao-user-profile__text-actions a,
.ao-user-profile__review-actions a,
.ao-user-profile__text-action {
  border: 0;
  background: transparent;
  color: var(--ao-accent);
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.ao-user-profile__text-actions a:hover,
.ao-user-profile__review-actions a:hover,
.ao-user-profile__text-action:hover {
  color: var(--ao-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ao-user-profile__text-action--logout {
  color: var(--ao-muted);
}

.ao-user-profile__text-action--danger {
  color: #b42318;
}

.ao-user-profile__logout-form,
.ao-user-profile__review-actions form {
  margin: 0;
}

/* Избранное: 4 в ряд на desktop, как подборки главной. */
.ao-user-profile__favorites {
  margin: 0;
}

.ao-user-profile__favorites-list.ao-catalog-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ao-user-profile__favorites-list .blog-item {
  min-width: 0;
  height: 100%;
  /* Joomla .blog-item adds padding that narrows cards in the profile grid. */
  padding: 0;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card,
.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card--no-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__media {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 164px;
  min-height: 164px;
  border-radius: 0;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__image {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover !important;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__main {
  grid-column: 1;
  grid-row: 2;
  padding: 14px 14px 8px;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.2;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__aside {
  grid-column: 1;
  grid-row: 3;
  justify-content: flex-start;
  padding: 0 14px 14px !important;
}

.ao-user-profile__favorites-list.ao-catalog-results .ao-company-card__favorite {
  top: 10px;
  right: 10px;
}

/* Мои компании: одна полноценная карточка в строку. */
.ao-user-profile__companies-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card,
.ao-user-profile__companies-list.ao-catalog-results .ao-company-card--no-aside {
  grid-template-columns: 150px minmax(0, 1fr) auto !important;
  grid-template-rows: auto;
  min-height: 144px;
  padding: 10px;
  cursor: default;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card:hover,
.ao-user-profile__companies-list.ao-catalog-results .ao-company-card:focus-within {
  transform: none;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__media {
  grid-column: 1;
  grid-row: 1;
  width: 150px;
  height: 124px;
  min-height: 124px;
  align-self: center;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__main {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  padding: 2px 14px;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__aside {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-content: flex-end;
  min-width: 150px;
  padding: 0 8px !important;
}

.ao-user-profile__company-category {
  margin-bottom: 6px;
  color: var(--ao-muted);
  font-size: 13px;
  font-weight: 600;
}

.ao-user-profile__company-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--ao-muted);
  font-size: 13px;
  font-weight: 600;
}

.ao-user-profile__company-status > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.ao-user-profile__company-status.is-published {
  color: #18864b;
}

.ao-user-profile__company-status.is-published > span {
  background: #2fb35e;
}

.ao-user-profile__company-status.is-moderation {
  color: #9a6700;
}

.ao-user-profile__company-status.is-moderation > span {
  background: #e9a100;
}

.ao-user-profile__company-rating {
  margin-top: 6px;
  color: var(--ao-muted);
  font-size: 13px;
}

.ao-user-profile__company-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ao-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ao-accent);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.ao-user-profile__company-action:hover {
  border-color: #c7d3ee;
  background: #f8faff;
  color: var(--ao-accent-dark);
}

.ao-user-profile__company-note {
  max-width: 180px;
  color: var(--ao-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

/* Отзывы: второй уровень — тот же Bootstrap Tab / те же .ao-home-tabs*. */
.ao-user-profile__reviews-tabs {
  margin-top: 4px;
}

.ao-user-profile__reviews-tabs > .ao-home-tabs__head {
  margin-bottom: 18px;
}

.ao-user-profile__reviews-list {
  display: grid;
  gap: 12px;
}

.ao-user-profile__review-card {
  padding: 18px;
  border: 1px solid var(--ao-border);
  border-radius: 14px;
  background: #fff;
}

.ao-user-profile__review-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ao-user-profile__review-card h3 {
  margin: 0;
  color: var(--ao-text);
  font-size: 18px;
  line-height: 1.3;
}

.ao-user-profile__review-rating {
  flex: 0 0 auto;
  color: #b56a00;
  font-size: 14px;
  font-weight: 700;
}

.ao-user-profile__review-meta {
  margin: 5px 0 0;
  color: var(--ao-muted);
  font-size: 13px;
}

.ao-user-profile__review-text {
  margin: 14px 0;
  color: var(--ao-text);
  font-size: 14px;
  line-height: 1.55;
}

.ao-user-profile__official-reply {
  margin: 14px 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--ao-accent-soft);
  color: var(--ao-text);
  font-size: 13px;
}

.ao-user-profile__official-reply p {
  margin: 5px 0 0;
}

.ao-user-profile__reply-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ao-user-profile__reply-form label {
  display: grid;
  gap: 7px;
  color: var(--ao-text);
  font-size: 13px;
  font-weight: 650;
}

.ao-user-profile__reply-form textarea {
  width: 100%;
  min-height: 96px;
  margin: 0;
  border: 1px solid #cfd7e6;
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}

.ao-user-profile__reply-submit {
  justify-self: start;
  min-height: 40px;
  border: 1px solid var(--ao-accent);
  border-radius: 10px;
  background: var(--ao-accent);
  color: #fff;
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ao-user-profile__empty--compact {
  padding-block: 18px;
}

@media (max-width: 1199.98px) {
  .ao-user-profile__favorites-list.ao-catalog-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ao-user-profile__tabs > .ao-home-tabs__head,
  .ao-user-profile__reviews-tabs > .ao-home-tabs__head {
    overflow: hidden;
  }

  .ao-user-profile__tabs .ao-home-tabs__nav,
  .ao-user-profile__reviews-tabs .ao-home-tabs__nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .ao-user-profile__tabs .ao-home-tabs__nav::-webkit-scrollbar,
  .ao-user-profile__reviews-tabs .ao-home-tabs__nav::-webkit-scrollbar {
    display: none;
  }

  .ao-user-profile__tabs .ao-home-tabs__tab,
  .ao-user-profile__reviews-tabs .ao-home-tabs__tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ao-user-profile__personal {
    padding: 20px;
  }

  .ao-user-profile__favorites-list.ao-catalog-results {
    display: flex;
    gap: 12px;
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .ao-user-profile__favorites-list.ao-catalog-results::-webkit-scrollbar {
    display: none;
  }

  .ao-user-profile__favorites-list .blog-item {
    /* Reveal more of the next favorite card on phones. */
    flex: 0 0 min(73vw, 290px);
    scroll-snap-align: start;
  }

  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card,
  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card--no-aside {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card__media {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 104px;
    height: 104px;
    min-height: 104px;
  }

  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card__main {
    grid-column: 2;
    grid-row: 1;
    padding: 2px 6px 6px 10px;
  }

  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card__aside {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 6px 2px 10px !important;
  }

  .ao-user-profile__company-note {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 479.98px) {
  .ao-user-profile__personal {
    padding: 18px;
  }

  .ao-user-profile__personal h2 {
    font-size: 22px;
  }

  .ao-user-profile__review-card {
    padding: 15px;
  }
}

.ao-user-profile__empty > [class^="icon-"]:not(.icon-heart),
.ao-user-profile__empty > [class*=" icon-"]:not(.icon-heart) {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--ao-accent-soft);
  color: var(--ao-accent);
  font-size: 21px;
}
\n\n/* ==========================================================================
   Profile UX v2.1 — polishing pass.
   Main tabs reuse the exact .ao-home-tabs__tab styling from home-organizations.css.
   ========================================================================== */

/* Profile uses the common tab buttons but not the large home-module shell. */
.ao-user-profile__tabs.ao-home-tabs {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ao-user-profile__tabs > .ao-home-tabs__head {
  margin-bottom: 24px;
}

/* Companies: 2 cards per row on desktop. */
.ao-user-profile__companies-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card,
.ao-user-profile__companies-list.ao-catalog-results .ao-company-card--no-aside {
  grid-template-columns: 120px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 150px;
  padding: 10px;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__media {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 120px;
  height: 120px;
  min-height: 120px;
  align-self: start;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__main {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  padding: 4px 10px 4px 14px;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__aside {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  align-self: end;
  justify-content: flex-start;
  padding: 6px 10px 2px 14px !important;
}

/* Address must always occupy its own row inside owner cards. */
.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__address {
  display: flex !important;
  width: 100%;
  align-items: flex-start;
  gap: 7px;
  margin: 3px 0 0;
  line-height: 1.35;
}

.ao-user-profile__companies-list.ao-catalog-results .ao-company-card__address > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ao-user-profile__companies-list .ao-user-profile__company-status {
  display: flex;
  width: fit-content;
  margin-bottom: 3px;
}

.ao-user-profile__companies-list .ao-user-profile__company-note {
  max-width: none;
  text-align: left;
}

/* Reviews: visually this is a compact mode switch, not a second tab row. */
.ao-user-profile__reviews-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 18px;
}

.ao-user-profile__reviews-switch-label {
  color: var(--ao-muted);
  font-size: 13px;
  font-weight: 500;
}

.ao-user-profile__reviews-switch-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ao-border);
  border-radius: 10px;
  background: #f7f9fd;
}

.ao-user-profile__reviews-switch-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ao-muted);
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}

.ao-user-profile__reviews-switch-button:hover,
.ao-user-profile__reviews-switch-button:focus-visible {
  color: var(--ao-text);
}

.ao-user-profile__reviews-switch-button:focus-visible {
  outline: 3px solid rgba(39, 87, 215, .14);
  outline-offset: 2px;
}

.ao-user-profile__reviews-switch-button.active {
  background: #fff;
  color: var(--ao-text);
  box-shadow: 0 1px 3px rgba(31, 48, 86, .1);
}

.ao-user-profile__reviews-content {
  min-width: 0;
}

@media (max-width: 1199.98px) {
  .ao-user-profile__companies-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .ao-user-profile__tabs.ao-home-tabs {
    margin-top: 0;
  }

  .ao-user-profile__reviews-switch {
    align-items: flex-start;
  }

  .ao-user-profile__reviews-switch-label {
    width: 100%;
  }

  .ao-user-profile__reviews-switch-control {
    max-width: 100%;
    overflow-x: auto;
  }

  .ao-user-profile__reviews-switch-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card,
  .ao-user-profile__companies-list.ao-catalog-results .ao-company-card--no-aside {
    grid-template-columns: 104px minmax(0, 1fr) !important;
  }
}


/* ==========================================================================\n   Profile UX v2.3 — isolate profile tab panels from home-module card layout.\n   The buttons still reuse .ao-home-tabs__tab, but profile content must not\n   inherit .ao-home-tabs__panel rules intended for Popular/New on homepage.\n   ========================================================================== */
.ao-user-profile__tab-content,
.ao-user-profile__tab-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.ao-user-profile__tab-panel {
  overflow: visible;
}

@media (max-width: 767.98px) {
  .ao-user-profile__tab-content,
  .ao-user-profile__tab-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* 2026-10-12 — «Мои события»: the SAME .ao-event-card used in the public afisha.
   Only owner status and two-column placement are scoped to the profile. */
.ao-user-profile__events-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ao-user-profile__events-list .ao-event-card {
  min-width: 0;
  height: 100%;
}

.ao-user-profile__events-list .ao-event-card__link {
  /* The image column follows the actual card height, not a fixed thumbnail. */
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 210px;
  height: 100%;
}

/* Only in "My events": photos occupy the entire left side, edge to edge.
   No fixed image height or aspect-ratio: content may make a card taller. */
.ao-user-profile__events-list .ao-event-card__media {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  aspect-ratio: auto;
  overflow: hidden;
}

.ao-user-profile__events-list .ao-event-card__media-link {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.ao-user-profile__events-list .ao-event-card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.ao-user-profile__events-list .ao-event-card__body {
  padding: 12px 14px;
}

.ao-user-profile__events-list .ao-event-card__title {
  overflow-wrap: anywhere;
}

.ao-user-profile__events-list .ao-event-card__date {
  margin-top: 7px;
  font-size: 13px;
}

.ao-user-profile__events-list .ao-user-profile__company-status {
  margin: 7px 0 0;
}

.ao-user-profile__events-list .ao-event-card__meta {
  margin-top: 2px;
  padding-top: 7px;
}

.ao-user-profile__events-list .ao-user-profile__event-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}

.ao-user-profile__events-list .ao-user-profile__event-unavailable {
  color: var(--ao-muted);
  font-size: 12px;
  line-height: 1.35;
}

.ao-user-profile__events-list .ao-event-card__placeholder {
  display: grid;
  width: 100%;
  min-height: 100%;
  place-items: center;
  color: var(--ao-muted);
  font-size: 13px;
  text-decoration: underline;
  background: #f7f9fc;
}

.ao-user-profile__events .ao-user-profile__event-add {
  margin-top: 14px;
}

@media (max-width: 1199.98px) {
  .ao-user-profile__events-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .ao-user-profile__events-list .ao-event-card__link {
    grid-template-columns: 116px minmax(0, 1fr);
    min-height: 150px;
  }

  /* On phones the image also fills the card's full dynamic height. */
  .ao-user-profile__events-list .ao-event-card__media {
    width: 100%;
    height: auto;
    align-self: stretch;
  }

  .ao-user-profile__events-list .ao-event-card__media img {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .ao-user-profile__events-list .ao-event-card__body {
    padding: 10px 12px;
  }
}


/* Favorites reuse the event card in the existing four-column favorites grid. */
.ao-user-profile__favorites-list .ao-event-card__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 164px 1fr;
    min-height: 0;
}
.ao-user-profile__favorites-list .ao-event-card__media { height: 164px; }
.ao-user-profile__favorites-list .ao-event-card__media img {
    height: 164px;
    min-height: 0;
}
.ao-user-profile__favorites-list .ao-event-card .ao-event-card__body {
    padding: 14px;
}
.ao-user-profile__favorites-list .ao-event-card__title { font-size: 17px; }
.ao-user-profile__favorites-list .ao-event-card .ao-company-card__favorite {
    background: rgba(255, 255, 255, .94);
}
.ao-user-profile__favorites-list .ao-event-card--no-image .ao-event-card__link {
    grid-template-rows: 1fr;
}
.ao-user-profile__favorites-list .ao-event-card--no-image .ao-event-card__body {
    padding-right: 52px;
}


/* 2026-10-28 — mobile profile UX: guest favorites first, compact sign-in;
   existing mobile tab scrolling is preserved without extra scrollbar UI. */
@media (min-width: 768px) {
  .ao-user-profile--guest .ao-user-profile__login-disclosure > summary {
    display: none;
  }
}

@media (max-width: 767.98px) {
  /* An explicit placement prevents a generic grid/order rule from putting
     the login form before favorites on the guest profile. */
  .ao-user-profile--guest .ao-user-profile__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "favorites" "account";
    gap: 20px;
  }

  .ao-user-profile--guest .ao-user-profile__main {
    grid-area: favorites;
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__account {
    grid-area: account;
    position: static;
  }

  .ao-user-profile--guest .ao-user-profile__account-inner {
    box-shadow: none;
  }

  .ao-user-profile--guest .ao-user-profile__login-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--ao-accent);
    border-radius: 12px;
    background: var(--ao-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    text-align: center;
  }

  .ao-user-profile--guest .ao-user-profile__login-disclosure > summary::-webkit-details-marker {
    display: none;
  }

  .ao-user-profile--guest .ao-user-profile__login-disclosure > summary:focus-visible {
    outline: 3px solid rgba(39, 87, 215, .2);
    outline-offset: 3px;
  }

  .ao-user-profile--guest .ao-user-profile__login-disclosure[open] > summary {
    margin-bottom: 16px;
  }

}

/* 2026-10-28 — compact profile top spacing on phones only.
   Joomla renders an empty breadcrumbs nav on /login; on desktop it is
   already hidden by site-header.css, but mobile was reserving its height. */
@media (max-width: 767.98px) {
  body.site:has(.ao-user-profile) .container-component > nav.mod-breadcrumbs__wrapper:not(:has(.mod-breadcrumbs__item)) {
    display: none;
  }

  body.site:has(.ao-user-profile) .site-grid {
    padding-top: 14px;
  }

  body.site .ao-user-profile {
    padding-top: 10px;
  }
}

/* 2026-10-28 — remove Joomla's extra 1em margin above <main>
   on the guest /login page, mobile only. */
@media (max-width: 767.98px) {
  body.site.com_users.view-login .container-component > main {
    margin-top: 0;
  }
}
