/* Shared navigation shell for standalone E-Bazarche platform pages. */
.topnav[data-ebz-shell] {
  position: fixed;
  inset: 0 0 auto;
  z-index: 55;
  height: var(--ebz-shell-height);
  min-height: var(--ebz-shell-height);
  box-sizing: border-box;
  background: var(--ebz-color-nav);
  color: var(--ebz-color-text);
  border-bottom: 1px solid var(--ebz-color-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topnav[data-ebz-shell] .nav-inner {
  width: min(100%, var(--ebz-content-max));
  height: calc(var(--ebz-shell-height) - 1px);
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav[data-ebz-shell] :is(a, button):focus-visible {
  outline: none;
  box-shadow: var(--ebz-focus-ring);
}

.topnav[data-ebz-shell] .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: 12px;
  color: var(--ebz-color-text);
  text-decoration: none;
  font: 900 1rem/1 var(--ebz-font-family);
  white-space: nowrap;
}

.topnav[data-ebz-shell] .nav-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topnav[data-ebz-shell] .ebz-rich-icon {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(31, 28, 61, .14));
  transition: transform .2s cubic-bezier(.2,.9,.25,1.25), filter .2s ease;
}

.topnav[data-ebz-shell] :is(a, button):hover > .ebz-rich-icon,
.topnav[data-ebz-shell] :is(a, button):focus-visible > .ebz-rich-icon {
  transform: translateY(-1px) scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 3px 3px rgba(31, 28, 61, .2));
}

.topnav[data-ebz-shell] .nav-links {
  min-width: 0;
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.topnav[data-ebz-shell] .nav-link,
.topnav[data-ebz-shell] .nav-gear {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 11px;
  border: 0;
  border-radius: var(--ebz-radius-md);
  background: transparent;
  color: var(--ebz-color-text-secondary);
  text-decoration: none;
  font: 750 0.86rem/1 var(--ebz-font-family);
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .18s cubic-bezier(.2,.9,.25,1.2);
}

.topnav[data-ebz-shell] .nav-link:hover,
.topnav[data-ebz-shell] .nav-link.on,
.topnav[data-ebz-shell] .nav-gear:hover {
  background: var(--ebz-color-surface-muted);
  color: var(--ebz-color-primary-hover);
  transform: translateY(-1px);
}

.topnav[data-ebz-shell] .nav-link.on {
  font-weight: 850;
}

.topnav[data-ebz-shell] .dd {
  position: relative;
}

.topnav[data-ebz-shell] .nav-chevron {
  transition: transform 0.15s ease;
}

.topnav[data-ebz-shell] .dd.open .nav-chevron {
  transform: rotate(180deg);
}

.topnav[data-ebz-shell] .dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  z-index: 57;
  width: 300px;
  padding: 6px;
  border: 1px solid var(--ebz-color-border);
  border-radius: var(--ebz-radius-lg);
  background: var(--ebz-color-surface);
  color: var(--ebz-color-text);
  box-shadow: var(--ebz-shadow-menu);
  animation: ebz-shell-menu-in 0.14s ease;
}

.topnav[data-ebz-shell] .dd.open .dd-menu {
  display: block;
}

.topnav[data-ebz-shell] .dd-item {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--ebz-radius-md);
  color: var(--ebz-color-text);
  text-align: start;
  text-decoration: none;
  border: 1px solid transparent;
  animation: ebz-shell-item-in .28s cubic-bezier(.2,.85,.25,1) both;
  transition: background-color .2s ease, border-color .2s ease, transform .22s cubic-bezier(.2,.9,.25,1.2), box-shadow .22s ease;
}
.topnav[data-ebz-shell] .dd-item:nth-child(2) { animation-delay: .025s; }
.topnav[data-ebz-shell] .dd-item:nth-child(3) { animation-delay: .05s; }
.topnav[data-ebz-shell] .dd-item:nth-child(4) { animation-delay: .075s; }
.topnav[data-ebz-shell] .dd-item:nth-child(5) { animation-delay: .1s; }

.topnav[data-ebz-shell] .dd-item.on {
  background: var(--ebz-color-surface-soft);
  box-shadow: inset -3px 0 0 var(--ebz-color-primary);
}

