/*
 * Navigation — nav bar, brand logo, desktop dropdowns, mega menu,
 * hamburger button, off-canvas panel, off-canvas accordion.
 *
 * Migrated from the original style.css nav block.
 * Depends on: variables.css
 *
 * @package Vinelec
 */

/* =================================================================
   SITE HEADER (inner pages only — front page nav is inside .hero)
   ================================================================= */

.site-header {
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border-soft);
  position: relative;
  z-index: 20;
}

/* =================================================================
   NAV BAR
   ================================================================= */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 22px;
}

/* =================================================================
   BRAND LOGO
   ================================================================= */

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-heading);
  font-weight: var(--fw-extrabold);
  letter-spacing: 0.02em;
  font-size: 24px;
  text-decoration: none;
}

.brand .mark {
  width: 30px;
  height: 30px;
  margin-right: 6px;
}

.brand .word {
  color: var(--clr-white);
}

/* Custom logo (uploaded via WP Customizer) */
.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  max-height: 50px;
  width: auto;
}

/* =================================================================
   DESKTOP MENU
   ================================================================= */

.menu {
  display: flex;
  align-items: center;
  gap: 34px;
}

.menu a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--clr-text-nav);
  transition: color var(--ease);
  text-decoration: none;
}

.menu a:hover {
  color: var(--clr-primary-soft);
}

.menu .caret {
  width: 10px;
  height: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

/* =================================================================
   DESKTOP DROPDOWN ITEMS
   ================================================================= */

.menu-item {
  position: relative;
}

.menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--clr-text-nav);
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  transition: color var(--ease);
}

.menu-trigger:hover,
.menu-item.open .menu-trigger {
  color: var(--clr-primary-soft);
}

.menu-item.open .caret {
  transform: rotate(180deg);
}

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

.dropdown {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 210px;
  background: rgba(6, 10, 22, 0.97);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.menu-item.open .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
  white-space: nowrap;
  border-left: 2px solid transparent;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  text-decoration: none;
}

.dropdown a:hover {
  color: var(--clr-white);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--clr-primary-soft);
}

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

.dropdown--mega {
  left: 0;
  transform: translateY(-8px);
  min-width: 660px;
  padding: 16px;
}

.menu-item.open .dropdown--mega {
  transform: translateY(0);
}

.dropdown-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mega-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}

.mega-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--clr-primary-soft);
}

.mega-text strong {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
  line-height: 1.3;
  margin-bottom: 3px;
}

.mega-text span {
  font-size: var(--fs-xs);
  color: var(--clr-muted);
  line-height: 1.4;
}

/* =================================================================
   ENQUIRY CTA BUTTON
   ================================================================= */

.enquiry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--clr-primary);
  color: var(--clr-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: var(--space-sm) 22px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-primary);
  text-decoration: none;
  transition: background var(--ease), transform var(--ease);
}

.enquiry:hover {
  background: var(--clr-primary-hover);
  transform: translateY(-1px);
}

.enquiry svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  align-items: center;
  justify-content: center;
  background: none;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.burger:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.burger svg {
  width: 22px;
  height: 22px;
  color: var(--clr-white);
}

/* =================================================================
   OFF-CANVAS OVERLAY
   ================================================================= */

.offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.offcanvas-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* =================================================================
   OFF-CANVAS PANEL
   ================================================================= */

.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 88vw);
  height: 100%;
  background: #070c18;
  border-left: 1px solid var(--clr-border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.offcanvas.active {
  transform: translateX(0);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}

.offcanvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--clr-border-soft);
  flex-shrink: 0;
}

/* =================================================================
   OFF-CANVAS CLOSE BUTTON
   ================================================================= */

.offcanvas-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--ease), background var(--ease);
}

.offcanvas-close:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.offcanvas-close svg {
  width: 18px;
  height: 18px;
}

/* =================================================================
   OFF-CANVAS LINKS (top-level nav area)
   ================================================================= */

.offcanvas-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

/* Plain (non-accordion) top-level links */
.offcanvas-links > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--clr-text-nav);
  border-bottom: 1px solid var(--clr-border-soft);
  text-decoration: none;
  transition: color var(--ease), background var(--ease), padding-left var(--ease);
}

.offcanvas-links > a:hover {
  color: var(--clr-white);
  background: rgba(255, 255, 255, 0.03);
  padding-left: 28px;
}

/* =================================================================
   OFF-CANVAS FOOTER
   ================================================================= */

.offcanvas-footer {
  padding: 24px;
  flex-shrink: 0;
  border-top: 1px solid var(--clr-border-soft);
}

.offcanvas-footer .enquiry {
  display: inline-flex;
  width: 100%;
  justify-content: center;
}

/* =================================================================
   OFF-CANVAS ACCORDION
   ================================================================= */

.oc-item {
  border-bottom: 1px solid var(--clr-border-soft);
}

.oc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 24px;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--clr-text-nav);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color var(--ease);
}

.oc-trigger:hover,
.oc-item.open .oc-trigger {
  color: var(--clr-white);
}

.oc-caret {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.oc-item.open .oc-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* Accordion sub-panel */
.oc-sub {
  max-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: max-height 0.3s ease;
}

.oc-item.open .oc-sub {
  max-height: 500px;
}

.oc-sub a {
  display: block;
  padding: 11px 24px 11px 36px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  color: var(--clr-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: color var(--ease), background var(--ease);
}

.oc-sub a:hover {
  color: var(--clr-white);
  background: rgba(255, 255, 255, 0.03);
}
