/* ---------- Botón circular (fijo, arriba a la derecha) ---------- */
.hf-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1.25rem;
    z-index: 1001;
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(238, 128, 34, .4);
    background: rgba(27, 18, 13, .85);
    color: #ee8022;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 34px -14px rgba(238, 128, 34, .45);
    transition: border-color .25s ease, transform .25s ease, background-color .35s ease, color .35s ease;
}
.hf-menu-btn:hover { border-color: #ee8022; transform: scale(1.06); }
.hf-menu-btn:focus-visible { outline: 2px solid #ee8022; outline-offset: 3px; }

/* Icono hamburguesa que se transforma en X */
.hf-burger { position: relative; width: 1.35rem; height: 1rem; }
.hf-burger i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .35s ease, opacity .25s ease, top .35s ease;
}
.hf-burger i:nth-child(1) { top: 0; }
.hf-burger i:nth-child(2) { top: calc(50% - 1px); }
.hf-burger i:nth-child(3) { top: calc(100% - 2px); }
.hf-menu-btn[aria-expanded="true"] .hf-burger i:nth-child(1) { top: calc(50% - 1px); transform: rotate(45deg); }
.hf-menu-btn[aria-expanded="true"] .hf-burger i:nth-child(2) { opacity: 0; }
.hf-menu-btn[aria-expanded="true"] .hf-burger i:nth-child(3) { top: calc(50% - 1px); transform: rotate(-45deg); }

/* ---------- Panel: se revela en círculo desde el botón ---------- */
.hf-menu-panel {
    position: fixed;
    top: 4.85rem;
    left: 1.25rem;
    z-index: 1000;
    width: min(21rem, 100vw - 2.5rem);
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    padding: .7rem;
    border-radius: 24px;
    border: 1px solid rgba(238, 128, 34, .4);
    background: rgba(27, 18, 13, .92);
    color: #ffede6;
    font-family: 'Manrope', sans-serif;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px -24px rgba(238, 128, 34, .5);

    /* centro del círculo = centro del botón */
    clip-path: circle(0 at 1.6rem -2.3rem);
    visibility: hidden;
    pointer-events: none;
    transition: clip-path .5s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .5s;
}
.hf-menu-panel.open {
    clip-path: circle(150% at 1.6rem -2.3rem);
    visibility: visible;
    pointer-events: auto;
    transition: clip-path .6s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}

/* ---------- Desplegables ---------- */
.hf-acc { border-radius: 14px; }
.hf-acc + .hf-acc { margin-top: .25rem; }

.hf-acc summary {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem .95rem;
    border-radius: 14px;
    font: 600 1rem 'Chakra Petch', sans-serif;
    letter-spacing: .01em;
    cursor: pointer;
    list-style: none;
    transition: background-color .2s ease;
}
.hf-acc summary::-webkit-details-marker { display: none; }
.hf-acc summary:hover { background: rgba(238, 128, 34, .08); }
.hf-acc summary:focus-visible { outline: 2px solid #ee8022; outline-offset: 2px; }
.hf-acc summary > i:first-child { width: 1.2rem; text-align: center; color: #ee8022; }
.hf-acc summary .chev {
    margin-left: auto;
    font-size: .8rem;
    color: #baa098;
    transition: transform .3s ease;
}
.hf-acc[open] summary .chev { transform: rotate(180deg); }
.hf-acc[open] summary { background: rgba(238, 128, 34, .08); }

.hf-acc ul {
    list-style: none;
    margin: .25rem 0 .4rem 1.6rem;
    padding: 0 0 0 .9rem;
    border-left: 1px dashed rgba(220, 145, 120, .3);
}
.hf-acc[open] ul { animation: hfAccIn .3s ease both; }
@keyframes hfAccIn { from { opacity: 0; transform: translateY(-6px); } }

.hf-acc ul a {
    display: block;
    padding: .55rem .8rem;
    border-radius: 10px;
    color: #eed3cb;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}
.hf-acc ul a:hover { background: rgba(238, 128, 34, .1); color: #fff; }
.hf-acc ul a.active { color: #ee8022; background: rgba(238, 128, 34, .12); }

/* ---------- Modo claro ---------- */
:root[data-theme="light"] .hf-menu-btn {
    background: rgba(255, 255, 255, .92);
    color: #90450e;
    border-color: rgba(144, 69, 14, .4);
    box-shadow: 0 12px 34px -16px rgba(88, 53, 32, .4);
}
:root[data-theme="light"] .hf-menu-btn:hover { border-color: #90450e; }
:root[data-theme="light"] .hf-menu-panel {
    background: rgba(255, 255, 255, .95);
    color: #261a13;
    border-color: rgba(144, 69, 14, .4);
    box-shadow: 0 24px 60px -28px rgba(88, 53, 32, .45);
}
:root[data-theme="light"] .hf-acc summary:hover,
:root[data-theme="light"] .hf-acc[open] summary { background: rgba(144, 69, 14, .08); }
:root[data-theme="light"] .hf-acc summary > i:first-child { color: #90450e; }
:root[data-theme="light"] .hf-acc summary .chev { color: #755c54; }
:root[data-theme="light"] .hf-acc ul { border-left-color: rgba(88, 53, 32, .25); }
:root[data-theme="light"] .hf-acc ul a { color: #513e37; }
:root[data-theme="light"] .hf-acc ul a:hover { background: rgba(144, 69, 14, .1); color: #261a13; }
:root[data-theme="light"] .hf-acc ul a.active { color: #90450e; background: rgba(144, 69, 14, .12); }

@media (max-width: 600px) {
    .hf-menu-btn { top: .75rem; left: .75rem; width: 3rem; height: 3rem; }
    .hf-menu-panel { top: 4.3rem; left: .75rem; width: calc(100vw - 1.5rem); }
}
@media (prefers-reduced-motion: reduce) {
    .hf-menu-panel, .hf-menu-panel.open { transition: none; }
    .hf-burger i, .hf-acc summary .chev { transition: none; }
    .hf-acc[open] ul { animation: none; }
}
@media print {
    .hf-menu-btn, .hf-menu-panel { display: none !important; }
}
/* Número de invitaciones pendientes en «Grupos y chats» */
.hf-menu-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 .3rem;
    margin-left: .35rem;
    border-radius: 999px;
    background: #f16e63;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    vertical-align: middle;
}
