/* Notification bell (nav) + the inbox list. Wrapped in @layer components to sit
   in the same cascade tier as the rest of the UI (see application.css). */
@layer components {
  /* ── Nav control (Enable button ↔ bell) ───────────────────────────────── */
  .notif-nav {
    display: inline-flex;
    align-items: center;
  }

  /* The Stimulus controller swaps these by toggling [hidden]. Their own
     display (.app-nav__bell inline-flex) would otherwise beat the UA [hidden]
     rule and leave both showing — so keep [hidden] authoritative here, the
     same way the cart toggle and overlays do. */
  [data-push-subscriptions-target][hidden] { display: none; }

  /* Worn by both the inbox link and the enable <button> (bell + "?" badge). */
  .app-nav__bell {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    padding: 0.25rem;
    transition: opacity 0.15s ease, filter 0.15s ease;
  }

  /* Subscribed but nothing unread: present but visibly inactive. */
  .app-nav__bell--idle {
    opacity: 0.45;
    filter: grayscale(1);
  }

  .app-nav__bell--idle:hover {
    opacity: 0.7;
  }

  .app-nav__bell-count {
    position: absolute;
    top: -0.35rem;
    right: -0.45rem;
    min-width: 1.1rem;
    padding: 0 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
    color: #fff;
    background: #c0392b;
    border-radius: 999px;
  }

  /* ── Inbox ────────────────────────────────────────────────────────────── */
  .notif-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
  }

  .notif-head__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .notif-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .notif {
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
  }

  .notif--unread {
    border-color: var(--accent, #4aa);
    background: rgba(74, 170, 170, 0.08);
  }

  .notif__link {
    display: grid;
    gap: 0.15rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: inherit;
  }

  .notif__title { font-weight: 600; }
  .notif__body  { font-size: 0.9rem; }
  .notif__time  { font-size: 0.78rem; }
}
