/* TO DO: Potestować stylizację na różnych urządzeniach */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.navbar {
  background: var(--main-bg-opacity);
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  transition: border-bottom 0.3s linear;
  height: 80px;
  backdrop-filter: blur(10px);
}

.navbar-inner {
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
}

@media (max-width: 1049.98px) {
  .navbar-inner {
    justify-content: flex-start;
    padding: 0 1rem;
  }

  .navbar-header {
    width: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-grow: 1;
  }

  .navbar-toggler {
    display: block;
    margin-left: auto;
    padding: 0.5rem;
    order: 2;
  }
}

.navbar.scrolled {
  border-bottom: 2px solid var(--main-dark-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* BRAND + TOGGLE - wspólne dla obu widoków */
.navbar-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.navbar-brand-text {
  font-weight: 400;
  font-size: 1.75rem;
}

.navbar-brand-link:hover .navbar-brand-text {
  text-decoration: none;
}

.navbar-brand-text {
  font-weight: 400;
  font-size: 1.75rem;
  text-decoration: none; /* na wszelki wypadek */
}

/* Link brandu – bez podkreślenia w żadnym stanie */
.navbar-brand-link,
.navbar-brand-link:hover,
.navbar-brand-link:focus,
.navbar-brand-link:active {
  text-decoration: none; /* dodaj !important, jeśli Bootstrap się upiera */
}

/* Gdyby jakaś reguła celowała w samo <span> przy hoverze linku */
.navbar-brand-link:hover .navbar-brand-text {
  text-decoration: none;
}

.navbar-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-white);
  font-weight: 400;
  text-decoration: none;
  font-size: 1.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 0.5rem;
}

.navbar-brand-link:hover {
  color: var(--main-light-color);
}

.navbar-brand-link a:active {
  color: var(--main-white);
}

.navbar-toggler {
  font-size: 1.5rem;
  color: var(--main-white);
  background: none;
  border: none;
  cursor: pointer;
  display: none;
}

/* DESKTOP nav */
.navbar-nav-desktop {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  height: 100%;
}

.nav-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1.5rem;
  height: 60%;
  cursor: pointer;
  border-radius: 1.5rem;
  transition: background 0.3s ease;
}

.nav-item:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.nav-item a {
  color: var(--main-white);
  text-decoration: none;
  font-weight: 400;
}

.nav-item:hover a {
  color: var(--main-light-color);
  font-weight: 400;
}

/* MOBILE nav */
.mobile-menu-wrapper {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--main-bg-opacity);
  backdrop-filter: blur(4px);
  z-index: 999;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.mobile-menu-wrapper.show {
  display: block;
  max-height: 600px;
  opacity: 1;
}

.navbar-nav-mobile {
  font-size: 1.25rem;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  background-color: inherit;
  cursor: pointer;
  transition: border 0.4s ease, opacity 0.4s ease;
  border-bottom: 2px solid var(--main-dark-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-nav-mobile .nav-item {
  border-radius: 0;
}

.navbar-nav-mobile .nav-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

.navbar-nav-mobile .nav-item a {
  color: var(--main-white);
  text-decoration: none;
  padding: 0.4rem 1rem;
}

.navbar-nav-mobile .nav-item a:hover {
  color: var(--main-light-color);
}

.navbar-dark {
  background: inherit;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  transition: 0.3s linear;
  height: 80px;
  backdrop-filter: blur(10px);
}

.navbar-dark.scrolled {
  border-bottom: 2px solid var(--main-light-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: var(--secondary-bg-opacity);
}

.navbar-dark:has(~ .mobile-menu-wrapper.show) {
  background: var(--secondary-bg-opacity);
}

.navbar-dark ~ .mobile-menu-wrapper {
  background: var(--secondary-bg-opacity);
}

.navbar-dark .navbar-toggler {
  color: var(--main-white);
}

/* RESPONSIVE rules */
@media (max-width: 1049.98px) {
  .navbar {
    align-items: stretch;
    justify-content: center;
    border-bottom: 2px solid var(--main-dark-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .navbar-dark {
    align-items: stretch;
    justify-content: center;
    border-bottom: 2px solid var(--main-light-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .navbar-nav-mobile .nav-item {
    width: 100%;
    padding: 0.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .navbar-toggler {
    display: block;
  }

  .navbar-nav-desktop {
    display: none;
  }
}

@media (min-width: 1050px) {
  .mobile-menu-wrapper {
    display: none !important;
  }

  .navbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .navbar-header {
    margin-right: auto;
  }
}

.navbar-logo {
  height: 50px;
  width: auto;
  margin-right: 1rem;
}

@media (max-width: 1049.98px) {
  .navbar-logo {
    height: 40px;
    width: auto;
  }
}
