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

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  transition: background 0.5s var(--ease),
              border-color 0.5s var(--ease),
              box-shadow 0.5s var(--ease);
}
.navbar.scrolled {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white);
  flex-shrink: 0;
  transition: color 0.45s var(--ease);
}
.navbar.scrolled .logo { color: var(--white) !important; }

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

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  filter: invert(1);
  flex-shrink: 0;
  transition: filter 0.45s var(--ease);
}

.navbar.scrolled .logo-icon {
  filter: invert(1);
}

/* === Nav links === */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-end;
}
.nav-links > li > a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  transition: color 0.3s var(--ease);
  white-space: nowrap;
  display: block;
  position: relative;
}
.nav-links > li:not(.has-dropdown) > a::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 13px;
  right: 13px;
  height: 1px;
  background: white;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links > li:not(.has-dropdown) > a:hover::after { transform: scaleX(1); }
.nav-links > li > a:hover {
  color: var(--white);
  background: transparent;
}
.navbar.scrolled .nav-links > li > a { color: rgba(255, 255, 255, 0.82) !important; }
.navbar.scrolled .nav-links > li > a:hover { color: var(--white) !important; background: transparent !important; }

/* CTA gumb v navigaciji */
.nav-cta {
  background: rgba(255, 255, 255, 0.15) !important;
  color: var(--white) !important;
  padding: 10px 22px !important;
  border-radius: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.40) !important;
  margin-left: 16px;
  font-size: 10px !important;
  letter-spacing: 0.16em !important;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.45s var(--ease) !important;
}
.nav-cta:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}
.navbar.scrolled .nav-cta,
.navbar.scrolled .nav-links > li > a.nav-cta {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.40) !important;
  color: var(--white) !important;
}
.navbar.scrolled .nav-cta:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

/* === Dropdown === */
.has-dropdown { position: relative; }

.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 7px;
  opacity: 0.6;
  transition: transform 0.2s var(--ease), border-color 0.45s var(--ease);
  vertical-align: middle;
}
.has-dropdown:hover > a::after,
.has-dropdown.is-open > a::after {
  transform: rotate(-135deg) translateY(-2px);
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(240, 237, 233, 0.85);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 210px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Closing: 150ms delay before fade — prevents accidental close on fast mouse */
  transition: opacity 0.22s var(--ease) 0.15s,
              transform 0.22s var(--ease) 0.15s,
              visibility 0.22s 0.15s;
}

/* Invisible bridge fills the gap between nav item and dropdown */
.dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -10px;
  right: -10px;
  height: 12px;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  /* Opening: no delay */
  transition: opacity 0.22s var(--ease),
              transform 0.22s var(--ease),
              visibility 0s;
}

.dropdown li a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--gray-dark);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.dropdown li a:hover { background: var(--gray-subtle); color: var(--black); }

/* === Hamburger === */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  width: 36px; height: 36px;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition), background 0.45s var(--ease);
  transform-origin: center;
}
.navbar.scrolled .hamburger span { background: var(--white) !important; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* === Responsive === */
@media (max-width: 1100px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(26, 26, 24, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 16px var(--container-pad) 28px;
    gap: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
  }
  .nav-links.is-open { display: flex; }

  .nav-links > li > a {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.82) !important;
    padding: 15px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
  }
  .nav-links > li > a:hover { color: var(--white) !important; }
  .nav-links > li:last-child > a { border-bottom: none; }

  .nav-cta {
    margin-left: 0 !important;
    margin-top: 12px;
    text-align: center;
    border-bottom: none !important;
    border-radius: var(--radius-md) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: var(--white) !important;
  }

  .has-dropdown > a::after { float: right; margin-top: 4px; }

  .dropdown {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 16px;
    min-width: 0;
    display: none;
  }
  .has-dropdown.is-open .dropdown { display: block; }

  .dropdown li a {
    padding: 10px 4px;
    font-size: 12px;
    letter-spacing: 0.12em;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55) !important;
  }
  .dropdown li a:hover { color: var(--white) !important; background: transparent; }

  .hamburger { display: flex; }
}
