/**
 * Floating Homepage Quick Links.
 *
 * @package jpd-theme
 */

.jpd-home-quick-links {
    position: fixed;
    top: 78%;
    right: 0;
    z-index: 9990;
    width: auto;
    padding: 0;
    background: transparent;
    transform: translateY(-50%);
}

.jpd-home-quick-links,
.jpd-home-quick-links * {
    box-sizing: border-box;
}

.jpd-home-quick-links__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 18px 0 0 18px;
    background: #882461;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.jpd-home-quick-links__toggle:hover,
.jpd-home-quick-links__toggle:focus-visible,
.jpd-home-quick-links.is-open .jpd-home-quick-links__toggle {
    background: #6f1d50;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    outline: none;
}

.jpd-home-quick-links__toggle:hover {
    transform: translateX(-3px);
}

.jpd-home-quick-links__toggle img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.jpd-home-quick-links__panel {
    position: absolute;
    top: 50%;
    right: 78px;
    width: min(330px, calc(100vw - 106px));
    max-height: min(480px, calc(100vh - 80px));
    overflow: hidden;
    border: 1px solid rgba(136, 36, 97, 0.16);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translate(14px, -50%) scale(0.96);
    transform-origin: right center;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}

.jpd-home-quick-links__panel[hidden] {
    display: block;
    visibility: hidden;
}

.jpd-home-quick-links.is-open .jpd-home-quick-links__panel {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
}

.jpd-home-quick-links__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 13px;
    background: #882461;
    color: #ffffff;
}

.jpd-home-quick-links__heading {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.jpd-home-quick-links__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.jpd-home-quick-links__close:hover,
.jpd-home-quick-links__close:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    outline: none;
}

.jpd-home-quick-links__list {
    display: flex;
    flex-direction: column;
    max-height: calc(min(480px, calc(100vh - 80px)) - 58px);
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    list-style: none;
}

.jpd-home-quick-links__list li {
    margin: 0;
    padding: 0;
}

.jpd-home-quick-links__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #292929;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.jpd-home-quick-links__list a:hover,
.jpd-home-quick-links__list a:focus-visible {
    background: rgba(136, 36, 97, 0.08);
    color: #882461;
    outline: none;
    transform: translateX(2px);
}

@media (max-width: 700px) {
    .jpd-home-quick-links {
        top: auto;
        right: 0;
        bottom: 22px;
        transform: none;
    }

    .jpd-home-quick-links__toggle {
        width: 58px;
        height: 58px;
        border-radius: 16px 0 0 16px;
    }

    .jpd-home-quick-links__toggle img {
        width: 32px;
        height: 32px;
    }

    .jpd-home-quick-links__panel {
        top: auto;
        right: 70px;
        bottom: 0;
        width: min(310px, calc(100vw - 92px));
        max-height: min(420px, calc(100vh - 42px));
        transform: translateX(14px) scale(0.96);
        transform-origin: right bottom;
    }

    .jpd-home-quick-links.is-open .jpd-home-quick-links__panel {
        transform: translateX(0) scale(1);
    }

    .jpd-home-quick-links__list {
        max-height: calc(min(420px, calc(100vh - 42px)) - 58px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .jpd-home-quick-links__toggle,
    .jpd-home-quick-links__panel,
    .jpd-home-quick-links__list a {
        transition: none;
    }
}
