/* nav.css */
.home-header {
  position: fixed;
  top: 16px;
  left: 50%;
  right: auto;
  width: min(var(--container-width), 94vw);
  transform: translateX(-50%);
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 18px 40px var(--shadow-color);
  backdrop-filter: blur(18px);
}

.bottom-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  width: min(var(--container-width), 94vw);
  transform: translateX(-50%);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 10px 14px;
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 18px 40px var(--shadow-color);
  backdrop-filter: blur(12px);
  flex-wrap: nowrap;
}

.bottom-bar .nav-link {
  flex-direction: column;
  gap: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  padding: 6px 8px;
  min-width: 58px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand.is-active .brand-mark {
  box-shadow: 0 0 0 2px rgba(122, 61, 255, 0.35), 0 12px 28px var(--shadow-color);
  border-radius: 18px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.brand-mark img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  border-radius: 1.2rem;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  justify-content: center;
  overflow: visible;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.nav-link.nav-action {
  border: 1px solid rgba(122, 61, 255, 0.35);
  background: rgba(122, 61, 255, 0.16);
  color: var(--text-color);
}

.nav-link.nav-action:hover {
  background: rgba(122, 61, 255, 0.24);
  border-color: rgba(122, 61, 255, 0.5);
}

.nav-link:hover {
  color: var(--text-color);
  /* background: rgba(122, 61, 255, 0.1); */
}

.home-nav .nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
  border-radius: 999px;
}


.nav-link::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-nav .nav-link::before {
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  bottom: -6px;
}

.home-nav .nav-link.is-active::before {
  background: var(--accent-color);
  opacity: 1;
  box-shadow: 0 0 10px rgba(122, 61, 255, 0.8);
}

.home-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
  transition: width 0.3s ease;
  border-radius: 999px;
}

.home-nav .nav-link:hover::after {
  width: 100%;
}

.nav-link i {
  font-size: 0.9rem;
}

.nav-link span {
  display: inline-block;
}

.bottom-bar .nav-link i {
  font-size: 0.88rem;
}

.bottom-bar .nav-link.is-active,
.bottom-bar .nav-link:hover {
  /* background: rgba(122, 61, 255, 0.18); */
  /* border-color: rgba(122, 61, 255, 0.4); */
  transform: translateY(-1px);
}

.bottom-bar .nav-link.is-active {
  box-shadow: none;
}

.bottom-bar .nav-link::before {
  top: 6px;
  right: 10px;
  transform: scale(0.8);
}

.bottom-bar .nav-link.is-active::before {
  background: var(--accent-color);
  opacity: 1;
  box-shadow: 0 0 10px rgba(122, 61, 255, 0.8);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-self: end;
}

.notify-wrap {
  position: relative;
}

.notify-trigger {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
}

.notify-trigger i {
  font-size: 1rem;
}

.notify-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.62rem;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 12px rgba(12, 6, 28, 0.3);
}

.notify-count.is-hidden {
  display: none;
}

.notify-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, 92vw);
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 18px 36px var(--shadow-color);
  padding: 10px;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 25;
}

.notify-wrap.is-open .notify-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 768px) {
  .notify-menu {
    left: 50%;
    right: auto;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    transform: translate(-50%, -6px);
  }

  .notify-wrap.is-open .notify-menu {
    transform: translate(-50%, 0);
  }
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notify-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.notify-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.notify-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: var(--surface-2);
  color: var(--text-color);
  text-decoration: none;
}

.notify-item .notify-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.notify-item .notify-text {
  font-size: 0.82rem;
}

.notify-item.is-unread {
  border-color: rgba(122, 61, 255, 0.4);
  background: rgba(122, 61, 255, 0.12);
}

.notify-item.is-unread .notify-meta {
  color: var(--accent-color);
}

.notify-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 6px;
}

html[dir="rtl"] .notify-menu {
  right: auto;
  left: 0;
}

@media (max-width: 768px) {
  html[dir="rtl"] .notify-menu {
    left: 50%;
    right: auto;
    transform: translate(-50%, -6px);
  }

  html[dir="rtl"] .notify-wrap.is-open .notify-menu {
    transform: translate(-50%, 0);
  }
}

html[dir="rtl"] .notify-count {
  right: auto;
  left: -4px;
}

/* Language switcher */
.lang-switch {
  position: relative;
}

.lang-switch summary {
  list-style: none;
}

.lang-switch summary::-webkit-details-marker {
  display: none;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(5, 0, 8, 0.12);
  color: var(--text-color);
}

