/* =======================================================================
   SHARED NAV — loaded by every layout
   ======================================================================= */


/* =======================================================================
   NAVBAR BASE
   ======================================================================= */

.navbar-container {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 5;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transform: translateY(0);
  transition: transform 0.3s ease;
  z-index: 9999;
  background-color: transparent;
}

.navbar.hidden {
  transform: translateY(-100%);
}

.company-name {
  font-size: clamp(1.188rem, 1.054rem + 0.595vw, 1.5rem);
  font-weight: bold;
  line-height: 1;
  padding: 0;
  color: var(--nav-text);
  transition: color 0.3s ease;
  cursor: pointer;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 60px;
  width: auto;
  display: block;
}

.hamburger-label {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
  font-weight: 500;
  color: var(--nav-text);
  transition: color 0.3s ease;
  line-height: 1.2;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--nav-text-hover);
  outline: none;
  text-decoration: underline;
}

/* =======================================================================
   NAVBAR SCROLLED STATE
   ======================================================================= */

.navbar.scrolled {
  background-color: var(--nav-bg-scrolled);
}

.navbar.scrolled .company-name,
.navbar.scrolled .nav-item {
  color: var(--nav-text-scrolled);
}

/* =======================================================================
   NAV LINKS LAYOUT
   ======================================================================= */

.nav-links {
  padding-top: 10px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

/* =======================================================================
   HAMBURGER (MOBILE)
   ======================================================================= */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3;
  align-items: center;
}

.hamburger span {
  height: 2px;
  width: 100%;
  background: var(--hamburger-background);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform-origin: center;
  transform: rotate(45deg) translate(9px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform-origin: center;
  transform: rotate(-45deg) translate(9px, -6px);
}

.navbar.scrolled .hamburger span {
  background: var(--hamburger-background);
}

/* =======================================================================
   THEME TOGGLE
   ======================================================================= */

.theme-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--nav-text);
  transition: color 0.3s ease, transform 0.3s ease;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--nav-text-hover);
  transform: scale(1.1);
  outline: none;
}

.theme-icon {
  display: inline-block;
  line-height: 1;
}

@media (min-width: 768px) {
  .theme-toggle {
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.3s ease, transform 0.3s ease;
  }

  .theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.2);
  }

  .theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  .theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
  }
}

/* =======================================================================
   DROPDOWN
   ======================================================================= */

.nav-item.dropdown {
  position: relative;
}

.nav-link.dropdown-toggle::after {
  content: " ▼";
  font-size: 0.7em;
  margin-left: 5px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--dropdown-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
  min-width: 160px;
  z-index: 1000;
  padding: 0.5rem 0;
  border-radius: 4px;
}

.nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--dropdown-text);
  text-decoration: none;
}

.dropdown-item:hover {
  opacity: 0.8;
}

/* =======================================================================
   MOBILE NAV
   ======================================================================= */

@media (max-width: 768px) {
  .navbar {
    width: 100%;
    padding: 1rem 1.5rem;
    justify-content: space-between;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hamburger-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    align-items: center;
    line-height: 0;
  }

  .hamburger-label {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hamburger-background);
    line-height: 1;
    margin: 0;
  }

  .hamburger-bars {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
  }

  .hamburger-bars span {
    height: 3px;
    width: 100%;
    background: var(--hamburger-background);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .hamburger.active .hamburger-bars span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active .hamburger-bars span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .hamburger-bars span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -9px);
  }

  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    flex-direction: column;
    background: var(--dropdown-background);
    width: 300px;
    padding: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .logo {
    height: 50px;
    width: auto;
  }
}

/* =======================================================================
   INDEX PAGE — nav always dark (video background)
   Force dark-theme nav variables regardless of user theme preference.
   ======================================================================= */

body.index,
body.index.light-theme,
body.index.dark-theme {
  --nav-text: #ffffff;
  --nav-text-hover: #dddddd;
  --nav-text-scrolled: #ffffff;
  --hamburger-background: #ffffff;
  --dropdown-background: rgba(23, 22, 22, 0.95);
  --dropdown-text: #ffffff;
}

body.index .full-line {
  display: none;
}

/* separator line below nav (shop layout uses this) */
.full-line {
  border: none;
  height: 2px;
  background-color: #7a5c3a;
  width: 100%;
  margin: 0;
  margin-top: var(--nav-height);
}