.topnav[data-ebz-shell] .dd-item:hover,
.topnav[data-ebz-shell] .dd-item:focus-visible {
  background: var(--ebz-color-surface-soft);
  border-color: var(--ebz-color-primary);
  transform: translateY(-3px);
  box-shadow: 0 9px 22px color-mix(in srgb, var(--ebz-color-primary) 16%, transparent);
  outline: none;
}

.topnav[data-ebz-shell] .dd-item.soon {
  opacity: 0.58;
  cursor: default;
}

.topnav[data-ebz-shell] .dd-ic {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--ebz-radius-md);
  color: #fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s cubic-bezier(.2,.9,.25,1.3), filter .22s ease;
}
.topnav[data-ebz-shell] .dd-ic .ebz-rich-icon { width: 32px; height: 32px; }
.topnav[data-ebz-shell] .dd-item.on .dd-ic {
  transform: scale(1.03);
}
.topnav[data-ebz-shell] .dd-item:hover .dd-ic,
.topnav[data-ebz-shell] .dd-item:focus-visible .dd-ic {
  transform: scale(1.09) rotate(-4deg);
  filter: drop-shadow(0 4px 5px rgba(31, 28, 61, .23));
}

.topnav[data-ebz-shell] .dd-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topnav[data-ebz-shell] .dd-body b {
  color: var(--ebz-color-text);
  font-size: 0.86rem;
}

.topnav[data-ebz-shell] .dd-body small {
  color: var(--ebz-color-text-muted);
  font-size: 0.71rem;
  font-weight: 700;
}

.topnav[data-ebz-shell] .dd-soon {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.62rem;
  font-weight: 900;
}

.topnav[data-ebz-shell] .nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topnav[data-ebz-shell] .action-dd {
  position: relative;
}

.topnav[data-ebz-shell] .action-dd[hidden],
.topnav[data-ebz-shell] .action-menu[hidden],
.topnav[data-ebz-shell] .action-badge[hidden],
.topnav[data-ebz-shell] #actionMarkAll[hidden] {
  display: none !important;
}

.topnav[data-ebz-shell] .action-button {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: var(--ebz-radius-md);
  background: transparent;
  color: var(--ebz-color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topnav[data-ebz-shell] .action-button:hover {
  background: var(--ebz-color-surface-muted);
  color: var(--ebz-color-primary-hover);
}

.topnav[data-ebz-shell] .action-badge {
  position: absolute;
  top: 1px;
  inset-inline-start: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--ebz-color-danger);
  color: #fff;
  font: 900 0.61rem/16px var(--ebz-font-family);
  text-align: center;
}

.topnav[data-ebz-shell] .action-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 58;
  width: 330px;
  max-height: min(520px, calc(100vh - 74px));
  overflow: auto;
  display: block;
  border: 1px solid var(--ebz-color-border);
  border-radius: var(--ebz-radius-lg);
  background: var(--ebz-color-surface);
  color: var(--ebz-color-text);
  box-shadow: var(--ebz-shadow-menu);
  animation: ebz-shell-menu-in 0.14s ease;
}

.topnav[data-ebz-shell] .action-head {
  min-height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ebz-color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topnav[data-ebz-shell] .action-head b {
  color: var(--ebz-color-text);
  font-size: 0.88rem;
}

.topnav[data-ebz-shell] #actionMarkAll {
  border: 0;
  background: transparent;
  color: var(--ebz-color-primary);
  font: 800 0.72rem/1 var(--ebz-font-family);
  cursor: pointer;
}

.topnav[data-ebz-shell] .action-list {
  display: block;
}

.topnav[data-ebz-shell] .action-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--ebz-color-border);
}

.topnav[data-ebz-shell] .action-row.unread,
.topnav[data-ebz-shell] .action-row.unread:hover {
  background: var(--ebz-color-surface-muted) !important;
}

.topnav[data-ebz-shell] .action-item {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ebz-color-text);
  text-decoration: none;
}

.topnav[data-ebz-shell] .action-item:hover {
  background: var(--ebz-color-surface-soft);
}

.topnav[data-ebz-shell] .action-row.unread .action-item,
.topnav[data-ebz-shell] .action-row.unread .action-item:hover,
.topnav[data-ebz-shell] .action-row.unread .action-delete {
  background: transparent;
}