.lang-label {
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lang-icon {
  font-size: 1rem;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    max-height: min(260px, 60vh);
    overflow-y: auto;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 32px var(--shadow-color);
    padding: 8px;
  display: grid;
  gap: 4px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 20;
}

.lang-switch[open] .lang-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover,
.lang-option.is-active {
  background: var(--surface-3);
  color: var(--accent-color);
}

.lang-switch .lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch .lang-option .fi,
.lang-switch summary .fi {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.lang-switch .lang-text {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}

.currency-switch .lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.12em;
}

.currency-switch .lang-option .fi,
.currency-switch summary .fi {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.currency-switch .currency-code {
  font-size: 0.72rem;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--surface-1);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 1.1rem;
}

/* RTL nav tweaks */
html[dir="rtl"] .brand-name,
html[dir="rtl"] .brand-tag,
html[dir="rtl"] .nav-link {
  letter-spacing: normal;
  text-transform: none;
}

html[dir="rtl"] .nav-link.is-active::after {
  left: auto;
  right: 0;
}

html[dir="rtl"] .lang-menu {
  right: 0;
  left: auto;
}

html[dir="rtl"] .lang-option {
  text-align: right;
}

html[dir="rtl"] .header-actions {
  justify-self: start;
}

html[dir="rtl"] .home-header {
  direction: rtl;
}

@media (max-width: 1100px) {
  :root {
    --nav-height: 150px;
  }

  .home-header {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 16px 18px;
  }

  .header-actions {
    justify-content: center;
  }

  .home-nav {
    gap: 12px;
  }

  .home-nav .nav-link {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    padding: 6px 8px;
  }
}

@media (max-width: 1024px) {
  .home-header {
    padding: 12px 16px;
    gap: 14px;
  }

  .home-nav {
    gap: 10px;
  }

  .home-nav .nav-link {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    padding: 6px;
  }

  .home-nav .nav-link span {
    display: inline-block;
    white-space: nowrap;
  }

  .btn-signin {
    padding: 9px 12px;
    font-size: 0.65rem;
    letter-spacing: 0.16em;
  }

  .brand-name {
    display: none;
  }
}

@media (max-width: 980px) {
  .home-nav {
    gap: 10px;
  }

  .home-nav .nav-link {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    padding: 6px 7px;
  }
}

@media (max-width: 860px) {
  .home-nav {
    gap: 8px;
  }

  .home-nav .nav-link {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    padding: 6px 6px;
  }
}

@media (max-width: 900px) {
  .home-nav {
    gap: 6px;
  }

  .home-nav .nav-link {
    padding: 6px;
  }

  .home-nav .nav-link span {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .home-header .home-nav {
    display: none;
  }

  .bottom-bar {
    display: flex;
    width: min(560px, 90vw);
    gap: 30px;
  }

  .header-actions {
    margin-left: auto;
    justify-content: flex-end;
  }

  .btn-signin {
    display: none;
  }

  .page-wrapper {
    padding-bottom: 160px;
  }
}

@media (max-width: 768px) {
  html[dir="rtl"] .header-actions {
    margin-left: 0;
    margin-right: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  :root {
    --nav-height: 168px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 190px;
  }

  .home-header {
    padding: 14px 16px;
  }

  .home-nav {
    justify-content: center;
  }

  .bottom-bar {
    bottom: 12px;
    padding: 8px 8px;
  }

  .lang-label {
    display: none;
  }

  .btn-signin {
    padding: 10px 12px;
  }

  .theme-toggle,
  .lang-trigger {
    width: 40px;
    height: 40px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .lang-menu {
    right: 0;
    left: auto;
    min-width: 150px;
    width: max-content;
    max-width: calc(100vw - 32px);
  }

  html[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
  }
}

@media (max-width: 768px) and (min-width: 641px) {
  .bottom-bar {
    gap: 50px;
  }

  .bottom-bar .nav-link {
    padding: 8px 10px;
  }
}



@media (max-width: 360px) {
  .home-header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand-mark img {
    width: 44px;
    height: 44px;
  }

  .header-actions {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .btn-signin {
    padding: 8px 10px;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }

  .theme-toggle,
  .lang-trigger {
    width: 36px;
    height: 36px;
  }

  .bottom-bar {
    gap: 4px;
    padding: 6px 6px;
  }

  .bottom-bar .nav-link {
    min-width: 48px;
    padding: 6px 4px;
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }

  .bottom-bar .nav-link span {
    display: none;
  }

  .bottom-bar .nav-link i {
    font-size: 0.95rem;
  }
}

@media (max-width: 479px){
  .brand-name{
    font-size: 14px;
  }
  .header-actions{
    align-items: center;
    align-content: center;
    align-self: center;
  }
}
/* @media (max-width: 1227px) {
  .brand-name{
    display: none;
  }
} */
