/*
 * STP Header Button — site-wide styles
 * Loaded on every page (tiny file, ~1 KB gzipped).
 * Designed to sit cleanly inside Kadence's nav menu without fighting theme styles.
 */

/* ── Menu item wrapper ───────────────────────────────────────────────────── */

li.stp-hbtn-menu-item {
    display: flex !important;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
}

li.stp-hbtn-menu-item > .stp-hbtn {
    margin: 0;
}

/* ── Shared container ────────────────────────────────────────────────────── */

.stp-hbtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}

/* ── Login button (guest) ────────────────────────────────────────────────── */

.stp-hbtn__login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 8px;
    background: #111;
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.stp-hbtn__login svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.stp-hbtn__login:hover  { background: #333 !important; color: #fff !important; }
.stp-hbtn__login:active { transform: scale(.97); }

/* ── User trigger (logged-in) ────────────────────────────────────────────── */

.stp-hbtn__trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 5px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    background: transparent;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 100px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
    line-height: 1;
    font-family: inherit;
}
.stp-hbtn__trigger:hover {
    background: rgba(0,0,0,.05);
    border-color: rgba(0,0,0,.25);
}

.stp-hbtn__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.stp-hbtn__name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stp-hbtn__chevron {
    width: 14px;
    height: 14px;
    color: #888;
    transition: transform .18s ease;
    flex-shrink: 0;
}
.stp-hbtn--open .stp-hbtn__chevron {
    transform: rotate(180deg);
}

/* ── Dropdown ────────────────────────────────────────────────────────────── */

.stp-hbtn__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    padding: 4px;
    z-index: 99999;
    animation: stpHbtnDrop .14s ease;
}
.stp-hbtn--open .stp-hbtn__dropdown {
    display: block;
}

@keyframes stpHbtnDrop {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.stp-hbtn__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 400;
    color: #333 !important;
    border-radius: 7px;
    text-decoration: none !important;
    transition: background .1s;
    white-space: nowrap;
}
.stp-hbtn__item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #888;
}
.stp-hbtn__item:hover {
    background: rgba(0,0,0,.05);
    color: #111 !important;
    text-decoration: none !important;
}

.stp-hbtn__item--logout       { color: #A32D2D !important; }
.stp-hbtn__item--logout svg   { color: #A32D2D; }
.stp-hbtn__item--logout:hover { background: #FCEBEB; color: #A32D2D !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .stp-hbtn__name { display: none; }
}
