/* ============================================================
   HEADER VISUAL
   Layout estrutural fica em layout.css.
   ============================================================ */

/* Botão de logout — vermelho contornado */
.btn-outline-danger.hide-menu-f,
.btn.btn-outline-danger.hide-menu-f,
button.btn-outline-danger.hide-menu-f {
    border: 1px solid var(--color-danger, #dc3545);
    color: var(--color-danger, #dc3545);
    background: transparent;
}

.btn-outline-danger.hide-menu-f:hover,
.btn.btn-outline-danger.hide-menu-f:hover,
button.btn-outline-danger.hide-menu-f:hover {
    background: var(--color-danger, #dc3545);
    color: #fff;
    border-color: var(--color-danger, #dc3545);
}

/* Nome do usuário (canto direito) */
.user_name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-right {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-right li,
.menu-right li a {
    text-decoration: none;
    color: inherit;
    margin: 0;
    padding: 0;
}

.open-menu-btn,
.cart-btn.icon-btn {
    background-color: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

/* Painel mobile — escondido em desktop */
.header .menu .head {
    display: none;
}

.header .menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header .menu>ul {
    display: flex;
    align-items: center;
}

.header .menu>ul>li {
    display: inline-block;
    position: relative;
}

.header .menu>ul>li:not(:last-child) {
    margin-right: 4px;
}

.header .menu .dropdown {
    position: relative;
}

.header .menu a {
    text-decoration: none;
    text-transform: capitalize;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

body.dark .header .menu a {
    color: var(--text-color);
}

.header .menu a:hover {
    color: var(--color-primary);
}

.header .menu>ul>li>a {
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
}

.header .menu>ul>li>a:hover {
    background-color: var(--color-primary-light);
}

/* Indicador de dropdown — caret */
.header .menu>ul>.dropdown>a::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentcolor;
    border-bottom: 1.5px solid currentcolor;
    transform: rotate(45deg) translateY(-2px);
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.header .menu>ul>.dropdown:hover>a::after {
    transform: rotate(225deg) translateY(0);
}

/* Submenu */
.header .menu .sub-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 240px;
    padding: 6px;
    background-color: var(--color-bg-body, #fff);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 100;
    transform-origin: top;
    transform: scaleY(0.9) translateY(-4px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.header .menu .sub-menu-left {
    top: 0;
    left: auto;
    right: 100%;
}

.header .menu li:hover>.sub-menu {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    visibility: visible;
}

.header .menu .sub-menu li {
    display: block;
}

.header .menu .sub-menu a {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    width: 100%;
    box-sizing: border-box;
}

.header .menu .sub-menu a:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.header .menu .sub-menu .dropdown>a {
    padding-right: 24px;
}

/* Remove o gradient line antigo do span (substituído pelo bg hover) */
.header .menu .sub-menu span {
    background: none;
}

.header-right>* {
    margin-left: 12px;
}

.header-right .open-menu-btn {
    display: none;
}

.hide-menu {
    display: none !important;
}

.email-icon {
    width: 24px;
    height: 24px;
    position: relative;
}

.show-off-on {
    display: none !important;
}

/* ============================================================
   MOBILE — <= 1120px → menu off-canvas
   ============================================================ */
@media (max-width: 1120px) {
    .show-off-on {
        display: block !important;
    }

    .hide-menu {
        display: block !important;
    }

    .hide-menu-f {
        display: none !important;
    }

    .header .menu {
        position: fixed;
        right: 0;
        top: 0;
        width: 280px;
        height: 100%;
        background-color: var(--color-bg-body, #fff);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 2000;
        box-shadow: -4px 0 16px rgba(15, 23, 42, 0.15);
        overflow-y: auto;
    }

    .header .menu.open {
        transform: none;
    }

    .header .menu .head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 8px;
    }

    .header .menu .close-menu-btn {
        height: 32px;
        width: 32px;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: transparent;
        cursor: pointer;
        border: none;
    }

    .header .menu .close-menu-btn::before,
    .header .menu .close-menu-btn::after {
        content: '';
        position: absolute;
        width: 70%;
        height: 2px;
        background-color: var(--color-text-primary);
    }

    .header .menu .close-menu-btn::before {
        transform: rotate(45deg);
    }

    .header .menu .close-menu-btn::after {
        transform: rotate(-45deg);
    }

    .header .menu>ul {
        flex-direction: column;
        align-items: stretch;
        padding: 0 8px;
    }

    .header .menu>ul>li {
        display: block;
    }

    .header .menu>ul>li:not(:last-child) {
        margin-right: 0;
    }

    .header .menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .header .menu li:first-child {
        border-top: 1px solid var(--color-border);
    }

    .header .menu>ul>li>a {
        padding: 10px 12px;
        border-radius: 0;
        display: block;
    }

    .header .menu>ul>.dropdown>a::after {
        float: right;
        margin-top: 6px;
    }

    .header .menu .sub-menu {
        position: static;
        opacity: 1;
        transform: none;
        visibility: visible;
        padding: 0;
        transition: none;
        box-shadow: none;
        border: none;
        width: 100%;
        display: none;
        background: var(--color-bg-light, #fafafa);
    }

    .header .menu .dropdown.active>.sub-menu {
        display: block;
    }

    .header .menu .sub-menu li:last-child {
        border: none;
    }

    .header .menu .sub-menu a {
        padding: 8px 28px;
        position: relative;
        display: block;
        font-size: 0.9rem;
    }

    .header .menu .sub-menu a::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 5px;
        height: 5px;
        background-color: var(--color-primary);
        border-radius: 50%;
    }

    .header .menu .sub-menu .sub-menu a {
        padding-left: 36px;
    }

    .header .menu .sub-menu .sub-menu a::before {
        left: 18px;
        background-color: var(--color-text-secondary);
    }

    .header .menu .sub-menu .sub-menu .sub-menu a {
        padding-left: 45px;
    }

    .header-right .open-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        background-color: transparent;
        border: none;
    }

    .sair-red {
        background-color: var(--color-danger, #dc3545);
        color: #fff !important;
        padding: 8px 12px;
        border-radius: var(--border-radius-md);
    }

    .sair-red:hover {
        color: #fff !important;
    }
}
