/*
 * The Share menu (assets/js/share-menu.js): a small menu under the Share
 * button, or a bottom sheet below 600px wide. It is added to the end of the
 * body, above the modals (so it opens from the saved notes modal too) and
 * below the toasts. Every rule is scoped and sets what it relies on, so the
 * theme's broad button and link rules do not leak in.
 */

.sr-share-menu__backdrop {
    display: none;
}

.sr-share-menu:not(#sr-x) {
    position: fixed;
    top: var(--sr-share-top, 0);
    left: var(--sr-share-left, 0);
    z-index: 2147483001;
    display: flex;
    flex-direction: column;
    width: 240px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--sr-x-card-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 41, 66, 0.16), 0 2px 6px rgba(0, 41, 66, 0.08);
    color: var(--sr-x-body);
    font-family: var(--sr-x-body-font);
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    animation: sr-fade 120ms ease-out;
}

.sr-share-menu:not(#sr-x) .sr-share-menu__item,
.sr-share-menu:not(#sr-x) .sr-share-menu__item:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--sr-x-body);
    font: inherit;
    font-weight: 500;
    letter-spacing: normal;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
}
.sr-share-menu:not(#sr-x) .sr-share-menu__item:hover {
    background: var(--sr-x-sky-bg);
    color: var(--sr-x-heading);
}
.sr-share-menu:not(#sr-x) .sr-share-menu__item:active {
    background: #D6EEFA;
    color: var(--sr-x-heading);
}
.sr-share-menu:not(#sr-x) .sr-share-menu__item:focus {
    outline: none;
}
.sr-share-menu:not(#sr-x) .sr-share-menu__item:focus-visible {
    outline: 3px solid var(--sr-x-focus);
    outline-offset: -3px;
    background: var(--sr-x-sky-bg);
}

.sr-share-menu__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--sr-x-blue);
}
.sr-share-menu__icon svg {
    display: block;
    width: 22px;
    height: 22px;
}
.sr-share-menu__icon--x {
    color: #000;
}
.sr-share-menu__icon--x svg {
    width: 18px;
    height: 18px;
}

/* Divider above the device's own sheet. */
.sr-share-menu:not(#sr-x) [data-share="more"] {
    position: relative;
    margin-top: 9px;
}
.sr-share-menu:not(#sr-x) [data-share="more"]::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 12px;
    right: 12px;
    border-top: 1px solid var(--sr-x-card-border);
}

/* While the menu is open, the shop's floating cart and Help buttons step aside
   (the cart's container sits at the highest z-index there is). */
body.sr-share-open .xoo-wsc-basket,
body.sr-share-open #beacon-container {
    display: none !important;
}

/* Narrow screens: a sheet along the bottom with a dimmed page behind it. */
@media (max-width: 599px) {
    .sr-share-menu__backdrop {
        position: fixed;
        inset: 0;
        z-index: 2147483000;
        display: block;
        background: rgba(0, 0, 0, 0.5);
        animation: sr-fade 150ms ease-out;
    }
    .sr-share-menu:not(#sr-x) {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        padding: 12px 12px max(16px, env(safe-area-inset-bottom, 0px));
        border: 0;
        border-radius: 20px 20px 0 0;
        animation: sr-rise 180ms ease-out;
    }
    .sr-share-menu:not(#sr-x) .sr-share-menu__item {
        min-height: 52px;
        padding: 10px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sr-share-menu:not(#sr-x),
    .sr-share-menu__backdrop {
        animation: none;
    }
}

@media print {
    .sr-share-menu,
    .sr-share-menu__backdrop {
        display: none !important;
    }
}
