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

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: background .25s ease, box-shadow .25s ease;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 56px; /* tighter like Vostok */

  /* KEY FIX: grid makes left/center/right perfectly aligned */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* LEFT / RIGHT */
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 34px;
  white-space: nowrap; /* keep on one line */
}

.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

/* CENTER */
.nav-center {
  /* KEY FIX: no absolute positioning, grid centers it perfectly */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LINKS */
.nav-link {
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color .2s ease;
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: #c9a24d;
  transition: width 0.3s ease, left 0.3s ease;
}

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

/* Icon links (search, wishlist, cart) */
.nav-icon {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-bottom: 4px;
}

.nav-icon svg {
  display: block;
}

.nav-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c9a24d;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.02em;
  text-align: center;
}

.nav-badge[hidden] {
  display: none;
}

/* Active link like Vostok (but gold) */
.nav-link-active {
  color: #c9a24d !important;
}

/* LOGO */
.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-letter {
  font-family: "Baskerville","Garamond","Times New Roman",serif;
  font-size: 42px;
  letter-spacing: 0.06em;
  background: linear-gradient(
    135deg,
    #fff2c6,
    #d7b35a,
    #b4872f,
    #f3e3b3,
    #8a641a
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= STATES ================= */

/* Transparent on top (on black hero) */
.navbar-transparent {
  background: transparent;
  box-shadow: none;
}

.navbar-transparent .nav-link {
  color: #fff;
}

/* White when scrolled */
.navbar-scrolled {
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.navbar-scrolled .nav-link {
  color: #000;
}

/* Hover color */
.navbar .nav-link:hover {
  color: #c9a24d;
}

/* ================= MENU OPEN (VOSTOK FEEL) ================= */
/* When mega menu is open, navbar MUST be white */
.navbar-menu-open {
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.navbar-menu-open .nav-link {
  color: #000 !important;
}

.navbar-menu-open .nav-link:hover {
  color: #c9a24d !important;
}

/* ================= MEGA MENU ================= */

.has-mega {
  position: relative;

  /* FIX #2: align "Collections" perfectly with other links */
  display: flex;
  align-items: center;
}

/* Full-width dropdown attached to navbar */
.mega-menu {
  position: fixed; /* locks to viewport like Vostok */
  left: 0;
  width: 100vw;
  background: #fff;
  display: none;
  border-top: 1px solid rgba(0,0,0,0.10);
  z-index: 999;
}

/* opened by JS */
.navbar-menu-open .mega-menu {
  display: block;
}

.mega-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 42px 56px 48px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 90px;
}

/* LEFT LIST */
.mega-list a {
  display: block;
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  padding: 8px 0;
}

.mega-list a:hover {
  color: #c9a24d;
}

/* RIGHT PROMOS */
.mega-promos {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 26px;
  align-items: start;
}

.promo-card {
  text-decoration: none;
  color: #000;
  display: block;
}

.promo-img {
  width: 100%;
  height: 240px;
  background: #e6e6e6;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
}

.promo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.promo-card:hover .promo-img img {
  transform: scale(1.04);
}

.promo-caption {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000;
}

.promo-card:hover .promo-caption {
  color: #c9a24d;
}

/* Responsive safety */
@media (max-width: 980px) {
  .mega-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .mega-promos {
    grid-template-columns: 1fr;
  }
}

/* ================= COLLECTIONS SPECIAL STATE (FIXED) ================= */

/* DEFAULT — same as other links */
.navbar-transparent .has-mega > .nav-link {
  color: #fff;
}

.navbar-scrolled .has-mega > .nav-link {
  color: #000;
}

/* Gold ONLY on hover */
.has-mega:hover > .nav-link {
  color: #c9a24d !important;
}

/* Gold ONLY when mega menu is open */
.navbar-menu-open .has-mega > .nav-link {
  color: #c9a24d !important;
}


/* ================= Collections active state ================= */

/* On transparent navbar (homepage hero): keep white, not gold */
.navbar-transparent .has-mega > .nav-link.nav-link-active {
  color: #fff !important;
}

/* On scrolled (white) navbar: show gold — same as Contact / About Us */
.navbar-scrolled .has-mega > .nav-link.nav-link-active {
  color: #c9a24d !important;
}

/* When mega menu is open: also gold */
.navbar-menu-open .has-mega > .nav-link.nav-link-active {
  color: #c9a24d !important;
}

/* Mobile-only elements — hidden on desktop */
.mobile-main-panel {
  display: contents;
}

.mobile-collections-sub,
.mobile-chevron {
  display: none;
}

/* ================= HAMBURGER BUTTON ================= */

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  z-index: 1010;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #000;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar-transparent .nav-hamburger span {
  background: #fff;
}

/* Hamburger → X when open */
.navbar.nav-mobile-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar.nav-mobile-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.navbar.nav-mobile-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================= TABLET NAV ================= */

@media (max-width: 980px) {
  .nav-inner {
    padding: 18px 32px;
  }

  .nav-left,
  .nav-right {
    gap: 22px;
  }
}

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

@media (max-width: 768px) {
  /* Three-column grid: [1fr] [logo] [1fr] — equal sides guarantee true center */
  .nav-inner {
    padding: 14px 20px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  /* Column 1: hamburger, aligned left */
  .nav-hamburger {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    position: relative;
    z-index: 1010;
  }

  /* Column 2: logo, truly centered */
  .nav-center {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    position: relative;
    z-index: 1010;
  }

  /* Column 3: action icons, aligned right */
  .nav-right {
    grid-column: 3;
    grid-row: 1;
    position: relative !important;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 0;
    height: auto;
    width: auto;
    background: none;
    transform: none;
    z-index: 1010;
  }

  /* Slide-in navigation panel */
  .nav-left {
    grid-column: 1;
    grid-row: 1;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 32px 48px;
    gap: 0;
    z-index: 1005;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .navbar.nav-mobile-open .nav-left {
    transform: translateX(0);
  }

  /* has-mega acts as a plain block inside the panel */
  .nav-left .has-mega {
    display: block;
    position: static;
    width: 100%;
  }

  /* Link styles inside the slide panel */
  .nav-left .nav-link {
    color: #111 !important;
    font-size: 18px;
    letter-spacing: 0.12em;
    padding: 16px 0;
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }

  .nav-left .nav-link:hover {
    color: #c9a24d !important;
  }

  /* Remove sliding underline inside panel */
  .nav-left .nav-link::after {
    display: none;
  }

  /* White bg + dark hamburger → X when panel open */
  .navbar.nav-mobile-open {
    background: #fff !important;
  }

  .navbar.nav-mobile-open .nav-hamburger span {
    background: #000;
  }

  /* Icon color when panel open (navbar is white) */
  .navbar.nav-mobile-open .nav-right .nav-link {
    color: #000;
  }

  /* Icon color on transparent dark hero */
  .navbar-transparent .nav-right .nav-link {
    color: #fff;
  }

  /* Hide mega menu on mobile */
  .mega-menu {
    display: none !important;
  }

  /* ---- Two-panel slide: main panel ---- */
  .nav-left {
    overflow: hidden; /* clip the sliding sub-panel */
  }

  .mobile-main-panel {
    display: flex;
    width: 100%;
    flex-direction: column;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
  }

  .mobile-chevron {
    display: block;
  }

  .nav-left.sub-open .mobile-main-panel {
    transform: translateX(-100%);
  }

  /* Collections link: flex row so chevron sits on the right */
  .mobile-main-panel .has-mega .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-chevron {
    flex-shrink: 0;
    opacity: 0.5;
  }

  /* ---- Two-panel slide: collections sub-panel ---- */
  .mobile-collections-sub {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    padding: 90px 32px 48px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }

  .nav-left.sub-open .mobile-collections-sub {
    transform: translateX(0);
  }

  /* Back button */
  .mobile-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #888;
    padding: 0 0 20px;
    margin-bottom: 4px;
    transition: color 0.2s ease;
  }

  .mobile-back-btn:hover {
    color: #000;
  }

  /* Sub-panel heading */
  .mobile-sub-title {
    font-size: 22px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
    padding-bottom: 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }

  /* Sub-panel links */
  .mobile-sub-links a {
    display: block;
    color: #111;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    transition: color 0.2s ease;
  }

  .mobile-sub-links a:hover {
    color: #c9a24d;
  }
}
