/* ====================================
   СТИЛИ ДЛЯ ВИДЖЕТА АВТОРИЗАЦИИ
   Файл: auth-widget.css
   ==================================== */

/* ----- ОСНОВНОЙ КОНТЕЙНЕР ----- */
.auth-widget-wrapper {
    width: 100%;
    max-width: 100%; /* Гарантия, что не выйдет за пределы */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.auth-dropdown-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----- КНОПКА-ТРИГГЕР ----- */
.auth-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    margin: 0;
    cursor: pointer;
    background: var(--wpsc-white-bg);
    border: 1px solid var(--wpsc-border-color);
    border-radius: var(--wpsc-widget-border-radius, var(--wpsc-box-border-radius));
    transition: none;
    box-sizing: border-box;
}

.auth-trigger:hover {
    background: var(--wpsc-white-bg);
    border-color: var(--wpsc-border-focus-color);
}

.auth-trigger.active {
    background: var(--wpsc-white-bg); /* Фон темы */
    border-color: var(--wpsc-border-focus-color); /* Рамка темы */
}

/* ----- ЛЕВАЯ ЧАСТЬ (аватар + имя) ----- */
.auth-trigger-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    max-width: calc(100% - 30px); /* Оставляем место для стрелки */
}

/* ----- АВАТАР ----- */
.auth-avatar-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.auth-avatar {
    width: 100%;
    height: 100%;
    border: 1px solid var(--wpsc-border-color);
    border-radius: 50% !important;
    object-fit: cover;
    box-shadow: var(--wpsc-shadow-box);
}

/* ----- ИМЯ ПОЛЬЗОВАТЕЛЯ ----- */
.auth-user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--wpsc-text-color);
    min-width: 0;
    flex: 1;
    max-width: 100%;
}

.auth-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wpsc-text-color) !important;
    min-width: 0;
    max-width: 100%; /* Убираем фиксированную ширину */
    width: auto; /* Автоматическая ширина */
}

/* ----- ИКОНКА СТРЕЛКИ ----- */
.auth-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--wpsc-text-color);
    transition: none;
    flex-shrink: 0;
    margin-left: auto; /* Прижимаем к правому краю */
}

.auth-dropdown-icon.open {
    transform: rotate(180deg);
}

/* ----- ДРОПДАУН МЕНЮ ----- */
.auth-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: var(--wpsc-white-bg);
    border: 1px solid var(--wpsc-border-color);
    border-radius: var(--wpsc-box-border-radius);
    box-shadow: var(--wpsc-shadow-box);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: none;
    z-index: 1000;
    overflow: hidden;
    box-sizing: border-box;
}

.auth-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ----- ПУНКТЫ МЕНЮ ----- */
.auth-dropdown-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 0px 10px; /* ДОБАВИТЬ: отступы от краев меню */
    color: var(--wpsc-text-color);
    text-decoration: none;
    transition: none;
    transition: all .15s ease-in-out; /* ИЗМЕНИТЬ: добавить плавность */
    width: auto; /* ИЗМЕНИТЬ: авто ширина */
    max-width: calc(100% - 16px); /* ИЗМЕНИТЬ: учитываем margin */
    box-sizing: border-box;
    font-size: 14px;
    word-break: break-word;
    border-radius: 10px; /* ДОБАВИТЬ: закругленные края */
}

/* Верхний отступ у первого пункта */
.auth-dropdown-item:first-child {
    margin-top: 10px;
}

/* Нижний отступ у последнего пункта */
.auth-dropdown-item:last-child {
    margin-bottom: 10px;
}

.auth-dropdown-item:last-child {
    border-bottom: none;
}

.auth-dropdown-item:hover {
    background: var(--wpsc-body-bg);
    color: var(--wpsc-text-color);
}

/* ----- ИКОНКИ В МЕНЮ ----- */
.auth-dropdown-icon-item {
    width: 20px;
    height: 20px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
}

/* Текст в пунктах меню */
.auth-dropdown-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ----- ЗАТЕМНЕНИЕ ФОНА ----- */
.auth-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

.auth-dropdown-overlay.show {
    display: block;
}