/* AIDEV-NOTE: v4 navigation — sticky header with blur backdrop, scroll hide/show */

/* AIDEV-NOTE: Top padding matches ww2 nav-safe-area — 1rem/1.5rem/2rem breakpoints */
.v4-nav-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 40;
  top: 0;
  transition: transform 0.3s ease;
  padding: 1rem 1rem 0;
}
@media (min-width: 768px) {
  .v4-nav-wrapper {
    padding: 1.5rem 1.5rem 0;
  }
}
@media (min-width: 1024px) {
  .v4-nav-wrapper {
    padding: 2rem 2rem 0;
  }
}

.v4-nav-wrapper.hidden-up {
  transform: translateY(-100%);
}

/* AIDEV-NOTE: 76rem = ww2's max-w-7xl (80rem) minus px-8 (2rem each side) */
.v4-nav {
  max-width: 76rem;
  margin: 0 auto;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}
.v4-nav.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.v4-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .v4-nav-inner {
    height: 4rem;
    padding: 0 1.5rem;
  }
}

/* Logo */
.v4-nav-logo img {
  height: 1rem;
  width: auto;
}

/* Desktop links */
.v4-nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 1024px) {
  .v4-nav-links {
    display: flex;
  }
}

.v4-nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background 0.15s ease;
}
.v4-nav-link:hover {
  background: var(--muted);
}

/* Desktop dropdown */
.v4-nav-dropdown {
  position: relative;
}
.v4-nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  background: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.v4-nav-dropdown-trigger:hover {
  background: var(--muted);
}
.v4-nav-dropdown-trigger svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}
.v4-nav-dropdown-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.v4-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  z-index: 50;
}
.v4-nav-dropdown-menu.open {
  display: block;
}
.v4-nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background 0.15s ease;
}
.v4-nav-dropdown-menu a:hover {
  background: var(--muted);
}

/* Desktop CTA */
.v4-nav-cta {
  display: none;
}
@media (min-width: 1024px) {
  .v4-nav-cta {
    display: block;
  }
}

/* Mobile hamburger */
.v4-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
@media (min-width: 1024px) {
  .v4-hamburger {
    display: none;
  }
}
.v4-hamburger svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--foreground);
}

/* Mobile overlay backdrop */
.v4-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  z-index: 39;
}
.v4-nav-overlay.open {
  display: block;
}

/* Mobile menu panel */
.v4-mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.26s ease, opacity 0.26s ease;
}
.v4-mobile-menu.open {
  max-height: 70vh;
  opacity: 1;
  overflow-y: auto;
}
.v4-mobile-menu-inner {
  padding: 1rem 1.5rem 1.5rem;
}

/* Mobile menu links */
.v4-mobile-link {
  display: block;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

/* Mobile accordion for Wrap Types */
.v4-mobile-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}
.v4-mobile-accordion-trigger svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.2s ease;
}
.v4-mobile-accordion-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.v4-mobile-accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.v4-mobile-accordion-panel.open {
  max-height: 20rem;
}
.v4-mobile-accordion-panel a {
  display: block;
  padding: 0.5rem 0 0.5rem 1rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.v4-mobile-accordion-panel a:hover {
  color: var(--foreground);
}

/* Mobile CTAs */
/* AIDEV-NOTE: Mobile CTA cards with image backgrounds — matches ww2 aspect-[4/3] cards */
.v4-mobile-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.v4-mobile-cta-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
  text-decoration: none;
  display: block;
}
.v4-mobile-cta-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.v4-mobile-cta-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2) 50%, transparent);
}
.v4-mobile-cta-card-label {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}
