﻿/* ===== КНОПКА ВЫХОДА — КРАСНЫЙ КРУГ С БЕЛОЙ ИКОНКОЙ ===== */
.btn-logout {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: #e53935 !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
}

    .btn-logout:hover {
        background: #c62828 !important;
        transform: scale(1.08) !important;
    }

    .btn-logout svg {
        display: block !important;
    }

.logout-form {
    margin: 0 !important;
    display: inline-flex !important;
}





/* ============================================
   ВЫПАДАЮЩЕЕ МЕНЮ ПОЛЬЗОВАТЕЛЯ (общий файл)
   Подключается в _Layout.cshtml — работает на всех страницах
   ============================================ */

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .user-menu-toggle:hover {
        background: #000;
        color: #FFE733;
    }

.user-menu-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

/* Dropdown СКРЫТ по умолчанию */
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 250px;
    max-width: 300px;
    z-index: 1100;
    padding: 6px;
    animation: dropdownFade 0.2s ease;
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Полное ФИО в заголовке меню */
.user-menu-fio {
    font-weight: 800;
    font-size: 0.95rem;
    color: #000;
    padding: 10px 12px;
    border-bottom: 2px solid #FFE733;
    margin-bottom: 6px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

/* Пункты меню */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #000;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
}

    .user-menu-item:hover {
        background: #FFE733;
    }

.umi-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ===== ДЕСКТОП: открытие по наведению ===== */
@media (min-width: 769px) {
    .user-menu:hover .user-menu-dropdown {
        display: block;
    }

    .user-menu-arrow {
        display: none;
    }
}

/* ===== МОБИЛЬНЫЙ: меню во всю ширину ===== */
@media (max-width: 768px) {
    .user-menu-toggle {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .user-menu-dropdown {
        position: fixed;
        right: 10px;
        left: 10px;
        top: auto;
        max-width: none;
    }
}

/* ===== УТИЛИТЫ: скрытие по устройствам ===== */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}


@media (max-width: 768px) {
    /* Все кнопки шапки — В ОДНУ СТРОКУ */
    .header-right {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .header-user-info {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        width: auto !important;
    }

    .cart-btn {
        width: auto !important;
        flex: 0 0 auto !important;
    }
}

/* ===== ЧТОБЫ КНОПКИ НЕ ОБРЕЗАЛИСЬ СПРАВА ===== */
@media (max-width: 768px) {
    .header-right {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .header-user-info {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: auto !important;
    }
}

/* На очень узких экранах — только иконка 👤 без имени */
@media (max-width: 480px) {
    .user-menu-short {
        display: none;
    }
}


/* ===== ДЕСКТОП: ВСЁ В ОДНУ СТРОКУ ===== */
@media (min-width: 769px) {
    .header-right {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .header-user-info {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* Компактные кнопки, чтобы всё влезло */
    .btn-admin,
    .btn-manager {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    .cart-btn {
        white-space: nowrap !important;
    }

    .user-menu-toggle {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
}

/* На средних десктопных экранах (1024–1200px) — убираем имя с кнопки, оставляем 👤 */
@media (max-width: 1200px) and (min-width: 769px) {
    .user-menu-short {
        display: none !important;
    }
}

/* ===== МОБИЛЬНЫЙ: тот же красный круг, чуть меньше ===== */
@media (max-width: 768px) {
    .btn-logout {
        width: 38px !important;
        height: 38px !important;
    }
}
