/* Shared Navigation Menu CSS */

/* ===== GLOBAL OVERFLOW FIX (prevents horizontal scroll on all pages) ===== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ===== MENU FONT OVERRIDES ===== */
.left__menu ul.menu li a,
.left__menu ul.menu li,
.nav__active ul.menu li a,
.nav__active ul.menu li,
.nav__active .menu__top,
.left__menu .menu__top,
.burger__menu span {
  font-family: 'Poppins', sans-serif !important;
}

/* ===== LOGO STYLING ===== */
.logo__top img {
  max-width: 158px;
}

/* Allow desktop sizing to work - don't override width on desktop */
@media (min-width: 768px) {
  .logo__top img {
    max-width: 200px; /* Allow 200px on desktop */
  }
}

/* Ensure proper stacking context for header and corner SVG */
header, .corner__top-4 {
  position: absolute !important;
}

/* Ensure header logo is above corner SVG */
header .logo__text,
header #header-logo {
  position: relative;
  z-index: 1000;
}

/* Logo remains visible and changes src when menu is active */

/* ===== HEADER AND LOGO POSITIONING ===== */
/* Header styles from theme - exact copy */
header {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 999;
  padding-top: 20px;
  padding-right: 1rem;
}

header .logo__top {
  display: block;
  text-align: center;
}

header .logo__text {
  width: 158px;
  height: auto;
}

/* No special adjustments needed - use consistent positioning */

/* Ensure header logo z-index is high enough when menu is active */
header.active .logo__top {
  z-index: 1001; /* Above navigation panel */
  display: block !important; /* Override theme's display: none on mobile */
}

/* Mobile-specific fix for logo visibility */
@media (max-width: 1150px) {
  header.active .logo__top {
    display: block !important; /* Ensure logo stays visible on mobile */
  }
  
  header.active .logo__top img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Mobile header adjustments to match theme */
@media (max-width: 768px) {
  header {
    padding-right: 1rem;
    padding-top: 0.5rem;
  }
}

/* ===== MOBILE MENU RESPONSIVE FIXES ===== */
@media (max-width: 1150px) {
  /* Hide desktop left menu */
  .left__menu {
    display: none !important;
  }

  /* Show mobile burger menu */
  .burger__lay.open {
    display: block !important;
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 999 !important;
  }

  /* Ensure burger menu button is visible and styled - match desktop */
  .burger__lay.open .menu__top .burger__menu {
    background: #86BBD8 !important;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .burger__lay.open .menu__top .burger__menu span {
    width: 25px;
    height: 2px;
    background: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 3px;
    transition: 0.3s;
  }

  .burger__lay.open .menu__top .burger__menu span:nth-child(1) {
    transform: translate(-50%, -50%) translateY(-4px);
  }

  .burger__lay.open .menu__top .burger__menu span:nth-child(2) {
    transform: translate(-50%, -50%);
  }

  .burger__lay.open .menu__top .burger__menu span:nth-child(3) {
    transform: translate(-50%, -50%) translateY(4px);
  }

  /* Animation for burger menu when active - perfect X centering with visible both diagonals */
  .burger__lay.open.active .menu__top .burger__menu span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg) !important;
    opacity: 1 !important;
    margin-top: 0 !important;
    top: 50% !important;
    left: 50% !important;
  }

  .burger__lay.open.active .menu__top .burger__menu span:nth-child(2) {
    opacity: 0 !important;
    display: none !important;
  }

  .burger__lay.open.active .menu__top .burger__menu span:nth-child(3) {
    transform: translate(-50%, -50%) rotate(-45deg) !important;
    opacity: 1 !important;
    display: block !important;
    margin-top: 0 !important;
    top: 50% !important;
    left: 50% !important;
  }

  /* Remove left padding from content when left menu is hidden */
  .page__content {
    padding-left: 0 !important;
  }
}

