/* QA ID 312: il root resta full width così la linea grigia copre l'intero
   schermo (come l'header); il contenuto si clampa in .anchor-point-inner. */
.anchor-point {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    margin-bottom: 20px;
    background: var(--color-white);
    background-image: linear-gradient(var(--color-grey-2), var(--color-grey-2));
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 2px;
}

.anchor-point-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
}

@media (min-width: 768px) {
    .anchor-point-inner {
        padding-inline: 28px;
    }

    .anchor-point--admin-bar {
        top: 32px;
    }
}

.anchor-point-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    gap: 8px;
}

.anchor-point-logo {
    width: auto;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

.anchor-point-title {
    overflow: hidden;
    color: var(--color-secondary-dark);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anchor-point-nav {
    position: absolute;
    z-index: 100;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--color-white);
    border-bottom: 2px solid var(--color-grey-2);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.anchor-point-nav:not(.hidden) {
    display: flex;
}

.anchor-point-link {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    border: 2px solid transparent;
    border-bottom-color: var(--color-grey-2);
    padding: 12px 16px;
    cursor: pointer;
}

/* QA ID 314: su tablet/mobile la libreria non prevede lo stato hover
   (l'hover esiste solo per la variante desktop, vedi media query sotto). */

/* QA ID 315: Selected tablet/mobile da libreria = barra sinistra 2px color
   info + testo primary semibold, senza underline in basso. */
.anchor-point-link[aria-current="location"] {
    z-index: 2;
    color: var(--color-primary);
    font-weight: 600;
    border-left: 2px solid var(--color-info, #027AC0);
}

.anchor-point-link:focus-visible {
    z-index: 2;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    outline: none;
}

.anchor-point-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 20px;
}

.anchor-point-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.anchor-point-trigger:hover {
    background: var(--color-grey-1);
}

.anchor-point-trigger:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.anchor-point-trigger-icon {
    font-size: 24px;
    line-height: 24px;
    user-select: none;
    transition: transform 0.2s ease;
}

.anchor-point-trigger[aria-expanded="true"] .anchor-point-trigger-icon {
    transform: rotate(180deg);
}

.anchor-point .anchor-point-button {
    padding: 8px 24px;
    font-size: 14px;
    line-height: 20px;
}

@media (min-width: 1280px) {
    .anchor-point-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        column-gap: 24px;
        max-width: 1440px;
        height: 52px;
        margin-inline: auto;
        padding-block: 0;
    }

    /* Hover desktop da libreria: primary + semibold + underline */
    .anchor-point-link:hover {
        color: var(--color-primary);
        font-weight: 600;
    }

    /* Selected desktop: underline primary in basso (la barra sinistra è solo mobile) */
    .anchor-point-link[aria-current="location"] {
        border-left-color: transparent;
        border-bottom: 2px solid var(--color-primary);
    }

    .anchor-point-brand {
        grid-column: 1;
    }

    .anchor-point-nav {
        grid-column: 2;
        position: static;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        min-width: 0;
        height: 52px;
        justify-self: center;
        gap: 24px;
        overflow-x: auto;
        background: transparent;
        border-bottom: 0;
        box-shadow: none;
    }

    .anchor-point-link {
        justify-content: center;
        width: auto;
        flex-shrink: 0;
        padding: 14px 4px;
        text-align: center;
        white-space: nowrap;
    }

    .anchor-point-link:hover {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .anchor-point-actions {
        grid-column: 3;
        justify-self: end;
        margin-left: 24px;
    }

    .anchor-point-actions--trigger-only,
    .anchor-point-trigger {
        display: none;
    }
}
