﻿:root {
  --cyrus-home-header-height: 76px;
  --header-height: var(--cyrus-home-header-height);
  --cyrus-home-header-max: 1416px;
  --cyrus-home-header-bg: rgba(16, 20, 35, 0.72);
  --cyrus-home-header-text: #fff;
  --cyrus-home-header-control: rgba(255, 255, 255, 0.055);
  --cyrus-home-header-control-border: rgba(203, 213, 225, 0.18);
}

:root[data-theme="light"] {
  --cyrus-home-header-bg: rgba(243, 231, 225, 0.72);
  --cyrus-home-header-text: #111827;
  --cyrus-home-header-control: rgba(255, 255, 255, 0.42);
  --cyrus-home-header-control-border: rgba(17, 24, 39, 0.22);
}

.home-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--cyrus-home-header-height);
  background: var(--cyrus-home-header-bg);
  border-bottom: 0;
  color: var(--cyrus-home-header-text);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.home-header.is-scrolled {
  background: rgba(16, 20, 35, 0.82);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
}

:root[data-theme="light"] .home-header.is-scrolled {
  background: rgba(243, 231, 225, 0.84);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.08);
}

.home-header-nav {
  display: grid;
  grid-template-areas: "links brand actions";
  grid-template-columns: minmax(360px, 1fr) 116px minmax(360px, 1fr);
  align-items: center;
  width: min(var(--cyrus-home-header-max), calc(100% - 56px));
  height: var(--cyrus-home-header-height);
  margin: 0 auto;
  column-gap: 28px;
}

html[dir="rtl"] .home-header-nav {
  grid-template-areas: "links brand actions";
  grid-template-columns: minmax(360px, 1fr) 116px minmax(360px, 1fr);
  column-gap: 28px;
}

.home-nav-links,
.home-header-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.home-mobile-menu-toggle,
.home-mobile-menu {
  display: none;
}

.home-nav-links {
  grid-area: links;
  justify-self: start;
  justify-content: flex-start;
  gap: clamp(18px, 1.65vw, 30px);
}

html[dir="rtl"] .home-nav-links {
  justify-self: start;
  justify-content: flex-start;
  gap: clamp(18px, 1.65vw, 30px);
}

.home-header-actions {
  grid-area: actions;
  justify-self: end;
  justify-content: flex-end;
  gap: 14px;
  direction: ltr;
}

html[dir="rtl"] .home-header-actions {
  justify-self: end;
  justify-content: flex-end;
  gap: 14px;
  direction: ltr;
  flex-direction: row-reverse;
}

/* .home-brand {
  grid-area: brand;
  justify-self: center;
  width: 76px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
} */

.home-brand {
  grid-area: brand;
  justify-self: center;
  width: 156px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.96;
  text-decoration: none;
}

html[dir="rtl"] .home-nav-link {
  font-size: 16px;
}

html[dir="rtl"] .home-nav-menu-button[data-i18n="nav_help"]::after {
  margin-inline-start: 4px;
}

.home-nav-menu-button[data-i18n="nav_help"]::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-inline-start: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.75;
}

.home-icon-button,
.home-login-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--cyrus-home-header-control-border);
  background: var(--cyrus-home-header-control);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.home-icon-button {
  width: 40px;
  border-radius: 999px;
  color: #cfc3e8;
}

.home-icon-button svg {
  width: 19px;
  height: 19px;
  display: block;
}

:root[data-theme="light"] .home-icon-button,
:root[data-theme="light"] .home-login-button {
  border-color: rgba(17, 24, 39, 0.42);
  background: rgba(255, 255, 255, 0.34);
  color: #111827;
}

:root[data-theme="light"] .home-icon-button:hover,
:root[data-theme="light"] .home-login-button:hover {
  border-color: rgba(17, 24, 39, 0.64);
  background: rgba(255, 255, 255, 0.52);
}

