/* Logged-in header user trigger and slide-out menu.
   Keep this separate from dashboard CSS so public pages do not inherit dashboard layout rules. */

body.logged-in .navbar .account-box {
    display: none !important;
}

body.logged-in header .mobile-menu-auth {
    display: none !important;
}

.header-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1002;
    cursor: default;
}

.header-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    text-decoration: none;
}

.header-user-link:hover {
    background: transparent !important;
    color: inherit;
    text-decoration: none;
    opacity: 0.86;
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.header-user-name {
    font-family: "Inter", "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-left: 4px;
}

.header-user-hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-user-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header-user-hamburger.open span:first-child {
    transform: rotate(-45deg) translate(-4px, 4px);
}

.header-user-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.header-user-hamburger.open span:last-child {
    transform: rotate(45deg) translate(-4px, -4px);
}

body.logged-in .navbar-toggler {
    display: none !important;
}

body.logged-in header .buttos-box {
    display: flex !important;
    margin-right: 0 !important;
}

@media (min-width: 1201px) {
    body.logged-in .header-user-hamburger,
    body.logged-in .header-user-panel,
    body.logged-in .header-user-panel-overlay {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .header-user-name {
        display: none;
    }

    body.logged-in header .navbar-menu {
        display: none !important;
    }
}

.header-user-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 75vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    border: none;
    font-family: "Inter", "Manrope", sans-serif;
}

.header-user-panel.open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}

.header-user-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9999;
    transition: background 0.3s ease;
    pointer-events: none;
}

.header-user-panel-overlay.open {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: all;
}

.header-user-panel .header-user-panel-inner {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.header-user-panel .hup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.header-user-panel .hup-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-user-panel .hup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.header-user-panel .hup-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header-user-panel .hup-user-name {
    font-size: 15px;
    font-weight: 800;
    color: #04132D;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-panel .hup-passport-id {
    font-size: 12px;
    font-weight: 600;
    color: #7a7f88;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.header-user-panel .hup-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user-panel .hup-close:hover {
    background: #f3f4f6;
    color: #04132D;
}

.header-user-panel .hup-close svg {
    width: 18px;
    height: 18px;
}

.header-user-panel .hup-primary-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #04132D;
    text-decoration: none;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.header-user-panel .hup-primary-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #04132D;
    text-decoration: none;
}

.header-user-panel .hup-primary-link svg {
    flex-shrink: 0;
    color: #6b7280;
    width: 16px;
    height: 16px;
}

.header-user-panel .hup-nav {
    flex: 1;
}

.header-user-panel .hup-nav-group {
    margin-bottom: 6px;
}

.header-user-panel .hup-nav-heading {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    padding: 6px 10px 3px;
    user-select: none;
}

.header-user-panel .hup-nav-link {
    display: block;
    padding: 5px 10px 5px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 5px;
    line-height: 1.4;
    transition: background 0.12s ease;
}

.header-user-panel .hup-nav-link:hover {
    background: #f3f4f6;
    color: #04132D;
    text-decoration: none;
}