/* ===== DESKTOP X BUTTON ===== */
/* X button for desktop menu - styled like burger menu button */
.nav__active .close-button {
  position: fixed; /* Changed to fixed to match burger button */
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: #86BBD8;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10000; /* Increased z-index to ensure visibility */
  display: none; /* Hidden by default */
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Show close button when nav is active - both mobile and desktop */
.nav__active.active .close-button {
  display: block !important;
}

/* Hide ALL burger menus when navigation is active */
.nav__active.active ~ .burger__lay,
body.nav-open .burger__lay,
.nav__active.active .burger__lay {
  display: none !important;
}

/* Adjust close button position on mobile - match burger position */
@media (max-width: 1150px) {
  .nav__active.active .close-button {
    left: 20px !important;
    top: 20px !important;
    transform: none !important;
    position: fixed !important; /* Use fixed positioning like the burger button */
    z-index: 10001 !important; /* Higher than nav panel to ensure visibility */
    display: block !important; /* Ensure it's visible */
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Desktop hover effect */
@media (min-width: 1151px) {
  .nav__active .close-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Mobile hover effect */
@media (max-width: 1150px) {
  .nav__active .close-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

.nav__active .close-button span {
  position: absolute;
  width: 25px;
  height: 2px;
  background: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 3px;
}

.nav__active .close-button span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav__active .close-button span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Desktop styles */
@media (min-width: 1151px) {
  /* Close button position stays centered on desktop */
  .nav__active .close-button:not(:hover) {
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ===== SUB-MENU STYLING ===== */
.nav__active .sub-menu {
  list-style: none;
  margin-top: 15px;
  padding-left: 0;
  display: none; /* Hidden by default */
}

/* Show submenu when parent has submenu-open class */
.nav__active .menu-item-has-children.submenu-open .sub-menu {
  display: block;
}

.nav__active .sub-menu li {
  margin-bottom: 8px;
}

.nav__active .sub-menu li a {
  font-family: 'Poppins', sans-serif !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  text-transform: none !important;
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  padding: 5px 0;
}

.nav__active .sub-menu li a:hover {
  color: #f6ae2d !important;
  text-decoration: underline;
}

/* ===== ARROW POSITIONING ===== */
/* Arrow positioning fix for "Despre noi" - Desktop right arrow */
.nav__active .menu li.active:after {
  content: '';
  position: absolute;
  width: 18px;
  height: 28px;
  background: url("wp-content/themes/tic/assets/images/move-to-next.svg");
  background-size: cover;
  background-position: center;
  right: -30px; /* Position closer to the text */
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

/* Down arrow for sub-menu indication */
.nav__active .menu li.menu-item-has-children.submenu-open:after {
  transform: translateY(-50%) rotate(180deg); /* Rotate arrow when submenu is open */
}

/* ===== X BUTTON STYLING ===== */
/* DUPLICATE REMOVED - All close button styles consolidated at lines 173-263 */

/* ===== SPECIFIC PAGE OVERRIDES ===== */
/* Hide white logo in nav panel on mobile by default */
@media (max-width: 1150px) {
  .nav__active .logo__top {
    display: none;
  }
}

/* ===== CORNER TOP 4 ANIMATION ===== */
.corner__top-4 {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 9; /* Behind header which has z-index: 999 */
  -webkit-transform: rotate(270deg);
  transform: rotate(270deg);
  margin-top: -50px;
  margin-right: -50px; /* Adjust positioning */
  transition: opacity 0.3s ease;
  pointer-events: none; /* Ensure it doesn't block clicks */
}

/* Mobile specific sizing and positioning */
@media (max-width: 768px) {
  .corner__top-4 {
    width: 250px;
    height: 310px;
    right: -20px;
    margin-right: 0; /* Reset margin on mobile */
    margin-top: -30px;
  }
}

/* Tablet specific positioning */
@media (min-width: 769px) and (max-width: 1024px) {
  .corner__top-4 {
    right: 25px;
  }
}

.corner__top-4 path {
  fill: url(#paint0_linear);
}

/* Hide corner__top-4 when navigation is active */
.nav__active.active ~ .corner__top-4,
body.nav-open .corner__top-4 {
  opacity: 0;
  pointer-events: none;
}

/* ===== SPECIFIC PAGE FIXES ===== */
/* Fix for ateliere page that has its own search content */
body.page-template-archive-ateliere > .search__content:first-child {
  position: relative;
  z-index: 1;
}

/* Ensure navigation components maintain proper stacking order */
body > header {
  position: absolute !important;
  z-index: 999 !important;
}

body > .corner__top-4 {
  position: absolute !important;
  z-index: 9 !important; /* Keep behind header */
}

/* Ensure consistent positioning across all pages */
.ateliere header {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  padding-top: 20px !important;
  padding-right: 1rem !important;
}

.ateliere .corner__top-4 {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  margin-top: -50px !important;
}

/* ===== WHITE LOGO IN NAV PANEL ===== */
/* Ensure white logo displays correctly in navigation panel */
.nav__active .logo__top {
  position: absolute !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 1000 !important;
  display: block !important;
}

.nav__active .logo__top img {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 158px !important;
  height: auto !important;
}

/* Override any theme styles that might hide the white logo */
.nav__active .logo__top,
.nav__active .logo__top img.logo__text {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Responsive white logo sizing */
@media (min-width: 768px) {
  .nav__active .logo__top img {
    width: 200px !important;
  }
}

/* Ensure white logo is properly positioned on mobile */
@media (max-width: 768px) {
  .nav__active .logo__top {
    bottom: 15px !important;
    right: 15px !important;
  }
  
  .nav__active .logo__top img {
    width: 140px !important;
  }
}

/* ===== NAVIGATION PANEL STYLING ===== */
/* Ensure nav panel doesn't cover header */
.nav__active {
  z-index: 998; /* Below header (999) */
}

/* When active, ensure proper stacking */
.nav__active.active {
  z-index: 998; /* Still below header */
}

/* ===== WHITE LOGO IN NAVIGATION PANEL ===== */
/* No longer needed - header logo swaps to white when menu opens */