/* Sticky Buttons Container */
.sticky-buttons {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-right: none;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: width 0.3s ease;
}

/* Collapsed */
.sticky-buttons.collapsed {
    width: 64px;
}

/* Expanded */
.sticky-buttons.expanded {
    width: 160px;
}

/* Button */
.sticky-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 160px;
    min-height: 56px;
    box-sizing: border-box;
    padding: 14px 18px 14px 14px;
    text-decoration: none;
    color: #007bc0;
    background: #ffffff;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
    gap: 6px;
}

/* Remove focus outline */
.sticky-btn:focus {
    outline: none;
}

/* Icon */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    flex-shrink: 0;
}

.sticky-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #007bc0;
}

/* Label */
.btn-text {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    padding-left: 8px;

    white-space: normal;
    word-break: break-word;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    max-width: 110px;
}

/* Hide label when collapsed */
.sticky-buttons.collapsed .btn-text {
    opacity: 0;
    visibility: hidden;
}

/* Show label when expanded */
.sticky-buttons.expanded .btn-text {
    opacity: 1;
    visibility: visible;
}

/* Hover */
.sticky-btn:hover,
.sticky-btn.hovered {
    background: #d9ecf9;
    color: #007bc0;
}

.sticky-btn:hover svg,
.sticky-btn.hovered svg {
    color: #007bc0;
}

/* Pressed */
.sticky-btn:active,
.sticky-btn.pressed {
    background: #b8d8f0;
    color: #007bc0;
}

.sticky-btn:active svg,
.sticky-btn.pressed svg {
    color: #007bc0;
}

/* Active page */
.sticky-btn.active,
.sticky-btn[aria-current="page"] {
    background: #0f5c8a;
    color: #ffffff;
}

.sticky-btn.active svg,
.sticky-btn[aria-current="page"] svg {
    color: #ffffff;
}


/* ---------------- MOBILE ---------------- */

@media screen and (max-width: 768px) {

    body {
        padding-bottom: 80px;
    }

    .sticky-buttons {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        justify-content: stretch;
        align-items: stretch;
        border: none;
        width: 100%;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    }

    .sticky-btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        min-height: 4rem;
        padding: 6px 4px;

        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;

        gap: 6px; 
    }

    /* ICON */
    .btn-icon {
        justify-content: center;
        width: 100%;
    }

    .sticky-btn svg {
        display: block;
        margin: 0 auto;
    }

    /* TEXT */
    .btn-text {
        text-align: center;
        padding-left: 0;   
        margin: 0 auto;
        max-width: none;
        padding-right: 5px;
	}

    /* Hover */
    .sticky-btn:hover,
    .sticky-btn.hovered {
        background: #d9ecf9;
        color: #007bc0;
    }

    .sticky-btn:hover svg,
    .sticky-btn.hovered svg {
        color: #007bc0;
    }

    /* Pressed */
    .sticky-btn:active,
    .sticky-btn.pressed {
        background: #b8d8f0;
    }

    .sticky-btn:active svg,
    .sticky-btn.pressed svg {
        color: #007bc0;
    }

    /* Dynamic width */

    /* 2 buttons */
    .sticky-buttons .sticky-btn:nth-child(1):nth-last-child(2),
    .sticky-buttons .sticky-btn:nth-child(2):nth-last-child(1) {
        flex: 1 1 50%;
    }

    /* 3 buttons */
    .sticky-buttons .sticky-btn:nth-child(1):nth-last-child(3),
    .sticky-buttons .sticky-btn:nth-child(2):nth-last-child(2),
    .sticky-buttons .sticky-btn:nth-child(3):nth-last-child(1) {
        flex: 1 1 33.333%;
    }

    /* 4 buttons */
    .sticky-buttons .sticky-btn:nth-child(1):nth-last-child(4),
    .sticky-buttons .sticky-btn:nth-child(2):nth-last-child(3),
    .sticky-buttons .sticky-btn:nth-child(3):nth-last-child(2),
    .sticky-buttons .sticky-btn:nth-child(4):nth-last-child(1) {
        flex: 1 1 25%;
    }
}

/* Small mobile */
@media screen and (max-width: 480px) {

    .sticky-btn {
        min-height: 4rem;
        gap: 6px; /* isti spacing */
    }

    .btn-text {
        font-size: 0.7rem;
    }
}