:root[data-theme="light"] .home-icon-button svg path[fill="#fff"] {
  fill: rgba(17, 24, 39, 0.22);
}

.home-lang-button {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.home-login-button {
  min-width: 78px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  direction: inherit;
}


.home-nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.home-nav-menu-button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.home-nav-menu {
  position: absolute;
  inset-block-start: calc(100% + 16px);
  inset-inline-start: 0;
  display: grid;
  min-width: 154px;
  padding: 8px;
  border: 1px solid var(--cyrus-home-header-control-border);
  border-radius: 8px;
  background: rgba(16, 20, 35, 0.94);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

:root[data-theme="light"] .home-nav-menu {
  background: rgba(243, 231, 225, 0.96);
  box-shadow: 0 20px 48px rgba(17, 24, 39, 0.14);
}

.home-nav-dropdown:hover .home-nav-menu,
.home-nav-dropdown:focus-within .home-nav-menu,
.home-nav-dropdown.is-open .home-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.home-nav-menu-item {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.home-nav-menu-item:hover {
  background: var(--cyrus-home-header-control);
}

html[dir="rtl"] .home-nav-menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

html[dir="rtl"] .home-nav-menu-item {
  font-size: 16px;
}

@media (max-width: 1120px) {
  .home-header-nav {
    width: min(100% - 28px, var(--cyrus-home-header-max));
    grid-template-columns: minmax(260px, 1fr) 104px minmax(260px, 1fr);
    column-gap: 18px;
  }

  .home-nav-links {
    gap: 12px;
  }

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

  html[dir="rtl"] .home-header-nav {
    grid-template-columns: minmax(260px, 1fr) 104px minmax(260px, 1fr);
    column-gap: 18px;
  }

  html[dir="rtl"] .home-nav-links {
    gap: 12px;
  }
}

@media (max-width: 820px) {
  :root {
    --cyrus-home-header-height: 66px;
  }

  .home-header {
    overflow: visible;
  }

  .home-header-nav {
    position: relative;
    grid-template-areas: "menu brand";
    grid-template-columns: 42px minmax(0, 1fr);
    width: min(100% - 24px, var(--cyrus-home-header-max));
    column-gap: 12px;
  }

  html[dir="rtl"] .home-header-nav {
    grid-template-areas: "brand menu";
    grid-template-columns: minmax(0, 1fr) 42px;
    width: min(100% - 24px, var(--cyrus-home-header-max));
    column-gap: 12px;
  }

  .home-nav-links {
    display: none;
  }

  .home-mobile-menu-toggle {
    grid-area: menu;
    appearance: none;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--cyrus-home-header-control-border);
    border-radius: 999px;
    background: var(--cyrus-home-header-control);
    color: inherit;
    cursor: pointer;
  }

  .home-mobile-menu-toggle span {
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .home-header.is-mobile-menu-open .home-mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .home-header.is-mobile-menu-open .home-mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .home-header.is-mobile-menu-open .home-mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .home-brand {
    width: 82px;
    height: 54px;
    justify-self: end;
  }

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

  .home-header-actions {
    display: none;
  }

  html[dir="rtl"] .home-header-actions {
    display: none;
  }

  .home-icon-button,
  .home-login-button {
    min-height: 38px;
  }

  .home-icon-button {
    width: 38px;
    flex: 0 0 38px;
  }

  .home-login-button {
    max-width: 112px;
    padding: 0 10px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-mobile-menu[hidden] {
    display: none !important;
  }

  .home-mobile-menu {
    position: absolute;
    inset-block-start: calc(100% + 10px);
    inset-inline: 0;
    z-index: 101;
    display: block;
    max-height: calc(100dvh - var(--cyrus-home-header-height) - 18px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .home-mobile-menu-inner {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--cyrus-home-header-control-border);
    border-radius: 8px;
    background: rgba(16, 20, 35, 0.96);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
  }

  :root[data-theme="light"] .home-mobile-menu-inner {
    background: rgba(243, 231, 225, 0.98);
    box-shadow: 0 22px 60px rgba(17, 24, 39, 0.14);
  }

  .home-mobile-actions {
    display: grid;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cyrus-home-header-control-border);
  }

  .home-mobile-control-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .home-mobile-control-row .home-icon-button {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
  }

  .home-mobile-auth-slot {
    display: grid;
    width: 100%;
  }

  .home-mobile-auth-slot .cyrus-auth-btn,
  .home-mobile-auth-slot .cyrus-user-pill {
    width: 100%;
    max-width: none;
    min-height: 44px;
    border-radius: 8px;
    font-size: 14px;
  }

  .home-mobile-auth-slot .cyrus-auth-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    box-shadow: none;
  }

  .home-mobile-auth-slot .cyrus-auth-item,
  .home-mobile-auth-slot .cyrus-auth-link,
  .home-mobile-auth-slot .cyrus-auth-provider {
    min-height: 40px;
    border-radius: 6px;
    font-size: 14px;
  }

  .home-mobile-nav {
    display: grid;
    gap: 4px;
  }

  .home-mobile-nav-link,
  .home-mobile-nav-label {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    color: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-align: start;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .home-mobile-nav-link:hover {
    background: var(--cyrus-home-header-control);
  }

  .home-mobile-nav-label {
    opacity: 0.72;
  }

  .home-mobile-subnav {
    display: grid;
    gap: 2px;
    padding-inline-start: 12px;
  }

  html[dir="rtl"] .home-mobile-subnav {
    padding-inline-start: 0;
    padding-inline-end: 12px;
  }
}

@media (max-width: 560px) {
  .home-header-nav,
  html[dir="rtl"] .home-header-nav {
    width: min(100% - 18px, var(--cyrus-home-header-max));
  }

  .home-icon-button {
    width: 36px;
    min-height: 36px;
    flex-basis: 36px;
  }

  .home-login-button {
    max-width: 96px;
  }

  .home-mobile-menu-inner {
    padding: 10px;
  }
}


/* Auth menu from shared file inside home header */
.home-auth-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.home-auth-slot .cyrus-auth-btn,
.home-auth-slot .cyrus-user-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: 170px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--cyrus-home-header-control-border);
  background: var(--cyrus-home-header-control);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.home-auth-slot .cyrus-auth-menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  inset-inline-end: auto;
  display: grid;
  min-width: 230px;
  padding: 14px;
  border: 1px solid var(--cyrus-home-header-control-border);
  border-radius: 18px;
  background: rgba(16, 20, 35, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  z-index: 9999;
}

:root[data-theme="light"] .home-auth-slot .cyrus-auth-menu {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.14);
}

.home-auth-slot .cyrus-auth-menu[hidden] {
  display: none !important;
}

.home-auth-slot .cyrus-auth-item,
.home-auth-slot .cyrus-auth-link,
.home-auth-slot .cyrus-auth-provider {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.home-auth-slot .cyrus-auth-item:hover,
.home-auth-slot .cyrus-auth-link:hover,
.home-auth-slot .cyrus-auth-provider:hover {
  background: var(--cyrus-home-header-control);
}

html[dir="rtl"] .home-auth-slot .cyrus-auth-menu {
  inset-inline-start: 0;
  inset-inline-end: auto;
}

html[dir="rtl"] .home-auth-slot .cyrus-auth-item,
html[dir="rtl"] .home-auth-slot .cyrus-auth-link,
html[dir="rtl"] .home-auth-slot .cyrus-auth-provider {
  justify-content: flex-end;
  text-align: right;
}

@media (max-width: 820px) {
  .home-auth-slot .cyrus-auth-btn,
  .home-auth-slot .cyrus-user-pill {
    max-width: 120px;
    padding: 0 9px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .home-auth-slot .cyrus-auth-btn,
  .home-auth-slot .cyrus-user-pill {
    max-width: 96px;
  }
}


/* App/Profile/Dashboard compact variant */
.home-header.home-header--app {
  --cyrus-home-header-height: 75px;
  --cyrus-home-header-max: 840px;
}

.home-header.home-header--app .home-header-nav {
  width: min(var(--cyrus-home-header-max), calc(100% - 32px));
  grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr);
  column-gap: 16px;
}

.home-header.home-header--app .home-brand {
  width: 108px;
  height: 60px;
}

.home-header.home-header--app .home-nav-links {
  gap: 18px;
  flex-wrap: wrap;
}

.home-header.home-header--app .home-nav-link {
  font-size: 12.5px;
  font-weight: 700;
}

.home-header.home-header--app .home-header-actions {
  gap: 8px;
}

.home-header.home-header--app .home-icon-button {
  width: 40px;
  min-height: 40px;
}

.home-header.home-header--app .home-auth-slot .cyrus-auth-btn,
.home-header.home-header--app .home-auth-slot .cyrus-user-pill {
  max-width: 150px;
  min-height: 40px;
  font-size: 11px;
}

@media (max-width: 820px) {
  .home-header.home-header--app {
    --cyrus-home-header-height: 66px;
    --cyrus-home-header-max: 100%;
  }

  .home-header.home-header--app .home-header-nav {
    grid-template-areas: "menu brand";
    grid-template-columns: 42px minmax(0, 1fr);
    width: min(100% - 24px, var(--cyrus-home-header-max));
    column-gap: 12px;
  }

  html[dir="rtl"] .home-header.home-header--app .home-header-nav {
    grid-template-areas: "brand menu";
    grid-template-columns: minmax(0, 1fr) 42px;
    width: min(100% - 24px, var(--cyrus-home-header-max));
    column-gap: 12px;
  }

  .home-header.home-header--app .home-brand {
    width: 82px;
    height: 54px;
  }

  .home-header.home-header--app .home-nav-links {
    display: none;
  }

  .home-header.home-header--app .home-header-actions {
    display: none;
  }

  .home-header.home-header--app .home-icon-button {
    width: 38px;
    min-height: 38px;
  }

  .home-header.home-header--app .home-auth-slot .cyrus-auth-btn,
  .home-header.home-header--app .home-auth-slot .cyrus-user-pill {
    max-width: 112px;
    min-height: 38px;
    padding: 0 9px;
    font-size: 10.5px;
  }
}

@media (max-width: 380px) {
  .home-auth-slot .cyrus-auth-btn,
  .home-auth-slot .cyrus-user-pill,
  .home-header.home-header--app .home-auth-slot .cyrus-auth-btn,
  .home-header.home-header--app .home-auth-slot .cyrus-user-pill {
    max-width: 94px;
  }
}

@media (max-width: 820px) {
  .home-header .home-auth-slot.home-mobile-auth-slot .cyrus-auth-btn,
  .home-header .home-auth-slot.home-mobile-auth-slot .cyrus-user-pill,
  .home-header.home-header--app .home-auth-slot.home-mobile-auth-slot .cyrus-auth-btn,
  .home-header.home-header--app .home-auth-slot.home-mobile-auth-slot .cyrus-user-pill {
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
  }

  .home-header .home-auth-slot.home-mobile-auth-slot .cyrus-auth-menu,
  .home-header.home-header--app .home-auth-slot.home-mobile-auth-slot .cyrus-auth-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    box-shadow: none;
  }

  .home-header.home-header--app .home-mobile-control-row .home-icon-button {
    width: 100%;
    min-height: 44px;
    flex-basis: auto;
    border-radius: 8px;
    font-size: 13px;
  }

  .home-mobile-nav-group,
  .home-mobile-nav-label,
  .home-mobile-subnav {
    display: contents;
    padding: 0;
  }
}
