/* Header: fixed set of links; the right side changes with the page (download vs cart and favourites). */
.nav-links > .nav-tab, .nav-templates > .nav-tab { padding: 8px 14px; border-radius: 999px; color: #3f434b; font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 160ms ease, color 160ms ease; }
.nav-links > .nav-tab:hover, .nav-templates:hover, .nav-templates:has(.nav-more[open]) { background: rgba(26, 26, 26, .06); color: var(--color-text); }
.nav-links > .nav-tab[aria-current] , .nav-templates:has(.nav-tab[aria-current]) { background: rgba(244, 193, 54, .38); color: var(--color-text); }
.nav-templates > .nav-tab { background: transparent !important; }
.nav-templates { position: relative; display: flex; align-items: center; border-radius: 999px; transition: background-color 160ms ease; }
.nav-templates > .nav-tab { padding-right: 4px; }
.nav-more { position: static; }
.nav-more-toggle { display: flex; width: 30px; height: 34px; align-items: center; justify-content: center; padding-right: 6px; cursor: pointer; list-style: none; color: #3f434b; }
.nav-more-toggle::-webkit-details-marker { display: none; }
.nav-more-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }
.nav-more[open] > .nav-more-toggle svg { transform: rotate(180deg); }
.nav-more .store-nav-panel { top: calc(100% + 18px); left: -6px; width: 280px; }
.store-nav-library { background: var(--color-bg-light); }
.store-nav-all { color: var(--color-accent-dark); }
.store-nav-divider { display: block; height: 1px; margin: 8px 10px; background: rgba(127, 121, 107, .18); }
.nav-actions--studio > .button.small { order: -1; background: transparent; box-shadow: none; color: var(--color-text-muted); font-size: 14px; font-weight: 700; }
.nav-actions--studio > .button.small:hover { background: rgba(26, 26, 26, .05); color: var(--color-text); box-shadow: none; transform: none; }
.nav-tab:focus-visible, .nav-more-toggle:focus-visible, .nav-download:focus-visible { outline: 2px solid var(--color-accent-dark); outline-offset: 2px; }

/* Shared store entry points stay available on marketing and account pages. */
.store-nav-menu summary, .store-mobile-categories summary { list-style: none; }
[data-store-menu][open] > summary svg { transform: rotate(180deg); }
.store-nav-panel { position: absolute; z-index: 35; max-height: min(520px, 75svh); overflow-y: auto; border-radius: 20px; padding: 10px; background: var(--color-paper); color: var(--color-text); box-shadow: 0 20px 56px rgba(30, 28, 23, .17); }
.store-nav-category { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--color-text); font-size: 14px; font-weight: 650; line-height: 1.45; text-decoration: none; white-space: normal; }
.store-nav-category span { flex: 0 0 auto; color: #8c857a; font-size: 12px; font-weight: 500; }
.store-nav-category:hover { background: var(--color-bg-light); color: var(--color-text); }
.store-nav-icon { position: relative; display: inline-flex; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 999px; color: var(--color-text); text-decoration: none; transition: background-color 160ms ease, transform 160ms ease; }
.store-nav-icon > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.store-nav-icon:hover { background: rgba(26, 26, 26, .06); transform: translateY(-1px); }
.store-nav-icon:active { transform: scale(.95); }
.store-nav-count { position: absolute; top: 1px; right: 0; display: inline-flex; min-width: 17px; height: 17px; align-items: center; justify-content: center; padding: 0 4px; border-radius: 999px; background: var(--color-accent); color: var(--color-text); font-size: 10px; font-weight: 800; line-height: 1; }
.store-nav-count[hidden] { display: none; }
.store-nav-icon:focus-visible, .store-nav-category:focus-visible, .mobile-section-summary:focus-visible { outline: 2px solid var(--color-accent-dark); outline-offset: 3px; }

/* Mobile menu: the two sections are an accordion. */
.mobile-section > summary { list-style: none; cursor: pointer; justify-content: space-between; }
.mobile-section > summary::-webkit-details-marker { display: none; }
.mobile-section > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }
.mobile-section[open] > summary svg { transform: rotate(180deg); }
.mobile-section[open] > summary { background: var(--color-bg-light); }
.mobile-section-links { display: grid; gap: 2px; max-height: 42svh; overflow-y: auto; padding: 4px 0 6px 12px; }
.mobile-section-links .mobile-menu-link { min-height: 40px; font-weight: 600; justify-content: space-between; }
.mobile-count { color: #8c857a; font-size: 12px; font-weight: 500; }

@media (max-width: 1180px) {
  .nav { gap: 12px; padding: 0 10px 0 18px; }
  .nav-links { display: none; }
  .brand { flex: 1; min-width: 0; }
  .mobile-menu { display: inline-flex; }
  .nav-actions { gap: 6px; }
  .mobile-menu-panel { max-height: calc(100svh - var(--header-offset) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .account-popover { right: -42px; }
}

@media (max-width: 600px) {
  .nav { height: 56px; gap: 8px; }
  .brand-logo { width: 132px; }
  .nav-actions { gap: 4px; }
  .nav-download { min-height: 36px; padding: 0 14px; font-size: 13px; }
  .nav-actions > .button.small { padding: 8px 12px; font-size: 13px; }
  .store-nav-icon { width: 36px; height: 38px; flex-basis: 36px; }
  .account-popover { right: -40px; }
}

@media (max-width: 359px) {
  .brand-logo { width: 104px; }
  .nav { padding-left: 14px; }
  .nav-actions { gap: 2px; }
  .nav-download { padding: 0 10px; }
  .store-nav-icon { width: 32px; flex-basis: 32px; }
  .nav-actions > .button.small { padding-right: 9px; padding-left: 9px; }
  .account-popover { right: -38px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-section > summary svg, .store-nav-icon { transition: none; }
}

/* Confirmation dialog (sign out). */
.confirm-dialog { width: min(380px, calc(100vw - 32px)); border: 0; border-radius: 26px; background: var(--color-paper); color: var(--color-text); box-shadow: 0 30px 80px rgba(30, 28, 23, .28); padding: 28px; text-align: center; }
.confirm-dialog::backdrop { background: rgba(26, 26, 26, .38); backdrop-filter: blur(4px); }
.confirm-dialog h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; text-transform: none; }
.confirm-dialog p { margin: 6px 0 0; color: var(--color-text-muted); font-size: 14px; overflow-wrap: anywhere; }
.confirm-dialog-actions { display: grid; gap: 10px; margin-top: 22px; }
.confirm-dialog-actions button { min-height: 46px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 800; }
.confirm-dialog-primary { background: var(--color-accent); color: var(--color-text); }
.confirm-dialog-secondary { background: var(--color-bg-light); color: var(--color-text); }
.confirm-dialog-actions button:focus-visible { outline: 2px solid var(--color-accent-dark); outline-offset: 2px; }
