/* ── Header: main menu with dropdowns, bell, cart, account ── */
.topbar .wrap { gap: 12px; }
.top-actions { flex: none; }
.topnav { display: none; flex: 1; min-width: 0; justify-content: center; }
.menu-btn { display: grid; }
.dd-account { display: none; }
@media (min-width: 900px) {
	.topnav { display: flex; }
	.menu-btn { display: none; }
	.dd-account { display: block; }
}

/* Menu */
.topnav-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.topnav-item { position: relative; display: flex; align-items: center; }
.topnav-item > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.topnav-item > a:hover, .topnav-item > a[aria-current="page"] { color: var(--text); }
.sub-toggle { display: grid; place-items: center; width: 28px; height: 44px; margin-left: -8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.sub-toggle:hover { color: var(--text); }
.sub-toggle svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s; }
.has-sub.is-open .sub-toggle svg { transform: rotate(-90deg); }
.sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 45; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 16, 36, .18); }
.has-sub.is-open > .sub-menu { display: block; }
@media (hover: hover) { .has-sub:hover > .sub-menu { display: block; } .has-sub:hover .sub-toggle svg { transform: rotate(-90deg); } }
.sub-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; white-space: nowrap; }
.sub-menu a:hover, .sub-menu a[aria-current="page"] { background: var(--surface); color: var(--link); }

/* Dropdowns: bell, cart, account */
.dd { position: relative; }
.dd-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 320px; max-width: calc(100vw - 16px); max-height: calc(100vh - 100px); overflow-y: auto; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(15, 16, 36, .18); }
.dd-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--link); font: 600 .85rem var(--b); cursor: pointer; }
.dd-list { margin: 0; padding: 0; list-style: none; display: grid; }
.dd-list a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
.dd-list a:hover { background: var(--surface); }
.dd-list .dd-note { display: grid; gap: 2px; }
.dd-note span { color: var(--muted); font-size: .88rem; font-weight: 400; }
.dd-note small { color: var(--muted); font-size: .75rem; }
.dd-note.is-unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }
.dd-empty { padding: 10px 12px 14px; color: var(--muted); font-size: .92rem; }
.dd-foot { display: block; margin-top: 4px; padding: 12px; border-top: 1px solid var(--line); color: var(--link); font-weight: 600; text-align: center; }
.dd-who { padding: 8px 12px 10px; color: var(--muted); font-size: .88rem; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dd-who b { display: block; color: var(--text); font-size: 1rem; overflow-wrap: anywhere; }
.dd-mode { padding: 10px 12px 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.dd-mode .theme-switch { margin-top: 6px; }
.dd-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.dd-line small { color: var(--muted); }
.dd-total { display: flex; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line); }
.dd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 4px 6px; }
.dd-actions .btn { min-height: 44px; padding: 0 10px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--indigo); color: #fff; font: 700 .85rem var(--h); }

/* Colour mode switch (account menu and phone menu) */
.theme-switch.is-wide { display: flex; }
.theme-switch.is-wide button { flex: 1; min-height: 40px; font-size: .9rem; }
.menu-sheet .theme-switch, .sheet-panel > .theme-switch { margin: 8px 0 18px; }

/* Phone menu: rows that expand */
.menu-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.menu-row a { flex: 1; border-bottom: 0; }
.menu-expand { display: grid; place-items: center; width: 52px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.menu-expand svg { width: 18px; height: 18px; transform: rotate(90deg); transition: transform .15s; }
.menu-expand[aria-expanded="true"] svg { transform: rotate(-90deg); }
.menu-sub { display: grid; padding-left: 16px; background: var(--surface); }
.menu-sub a { font-weight: 500; }

/* Phones: panels span the screen under the header (the header is the positioned parent) */
@media (max-width: 599px) {
	.dd { position: static; }
	.dd-panel { left: 8px; right: 8px; top: 100%; width: auto; max-width: none; margin-top: 4px; max-height: calc(100vh - 140px); }
}
@media (prefers-reduced-motion: reduce) { .sub-toggle svg, .menu-expand svg { transition: none; } }
