/* SkrivSikkert Unified Mobile Navigation V2 */

:root {
  --mn-bar-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

#bb-mobile-nav,
.mn-fab-group,
.mn-more-backdrop,
.mn-more-sheet {
  display: none;
}

@media (max-width: 767px) {
  #bb-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mn-bar-height);
    padding: 4px 4px env(safe-area-inset-bottom, 0px);
    background: var(--white, #FFFEFB);
    border-top: 1px solid var(--divider, #E4DCD4);
    box-shadow: 0 -4px 20px rgba(92, 77, 67, 0.06);
    z-index: 9000;
    align-items: stretch;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  #bb-mobile-nav .mn-tab {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 2px;
    overflow: hidden;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--icon-inactive, #B8ACA0);
    font-family: var(--font-family, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-decoration: none;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease, transform 0.06s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  #bb-mobile-nav button.mn-tab {
    appearance: none;
  }

  #bb-mobile-nav .mn-tab-label {
    color: var(--warm-text, #5C4D43);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  #bb-mobile-nav .mn-tab.is-active {
    color: var(--warm-text, #5C4D43);
  }

  #bb-mobile-nav .mn-tab.is-active .mn-tab-label {
    color: var(--warm-text, #5C4D43);
  }

  #bb-mobile-nav .mn-tab.is-active .mn-tab-icon {
    background: var(--pill-bg, #F0EAE4);
    border-radius: 16px;
    padding: 4px 16px;
  }

  #bb-mobile-nav .mn-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 28px;
    transition: background 0.2s ease, padding 0.2s ease;
  }

  #bb-mobile-nav .mn-tab-icon svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  #bb-mobile-nav .mn-icon-f {
    display: none;
  }

  #bb-mobile-nav .mn-icon-o {
    display: block;
  }

  #bb-mobile-nav .mn-tab.is-active .mn-icon-f {
    display: block;
  }

  #bb-mobile-nav .mn-tab.is-active .mn-icon-o {
    display: none;
  }

  #bb-mobile-nav .mn-tab:focus-visible {
    outline: none;
  }

  #bb-mobile-nav .mn-tab:active {
    transform: scale(0.92);
  }

  #bb-mobile-nav .mn-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--rose-dark, #9B6050);
    color: var(--white, #FFFEFB);
    font-family: var(--font-family, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 18px;
    text-align: center;
    pointer-events: none;
  }

  #bb-mobile-nav .mn-badge[hidden] {
    display: none;
  }

  .mn-fab-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 9050;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .mn-fab-group.is-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }

  body.has-mn-more-open .mn-fab-group {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }

  .mn-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 20px;
    border: none;
    border-radius: 26px;
    font-family: var(--font-family, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--white, #FFFEFB);
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mn-fab:active {
    transform: scale(0.95);
  }

  .mn-fab:focus-visible {
    outline: none;
  }

  .mn-fab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .mn-fab-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: var(--white, #FFFEFB);
    color: var(--warm-text, #5C4D43);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(92, 77, 67, 0.12), 0 8px 24px rgba(92, 77, 67, 0.06);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mn-fab-mini:active {
    transform: scale(0.92);
  }

  .mn-fab-mini:focus-visible {
    outline: none;
  }

  [data-mn-accent="rose"] .mn-fab {
    background: var(--rose-dark, #9B6050);
    box-shadow: 0 4px 12px rgba(155, 96, 80, 0.35), 0 8px 24px rgba(155, 96, 80, 0.15);
  }

  [data-mn-accent="sage"] .mn-fab {
    background: var(--sage-dark, #4A7A68);
    box-shadow: 0 4px 12px rgba(74, 122, 104, 0.35), 0 8px 24px rgba(74, 122, 104, 0.15);
  }

  [data-mn-accent="slate"] .mn-fab {
    background: var(--slate-dark, #4E5370);
    box-shadow: 0 4px 12px rgba(78, 83, 112, 0.35), 0 8px 24px rgba(78, 83, 112, 0.15);
  }

  .mn-more-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(32, 27, 24, 0.18);
    z-index: 9001;
  }

  .mn-more-backdrop[hidden],
  .mn-more-sheet[hidden] {
    display: none;
  }

  .mn-more-sheet {
    display: block;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--mn-bar-height) + 8px);
    padding: 8px;
    border: 1px solid var(--divider, #E4DCD4);
    border-radius: 18px;
    background: var(--white, #FFFEFB);
    box-shadow: 0 8px 32px rgba(92, 77, 67, 0.16);
    z-index: 9002;
  }

  .mn-more-handle {
    width: 34px;
    height: 4px;
    margin: 2px auto 8px;
    border-radius: 999px;
    background: rgba(92, 77, 67, 0.18);
  }

  #bb-mobile-more-sheet .mn-more-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 2px 10px;
  }

  #bb-mobile-more-sheet .mn-group-header {
    padding: 12px 12px 5px;
    color: #9A8E82;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.10em;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
  }

  #bb-mobile-more-sheet .mn-more-grid > .mn-group-header:first-child {
    padding-top: 4px;
  }

  #bb-mobile-more-sheet .mn-more-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #3A2F26;
    font-family: var(--font-family, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    font-size: 14.5px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.15;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: background-color 0.14s ease, color 0.14s ease;
  }

  #bb-mobile-more-sheet .mn-more-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #9A8E82;
    flex: 0 0 22px;
  }

  #bb-mobile-more-sheet .mn-more-icon svg {
    width: 20px;
    height: 20px;
    color: #9A8E82;
    stroke: #9A8E82;
    fill: none;
  }

  #bb-mobile-more-sheet .mn-more-link > span:not(.mn-more-icon):not(.mn-more-meta) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #bb-mobile-more-sheet .mn-more-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
  }

  #bb-mobile-more-sheet .mn-more-status[data-lang-selector-label] {
    display: inline-flex;
    align-items: center;
    max-width: 92px;
    padding: 4px 10px;
    overflow: hidden;
    background: #FBF8F2;
    border: 1px solid rgba(58, 47, 38, 0.08);
    border-radius: 10px;
    color: #5C4D43;
    font-size: 11.5px;
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #bb-mobile-more-sheet .mn-more-link:hover {
    background: #FBF8F2;
  }

  #bb-mobile-more-sheet .mn-more-link[aria-current="page"] {
    background: rgba(110, 138, 126, 0.10);
    color: #3A2F26;
  }

  #bb-mobile-more-sheet .mn-more-link.is-active {
    background: rgba(110, 138, 126, 0.10);
  }

  #bb-mobile-more-sheet .mn-more-link[aria-current="page"] .mn-more-icon,
  #bb-mobile-more-sheet .mn-more-link.is-active .mn-more-icon,
  #bb-mobile-more-sheet .mn-more-link[aria-current="page"] .mn-more-icon svg,
  #bb-mobile-more-sheet .mn-more-link.is-active .mn-more-icon svg {
    color: #4A7A68;
    stroke: #4A7A68;
  }

  #bb-mobile-more-sheet .mn-more-link:focus-visible {
    outline: 2px solid #6E8A7E;
    outline-offset: 2px;
  }

  #bb-mobile-more-sheet .mn-more-link.mn-more-login {
    margin-top: 6px;
    background: #6E8A7E;
    color: #FFFEFB;
  }

  #bb-mobile-more-sheet .mn-more-link.mn-more-login:hover {
    background: #5C7A6E;
  }

  #bb-mobile-more-sheet .mn-more-link.mn-more-login .mn-more-icon {
    color: #FFFEFB;
    stroke: #FFFEFB;
  }

  #bb-mobile-more-sheet .mn-more-link.mn-more-login .mn-more-icon svg {
    color: #FFFEFB;
    stroke: #FFFEFB;
  }

  .bb-lang-flyout.s-lang-list {
    z-index: 9010;
  }

  body.has-mn-bar .main,
  body.has-mn-bar .main-content,
  body.has-mn-bar .app {
    padding-bottom: calc(var(--mn-bar-height) + 16px);
  }

  body:has(#bb-mobile-nav) .bb-mkt-drawer-trigger,
  body.has-mn-bar .bb-mkt-drawer-trigger,
  body:has(#bb-mobile-nav) .bb-mkt-sidebar-overlay,
  body.has-mn-bar .bb-mkt-sidebar-overlay {
    display: none !important;
    pointer-events: none !important;
  }

  [data-theme="dark"] #bb-mobile-nav {
    background: rgba(32, 27, 24, 0.97);
    border-top-color: rgba(232, 224, 216, 0.06);
    box-shadow: 0 -4px 20px rgba(18, 16, 14, 0.4);
  }

  [data-theme="dark"] #bb-mobile-nav .mn-tab {
    color: rgba(232, 224, 216, 0.45) !important;
    text-decoration: none !important;
  }
  [data-theme="dark"] #bb-mobile-nav .mn-tab-label {
    color: rgba(232, 221, 212, 0.78) !important;
  }

  [data-theme="dark"] #bb-mobile-nav .mn-tab.is-active,
  [data-theme="dark"] #bb-mobile-nav .mn-tab.is-active .mn-tab-label {
    color: #E8DDD4 !important;
  }

  [data-theme="dark"] #bb-mobile-nav .mn-tab.is-active .mn-tab-icon {
    background: rgba(212, 168, 154, 0.12);
  }

  [data-theme="dark"] #bb-mobile-nav .mn-tab:focus-visible {
    outline: none;
  }

  [data-theme="dark"] #bb-mobile-nav .mn-badge {
    background: var(--rose-dark, #9B6050);
    color: #FFFEFB;
  }

  [data-theme="dark"] .mn-fab-mini {
    background: rgba(42, 38, 34, 0.95);
    color: #E8DDD4;
    box-shadow: 0 2px 8px rgba(18, 16, 14, 0.3), 0 8px 24px rgba(18, 16, 14, 0.2);
  }

  [data-theme="dark"] .mn-more-backdrop {
    background: rgba(18, 16, 14, 0.46);
  }

  [data-theme="dark"] .mn-more-sheet {
    border-color: rgba(232, 224, 216, 0.08);
    background: #201B18;
    box-shadow: 0 8px 32px rgba(18, 16, 14, 0.48);
  }

  [data-theme="dark"] .mn-more-handle {
    background: rgba(232, 221, 212, 0.18);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-group-header {
    color: rgba(232, 221, 212, 0.58);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link {
    color: #E8DDD4;
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-icon,
  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-icon svg {
    color: rgba(232, 221, 212, 0.66);
    stroke: rgba(232, 221, 212, 0.66);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link:hover {
    background: rgba(232, 221, 212, 0.06);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-status[data-lang-selector-label] {
    border-color: rgba(232, 221, 212, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(232, 221, 212, 0.72);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.mn-more-login {
    background: #6E8A7E;
    color: #FFFEFB;
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.mn-more-login:hover {
    background: #7C9A8E;
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.mn-more-login .mn-more-icon,
  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.mn-more-login .mn-more-icon svg {
    color: #FFFEFB;
    stroke: #FFFEFB;
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link[aria-current="page"] {
    background: rgba(124, 184, 164, 0.14);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.is-active {
    background: rgba(124, 184, 164, 0.14);
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link[aria-current="page"] .mn-more-icon,
  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.is-active .mn-more-icon,
  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link[aria-current="page"] .mn-more-icon svg,
  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link.is-active .mn-more-icon svg {
    color: #BFE1D4;
    stroke: #BFE1D4;
  }

  [data-theme="dark"] #bb-mobile-more-sheet .mn-more-link:focus-visible {
    outline-color: #BFE1D4;
  }

  @media (orientation: landscape) and (max-height: 500px) {
    :root {
      --mn-bar-height: calc(44px + env(safe-area-inset-bottom, 0px));
    }

    #bb-mobile-nav {
      height: var(--mn-bar-height);
      padding: 2px 4px env(safe-area-inset-bottom, 0px);
    }

    #bb-mobile-nav .mn-tab {
      flex-direction: row;
      gap: 6px;
      padding: 4px 8px;
    }

    #bb-mobile-nav .mn-tab-label {
      font-size: var(--font-size-sm);
    }

    #bb-mobile-nav .mn-tab-icon {
      height: 24px;
    }

    #bb-mobile-nav .mn-tab-icon svg {
      width: 20px;
      height: 20px;
    }

    #bb-mobile-nav .mn-tab.is-active .mn-tab-icon {
      padding: 2px 10px;
    }

    .mn-fab-group {
      bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }

    .mn-fab {
      height: 44px;
      padding: 0 16px;
      font-size: var(--font-size-sm);
    }

    /* BDA exception: landscape is temporary and aria-label preserves action text. */
    .mn-fab-label {
      display: none;
    }

    .mn-fab-mini {
      width: 44px;
      height: 44px;
    }

    .mn-more-sheet {
      left: 8px;
      right: 8px;
      bottom: calc(var(--mn-bar-height) + 6px);
      padding: 6px;
      border-radius: 16px;
    }

    .mn-more-handle {
      display: none;
    }

    .mn-more-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
    }

    .mn-more-link {
      min-height: 44px;
      padding: 6px;
      gap: 6px;
      font-size: var(--font-size-xs);
      justify-content: center;
    }

    .mn-more-icon {
      width: 32px;
      height: 32px;
      border-radius: 12px;
    }

    .mn-more-icon svg {
      width: 19px;
      height: 19px;
    }

    body.has-mn-bar .main,
    body.has-mn-bar .main-content,
    body.has-mn-bar .app {
      padding-bottom: calc(var(--mn-bar-height) + 12px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    #bb-mobile-nav .mn-tab,
    #bb-mobile-nav .mn-tab-icon,
    .mn-fab,
    .mn-fab-mini,
    .mn-fab-group,
    .mn-more-link,
    .mn-more-sheet,
    .mn-more-backdrop {
      transition: none !important;
    }
  }
}

@media (min-width: 768px) {
  #bb-mobile-nav,
  .mn-fab-group,
  .mn-more-backdrop,
  .mn-more-sheet {
    display: none !important;
  }
}

button.mn-more-link {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
}

@media print {
  #bb-mobile-nav,
  .mn-fab-group,
  .mn-more-backdrop,
  .mn-more-sheet {
    display: none !important;
  }
}