.header-user-panel .hup-browse-link {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.header-user-panel .hup-browse-link:hover {
    color: #04132D;
    background: #f3f4f6;
}

.header-user-panel .hup-bottom {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.header-user-panel .hup-bottom-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    border-radius: 5px;
    line-height: 1.4;
    transition: background 0.12s ease;
}

.header-user-panel .hup-bottom-link:hover {
    background: #f3f4f6;
    color: #04132D;
    text-decoration: none;
}

.header-user-panel .hup-bottom-link svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.header-user-panel .hup-logout {
    color: #dc2626;
}

.header-user-panel .hup-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 1200px) {
    .header-user-panel {
        width: 300px;
        max-width: 84vw;
        background: #04132d;
        color: #ffffff;
        font-family: "roc-grotesk", "Inter", sans-serif;
    }

    .header-user-panel.open {
        box-shadow: -18px 0 52px rgba(4, 19, 45, 0.42);
    }

    .header-user-panel .header-user-panel-inner {
        padding: 24px 16px 18px;
        gap: 14px;
    }

    .header-user-panel .hup-header {
        align-items: center;
        padding-bottom: 18px;
        margin-bottom: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .header-user-panel .hup-avatar {
        border: 2px solid rgba(150, 255, 148, 0.45);
    }

    .header-user-panel .hup-user-name {
        color: #ffffff;
        font-size: 16px;
        font-weight: 800;
    }

    .header-user-panel .hup-passport-id {
        color: rgba(255, 255, 255, 0.58);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .header-user-panel .hup-close {
        width: 34px;
        height: 34px;
        color: rgba(255, 255, 255, 0.72);
        border-radius: 10px;
    }

    .header-user-panel .hup-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #96ff94;
    }

    .header-user-panel .hup-nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex: 1;
        padding-top: 2px;
    }

    .header-user-panel .hup-nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.78);
        font-size: 14px;
        font-weight: 800;
        line-height: 1;
        letter-spacing: 0;
        text-decoration: none;
    }

    .header-user-panel .hup-nav-link:hover,
    .header-user-panel .hup-nav-link.is-active {
        background: rgba(150, 255, 148, 0.12);
        color: #96ff94;
        text-decoration: none;
    }

    .header-user-panel .hup-bottom {
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .header-user-panel .hup-bottom-link {
        min-height: 40px;
        padding: 0 12px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.72);
        font-size: 13px;
        font-weight: 800;
    }

    .header-user-panel .hup-bottom-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .header-user-panel .hup-logout {
        color: rgba(255, 255, 255, 0.68);
    }

    .header-user-panel .hup-logout:hover {
        background: rgba(220, 38, 38, 0.16);
        color: #fecaca;
    }

    .header-user-panel-overlay.open {
        background: rgba(4, 19, 45, 0.48);
    }
}

@media (max-width: 380px) {
    .header-user-panel .header-user-panel-inner {
        padding: 14px 12px;
    }

    .header-user-panel .hup-primary-link {
        font-size: 12px;
        padding: 8px 10px;
    }

    .header-user-panel .hup-nav-heading {
        font-size: 9px;
    }

    .header-user-panel .hup-nav-link {
        font-size: 12px;
        padding: 4px 10px 4px 18px;
    }

    .header-user-panel .hup-bottom-link {
        font-size: 12px;
        padding: 6px 10px;
    }

    .header-user-panel .hup-user-name {
        font-size: 14px;
    }

    .header-user-panel .hup-passport-id {
        font-size: 11px;
    }
}

/* ---------------------------------------------------------------
   Logged-out phone menu. Same hamburger and slide-out as logged in
   (the panel styles above), with the public nav items and the
   Log in / Create account buttons. Built in site-header.php;
   opened by assets/js/header-guest-menu.js.
   --------------------------------------------------------------- */
.header-guest-hamburger {
    position: relative;
    z-index: 1002;
}

@media (min-width: 1201px) {
    .header-guest-hamburger,
    .header-guest-panel,
    .header-guest-panel + .header-user-panel-overlay {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    header.navbar.rd-guest-menu .navbar-toggler,
    header.navbar.rd-guest-menu .navbar-menu {
        display: none !important;
    }

    header.navbar.rd-guest-menu .buttos-box {
        margin-right: 0 !important;
    }

    .header-guest-panel .hup-brand {
        display: flex;
        align-items: center;
        min-width: 0;
        text-decoration: none;
    }

    .header-guest-panel .hup-brand img {
        display: block;
        height: 28px;
        width: auto;
        max-width: 100%;
    }

    .header-guest-panel .hup-guest-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .header-guest-panel .hup-guest-login,
    .header-guest-panel .hup-guest-signup {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 0 16px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 800;
        line-height: 1;
        text-decoration: none;
    }

    .header-guest-panel .hup-guest-login {
        border: 1px solid rgba(255, 255, 255, 0.28);
        background: transparent;
        color: #ffffff;
    }

    .header-guest-panel .hup-guest-login:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        text-decoration: none;
    }

    .header-guest-panel .hup-guest-signup {
        border: 1px solid #96ff94;
        background: #96ff94;
        color: #04132d;
    }

    .header-guest-panel .hup-guest-signup:hover {
        background: #c2ff42;
        border-color: #c2ff42;
        color: #04132d;
        text-decoration: none;
    }
}