.topnav[data-ebz-shell] .action-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: transparent;
}

.topnav[data-ebz-shell] .action-dot.on {
  background: var(--ebz-color-primary);
}

.topnav[data-ebz-shell] .action-kind {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: var(--ebz-radius-sm);
  background: var(--ebz-color-surface-muted);
  color: var(--ebz-color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topnav[data-ebz-shell] .action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topnav[data-ebz-shell] .action-copy b {
  color: var(--ebz-color-text);
  font-size: 0.82rem;
}

.topnav[data-ebz-shell] .action-copy small {
  color: var(--ebz-color-text-secondary);
  font-size: 0.73rem;
  line-height: 1.55;
}

.topnav[data-ebz-shell] .action-delete {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin-inline-end: 7px;
  padding: 0;
  border: 1px solid var(--ebz-color-border);
  border-radius: var(--ebz-radius-sm);
  background: var(--ebz-color-surface-soft);
  color: var(--ebz-color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topnav[data-ebz-shell] .action-delete:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}

.topnav[data-ebz-shell] .action-empty {
  margin: 0;
  padding: 22px 12px;
  color: var(--ebz-color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.topnav[data-ebz-shell] .action-more {
  display: block;
  padding: 9px;
  color: var(--ebz-color-primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.topnav[data-ebz-shell] .action-more:hover {
  background: var(--ebz-color-surface-soft);
}

.topnav[data-ebz-shell] .nav-gear {
  width: 38px;
  padding: 0;
}

.topnav[data-ebz-shell] .nav-cta {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--ebz-radius-md);
  background: var(--ebz-color-primary);
  color: #fff;
  text-decoration: none;
  font: 800 0.84rem/1 var(--ebz-font-family);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.topnav[data-ebz-shell] .nav-cta:hover {
  background: var(--ebz-color-primary-hover);
}

.topnav[data-ebz-shell] svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes ebz-shell-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
}
@keyframes ebz-shell-item-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
}

@media (max-width: 1024px) {
  .topnav[data-ebz-shell] .dd-menu {
    width: min(360px, calc(100vw - 20px));
    gap: 4px;
  }

  .topnav[data-ebz-shell] .dd.open .dd-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topnav[data-ebz-shell] .dd-item {
    position: relative;
    min-width: 0;
    min-height: 58px;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    padding: 7px 5px;
    text-align: start;
  }

  .topnav[data-ebz-shell] .dd-item.on {
    box-shadow: inset 0 -3px 0 var(--ebz-color-primary);
  }

  .topnav[data-ebz-shell] .dd-ic {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    border-radius: 7px;
  }

  .topnav[data-ebz-shell] .dd-body {
    width: auto;
    flex: 0 1 auto;
    align-items: flex-start;
  }

  .topnav[data-ebz-shell] .dd-body b {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topnav[data-ebz-shell] .dd-body small {
    display: none;
  }

  .topnav[data-ebz-shell] .dd-soon {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    padding: 2px 4px;
    font-size: 0.49rem;
  }
}

@media (max-width: 620px) {
  .topnav[data-ebz-shell] .nav-inner { padding: 0 10px; }
  .topnav[data-ebz-shell] .nav-brand { margin-inline-end: 2px; font-size: 0.9rem; }
  .topnav[data-ebz-shell] .nav-link { padding-inline: 8px; font-size: 0.8rem; }
  .topnav[data-ebz-shell] .nav-home-text { display: none; }
  .topnav[data-ebz-shell] .nav-cta { width: 38px; padding: 0; }
  .topnav[data-ebz-shell] .nav-cta-text { display: none; }
  .topnav[data-ebz-shell] .action-menu { width: min(330px, calc(100vw - 20px)); }
}

@media (max-width: 380px) {
  .topnav[data-ebz-shell] .nav-brand-text { display: none; }
  .topnav[data-ebz-shell] .nav-brand { margin-inline-end: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .topnav[data-ebz-shell] *,
  .topnav[data-ebz-shell] *::before,
  .topnav[data-ebz-shell] *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .topnav[data-ebz-shell] :is(.dd-item, .dd-ic, .nav-link, .nav-gear, .nav-cta) {
    transition-duration: .2s !important;
  }
}
