/**
 * ND Mobile Sticky Nav
 * Every size / color is a custom property; the module settings set them inline
 * on .nd-msn (see getStyleAttr()), unset ones fall back to the theme's
 * Bootstrap variables when present.
 */
.nd-msn {
    --nd-msn-accent: var(--bs-primary, #1d3f63);
    --nd-msn-bg: #fff;
    --nd-msn-item-color: var(--nd-msn-accent);
    --nd-msn-hover-color: var(--nd-msn-item-color);
    --nd-msn-hover-bg: transparent;
    --nd-msn-active-bg: var(--nd-msn-accent);
    --nd-msn-active-color: #fff;
    --nd-msn-panel-bg: #fff;
    --nd-msn-panel-title: var(--nd-msn-accent);
    --nd-msn-panel-text: var(--bs-body-color, #212529);
    --nd-msn-muted: var(--bs-secondary-color, #6c757d);
    --nd-msn-border: var(--bs-border-color, #e5e5e5);
    --nd-msn-overlay: rgba(var(--nd-msn-overlay-rgb, var(--bs-primary-rgb, 29, 63, 99)), var(--nd-msn-overlay-opacity, 0.6));
    --nd-msn-height: 64px;
    --nd-msn-icon-size: 22px;
    --nd-msn-label-size: 11px;
    --nd-msn-radius: 16px;
    --nd-msn-badge-bg: var(--nd-msn-accent);
    --nd-msn-badge-color: #fff;
    --nd-msn-gap-x: 0px;
    --nd-msn-gap-y: 0px;
    --nd-msn-max-width: none;

    position: fixed;
    right: var(--nd-msn-gap-x);
    bottom: 0;
    left: var(--nd-msn-gap-x);
    /* below the sticky header (and its menu / search overlays), above it while a panel is open */
    z-index: 1020;
    display: none;
    max-width: var(--nd-msn-max-width);
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.4;
    color: var(--nd-msn-panel-text);
}
.nd-msn.is-open {
    z-index: 1050;
}
.nd-msn-spacer {
    display: none;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 767.98px) {
    .nd-msn--md {
        display: block;
    }
}
@media (max-width: 1199.98px) {
    .nd-msn--xl {
        display: block;
    }
}

/* width / position: max width (px or %) + alignment, distance from the side
   edges (gap-x) and from the bottom edge (gap-y, the bar then floats) */
.nd-msn--align-left {
    margin-left: 0;
}
.nd-msn--align-right {
    margin-right: 0;
}
.nd-msn--floating {
    bottom: calc(var(--nd-msn-gap-y) + env(safe-area-inset-bottom, 0px));
}

/* overlay */
.nd-msn__overlay {
    position: fixed;
    inset: 0;
    background: var(--nd-msn-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nd-msn.is-open .nd-msn__overlay {
    opacity: 1;
    visibility: visible;
}

/* bar */
.nd-msn__bar {
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: var(--nd-msn-radius) var(--nd-msn-radius) 0 0;
    background: var(--nd-msn-bg);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
}
.nd-msn--floating .nd-msn__bar {
    padding-bottom: 0;
    border-radius: var(--nd-msn-radius);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.nd-msn__items {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nd-msn__item {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.nd-msn .nd-msn__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: var(--nd-msn-height);
    margin: 0;
    padding: 6px 4px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--nd-msn-item-color);
    font: inherit;
    font-size: var(--nd-msn-label-size);
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.nd-msn__item:first-child .nd-msn__btn {
    border-top-left-radius: var(--nd-msn-radius);
}
.nd-msn__item:last-child .nd-msn__btn {
    border-top-right-radius: var(--nd-msn-radius);
}
.nd-msn--floating .nd-msn__item:first-child .nd-msn__btn {
    border-bottom-left-radius: var(--nd-msn-radius);
}
.nd-msn--floating .nd-msn__item:last-child .nd-msn__btn {
    border-bottom-right-radius: var(--nd-msn-radius);
}
@media (hover: hover) {
    .nd-msn .nd-msn__btn:hover {
        background: var(--nd-msn-hover-bg);
        color: var(--nd-msn-hover-color);
    }
}
.nd-msn .nd-msn__btn[aria-expanded="true"] {
    background: var(--nd-msn-active-bg);
    color: var(--nd-msn-active-color);
}
.nd-msn .nd-msn__btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}
.nd-msn__icon {
    position: relative;
}
.nd-msn__icon svg {
    display: block;
    width: var(--nd-msn-icon-size);
    height: var(--nd-msn-icon-size);
}
.nd-msn__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* cart product count */
.nd-msn__badge {
    position: absolute;
    top: -6px;
    left: calc(100% - 8px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--nd-msn-bg);
    border-radius: 9px;
    background: var(--nd-msn-badge-bg);
    color: var(--nd-msn-badge-color);
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    box-sizing: border-box;
}
.nd-msn__badge[hidden] {
    display: none;
}

/* labels hidden visually only, screen readers still get them */
.nd-msn--no-labels .nd-msn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* sheet (holds the panels, sits on top of the bar) */
.nd-msn__sheet {
    position: absolute;
    right: 8px;
    bottom: 100%;
    left: 8px;
    max-height: calc(100vh - var(--nd-msn-height) - 80px);
    max-height: calc(100dvh - var(--nd-msn-height) - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--nd-msn-radius) var(--nd-msn-radius) 0 0;
    background: var(--nd-msn-panel-bg);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.nd-msn--floating .nd-msn__sheet {
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    border-radius: var(--nd-msn-radius);
}
.nd-msn.is-open .nd-msn__sheet {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.nd-msn__panel[hidden] {
    display: none;
}
.nd-msn__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--nd-msn-border);
}
.nd-msn__panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--nd-msn-panel-title);
}
.nd-msn__close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--nd-msn-panel-text);
    cursor: pointer;
}
.nd-msn__close svg {
    width: 14px;
    height: 14px;
}
.nd-msn__panel-body {
    padding: 8px 16px 16px;
}

/* account */
.nd-msn__text {
    margin: 8px 0 16px;
    color: var(--nd-msn-panel-text);
    opacity: 0.8;
}
.nd-msn__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
}
.nd-msn .nd-msn__action {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 280px;
    padding: 9px 20px;
    border: 1.5px solid var(--nd-msn-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--nd-msn-accent);
    font-weight: 600;
    text-decoration: none;
}
.nd-msn .nd-msn__action--primary {
    background: var(--nd-msn-accent);
    color: #fff;
}
.nd-msn__action-arrow {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
}

/* opening hours */
.nd-msn__rows {
    margin: 0;
}
.nd-msn__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--nd-msn-border);
}
.nd-msn__row:last-child {
    border-bottom: 0;
}
.nd-msn__row dt {
    font-weight: 600;
    color: var(--nd-msn-panel-title);
}
.nd-msn__row dd {
    margin: 0;
    text-align: right;
}

/* links */
.nd-msn__links {
    margin: 0;
    padding: 0;
    list-style: none;
}
.nd-msn__links li {
    margin: 0;
    border-bottom: 1px solid var(--nd-msn-border);
}
.nd-msn__links li:last-child {
    border-bottom: 0;
}
.nd-msn .nd-msn__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    color: var(--nd-msn-panel-title);
    font-weight: 600;
    text-decoration: none;
}
.nd-msn__link svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

/* custom content */
.nd-msn__html {
    padding-top: 8px;
}
.nd-msn__html > :last-child {
    margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
    .nd-msn__overlay,
    .nd-msn__sheet,
    .nd-msn .nd-msn__btn {
        transition: none;
    }
}
