/**
 * Header Sticky Styles
 * Styles for compressed header on scroll with smooth animations
 */

/* ===================================
   HEADER STICKY BEHAVIOR
   =================================== */

/* Make header sticky from the start - no jump */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--tcp-white);
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add shadow when scrolled */
.site-header.header-sticky {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Compressed header layout with smooth transition */
.header-main {
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-main.compressed {
  padding: var(--tcp-space-2) 0;
}

/* Add offset to content areas to prevent header overlap */
.single-post-header,
.page-header,
h1:first-of-type {
  scroll-margin-top: 120px;
}

/* ===================================
   HEADER TOP SECTION - 3 COLUMNS
   =================================== */

/* Main container: 3-column layout */
.header-top-section {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--tcp-space-4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left column: Search icon */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--tcp-space-3);
  justify-content: flex-start;
}

/* Center column: Logo */
.header-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Right column: Social icons */
.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Logo switching with fade effect */
.site-branding {
  position: relative;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Large logo (default) - fade out when compressed */
.site-logo-large {
  display: block;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Small logo in center (hidden by default) */
.site-logo-small {
  display: none;
}

/* Logo compressed in header-left (hidden by default) */
.site-branding-compressed {
  display: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-logo-compressed {
  display: block;
  border-right: 1px solid var(--tcp-gray-200);
  height: 40px;
  padding-right: 12px;
  width: auto;
}

/* Fade in and scale animation for small logo */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Date fade out animation */
.header-date {
  opacity: 1;
  max-height: 100px;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide date in compressed mode with fade out */
.header-main.compressed .header-date {
  opacity: 0;
  max-height: 0;
  margin: 0;
}

/* ===================================
   HEADER COMPRESSED MODE
   =================================== */

/* When compressed: change to 2-column layout */
.header-main.compressed .header-top-section {
  grid-template-columns: 1fr auto;
  gap: var(--tcp-space-4);
  align-items: center;
  margin: var(--tcp-space-3) 0;
}

/* Left side: search + logo + navigation */
.header-main.compressed .header-left {
  display: flex;
  align-items: center;
  gap: var(--tcp-space-4);
  justify-content: flex-start;
}

/* Show site branding in header-left when compressed */
.header-main.compressed .site-branding-compressed {
  display: flex;
  opacity: 1;
  transform: scale(1);
  animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-main.compressed .header-left .site-branding {
  display: block;
}

/* Center column hidden in compressed mode */
.header-center {
  transition: none;
}

.header-main.compressed .header-center {
  position: absolute;
  left: -9999px;
  visibility: hidden;
}

/* Right side: social icons */
.header-main.compressed .header-right {
  display: flex;
  justify-content: flex-end;
}

/* Move navigation into left container */
.header-main.compressed .main-navigation {
  margin: 0;
  padding: 0;
  border: none;
  position: static;
  display: flex;
  align-items: center;
}

/* Navigation inline with search and logo */
.header-main.compressed .nav-menu {
  display: flex;
  gap: var(--tcp-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
}

/* Adjust site branding in compressed mode */
.header-main.compressed .site-branding {
  text-align: left;
  margin: 0;
  display: flex;
  align-items: center;
}

/* Move navigation up in compressed mode with smooth transition */
.main-navigation {
  transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-main.compressed .main-navigation {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Navigation items fade slightly */
.nav-menu {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-main.compressed .nav-menu {
  opacity: 1;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}

/* Adjust spacing in compressed mode */
.header-main.compressed .header-left {
  gap: var(--tcp-space-4);
}

/* Keep social icons visible and aligned with smooth transition */
.header-social-icons {
  display: flex;
  gap: var(--tcp-space-3);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-main.compressed .header-social-icons {
  opacity: 1;
}

/* Social icons subtle animation */
.header-main.compressed .social-icon {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.header-main.compressed .social-icon:nth-child(1) {
  animation-delay: 0.05s;
}

.header-main.compressed .social-icon:nth-child(2) {
  animation-delay: 0.1s;
}

.header-main.compressed .social-icon:nth-child(3) {
  animation-delay: 0.15s;
}

.header-main.compressed .social-icon:nth-child(4) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search icon subtle animation on compress */
.header-main.compressed .header-search {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}

/* Responsive adjustments for sticky header */
@media (max-width: 768px) {
  .header-main.compressed {
    padding: var(--tcp-space-1) 0;
  }

  .header-main.compressed .site-logo-small {
    height: 32px;
  }

  .header-main.compressed .main-navigation {
    display: none; /* Hide on mobile when compressed */
  }

  /* Stack layout on mobile */
  .header-top-section {
    grid-template-columns: auto 1fr auto;
  }

  /* Disable some animations on mobile for performance */
  @media (prefers-reduced-motion: reduce) {
    .site-header,
    .header-main,
    .site-branding,
    .site-logo-large,
    .site-logo-small,
    .header-date,
    .main-navigation {
      transition: none;
      animation: none;
    }
  }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header.header-sticky,
  .header-main,
  .header-main.compressed,
  .site-logo-large,
  .site-logo-small,
  .header-date,
  .main-navigation,
  .nav-menu,
  .header-social-icons,
  .social-icon,
  .header-search-wrapper {
    transition: none !important;
    animation: none !important;
  }
}

/**
 * Navigation Submenu Styles
 * Add to header-sticky.css or create separate file
 */

/* ===================================
   SUBMENU / DROPDOWN STYLES
   =================================== */

/* Navigation item container */
.nav-menu > li {
  position: relative;
}

/* Submenu container */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--tcp-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-top: 2px solid var(--tcp-primary);
  padding: var(--tcp-space-2) 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  z-index: 1000;
}

/* Show submenu on hover */
.nav-menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Submenu items */
.nav-menu .sub-menu li {
  position: relative;
  border-bottom: 1px solid var(--tcp-gray-100);
}

.nav-menu .sub-menu li:last-child {
  border-bottom: none;
}

/* Submenu links */
.nav-menu .sub-menu a {
  display: block;
  padding: var(--tcp-space-2) var(--tcp-space-4);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--tcp-gray-700);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease,
    padding-left 0.2s ease;
}

.nav-menu .sub-menu a:hover {
  background-color: var(--tcp-gray-50);
  color: var(--tcp-primary);
  padding-left: var(--tcp-space-5);
}

/* Dropdown indicator (arrow) */
.nav-menu .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  transition: transform 0.3s ease;
}

/* Rotate arrow on hover */
.nav-menu .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* ===================================
   NESTED SUBMENUS (Third Level)
   =================================== */

/* Third level submenu */
.nav-menu .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-left: 1px;
  border-top: 2px solid var(--tcp-primary);
}

/* Show third level on hover */
.nav-menu .sub-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Nested submenu indicator (right arrow) */
.nav-menu .sub-menu .menu-item-has-children > a::after {
  content: "";
  float: right;
  margin-left: auto;
  margin-right: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
  border-right: none;
  transform: none;
}

.nav-menu .sub-menu .menu-item-has-children:hover > a::after {
  transform: translateX(3px);
}

/* ===================================
   COMPRESSED HEADER SUBMENU STYLES
   =================================== */

/* Submenus in compressed header */
.header-main.compressed .nav-menu .sub-menu {
  top: calc(100% + 8px);
  border-top: 2px solid var(--tcp-primary);
}

.header-main.compressed .nav-menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Adjust submenu positioning in compressed mode */
.header-main.compressed .main-navigation {
  position: relative;
}

/* ===================================
   MOBILE SUBMENU STYLES
   =================================== */
/**
 * Mobile Header Styles - CSS ONLY FIX
 * Mueve search a la derecha SIN cambiar HTML
 * Header fixed + Z-index correcto
 */

/* ===================================
   MOBILE HEADER (≤768px)
   =================================== */

@media (max-width: 768px) {
  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Header: FIXED position */
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--tcp-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .header-main {
    padding: var(--tcp-space-3, 0.75rem) 0;
  }

  /* Disable compressed mode on mobile */
  .header-main.compressed {
    padding: var(--tcp-space-3, 0.75rem) 0;
  }

  /* ========== HEADER LAYOUT ========== */
  .header-top-section {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 var(--tcp-space-3, 0.75rem);
  }

  /* ========== LEFT: Search + Menu Toggle ========== */
  .header-left {
    position: absolute;
    left: var(--tcp-space-1, 0.75rem);
    top: 50%;
    transform: translateY(-40%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0;
    width: auto;
  }

  /* MOVE search button to the RIGHT visually with CSS */
  .header-left .header-search {
    /* Remove from normal flow */
    position: absolute;
    left: auto;
    right: calc(-100vw + 100% + var(--tcp-space-8)); /* Move to right edge */
    top: 50%;
    transform: translateY(-50%);

    /* Display properties */
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: var(--tcp-gray-900, #1a1a1a);
    font-size: 1.25rem;
    transition: color 0.3s ease;
    z-index: 10;
  }

  .header-left .header-search:hover,
  .header-left .header-search:active {
    color: var(--tcp-primary, #0066cc);
  }

  .header-left .header-search i {
    display: block;
  }

  /* Menu toggle button - stays in place */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--tcp-gray-900, #1a1a1a);
    font-size: 1.5rem;
    transition: color 0.3s ease;
    position: relative;
    z-index: 10;
  }

  .menu-toggle:hover,
  .menu-toggle.active {
    color: var(--tcp-primary, #0066cc);
  }

  .menu-toggle span {
    display: block;
    line-height: 1;
  }

  /* Hide compressed logo on mobile */
  .site-branding-compressed {
    display: none !important;
  }

  /* ========== CENTER: Logo (PERFECTLY CENTERED) ========== */
  .header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    position: static;
    left: auto;
    visibility: visible;
    flex: 1;
    z-index: 5; /* Below controls */
  }

  .header-center .site-branding {
    text-align: center;
    position: relative;
    z-index: 5;
  }

  .header-center .site-title {
    margin: 0;
    line-height: 1;
  }

  .header-center .site-title a {
    display: block;
    line-height: 1;
    position: relative;
    z-index: 5;
  }

  .site-logo-large {
    height: 50px;
    width: auto;
    display: block;
  }

  .site-logo-small {
    display: none;
  }

  /* Hide date on mobile */
  .header-date {
    display: none;
  }

  /* ========== RIGHT: Social Icons (hidden) ========== */
  .header-right {
    position: absolute;
    right: var(--tcp-space-3, 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Below search button */
  }

  /* Hide social icons on mobile */
  .header-social-icons {
    display: none !important;
  }

  /* ========== NAVIGATION ========== */
  .main-navigation {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--tcp-white, #ffffff);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: left 0.3s ease-in-out;
    z-index: 1001;
    padding: var(--tcp-space-6, 2rem) 0;
    margin: 0;
    border: none;
  }

  .main-navigation.active {
    left: 0;
  }

  /* Nav menu */
  .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav-menu > li {
    border-bottom: 1px solid var(--tcp-gray-200, #e5e7eb);
  }

  .nav-menu > li:last-child {
    border-bottom: none;
  }

  .nav-menu > li > a {
    display: block;
    padding: var(--tcp-space-4, 1rem) var(--tcp-space-4, 1rem);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tcp-gray-900, #1a1a1a);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: left;
  }

  .nav-menu > li > a:hover,
  .nav-menu > li > a:active {
    background-color: var(--tcp-gray-50, #f9fafb);
    color: var(--tcp-primary, #0066cc);
  }

  /* ========== SUBMENUS ========== */
  .nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--tcp-primary, #0066cc);
    background: var(--tcp-gray-50, #f9fafb);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-menu .menu-item-has-children.active > .sub-menu {
    max-height: 1000px;
    padding: var(--tcp-space-2, 0.5rem) 0;
  }

  .nav-menu .sub-menu li {
    border: none;
  }

  .nav-menu .sub-menu a {
    padding: var(--tcp-space-3, 0.75rem) var(--tcp-space-4, 1rem);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--tcp-gray-700, #4b5563);
  }

  .nav-menu .sub-menu a:hover {
    background-color: var(--tcp-white, #ffffff);
    color: var(--tcp-primary, #0066cc);
    padding-left: var(--tcp-space-5, 1.5rem);
  }

  /* ========== SUBMENU TOGGLE: FLECHA ANIMADA ========== */

  .nav-menu .menu-item-has-children {
    position: relative;
  }

  .nav-menu .menu-item-has-children > a {
    padding-right: 50px;
  }

  .nav-menu .menu-item-has-children > a::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    position: absolute;
    right: var(--tcp-space-4, 1rem);
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
  }

  .nav-menu .menu-item-has-children.active > a::after {
    transform: translateY(-50%) rotate(180deg);
  }

  .submenu-toggle {
    display: none !important;
  }

  /* ========== OVERLAY ========== */
  body.menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* ========== DISABLE COMPRESSED MODE ========== */
  .header-main.compressed .header-top-section {
    display: flex;
    justify-content: center;
    position: relative;
  }

  .header-main.compressed .header-left {
    position: absolute;
    left: var(--tcp-space-3, 0.75rem);
  }

  .header-main.compressed .header-left .header-search {
    right: calc(-100vw + 100% + 0.75rem);
  }

  .header-main.compressed .header-center {
    position: static;
    flex: 1;
    visibility: visible;
  }

  .header-main.compressed .header-right {
    position: absolute;
    right: var(--tcp-space-3, 0.75rem);
  }

  .header-main.compressed .main-navigation {
    position: fixed;
    left: -100%;
    margin: 0;
    padding: var(--tcp-space-6, 2rem) 0;
  }

  .header-main.compressed .main-navigation.active {
    left: 0;
  }

  /* ========== ADD SPACING FOR FIXED HEADER ========== */
  .site-main {
    margin-top: 70px !important;
  }

  #main-content {
    margin-top: 70px !important;
  }

  body.admin-bar .site-header {
    top: 46px;
  }

  body.admin-bar .site-main,
  body.admin-bar #main-content {
    margin-top: 116px !important;
  }
}

/* ===================================
   VERY SMALL SCREENS (≤480px)
   =================================== */

@media (max-width: 480px) {
  .site-logo-large {
    height: 40px;
  }

  .menu-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .header-left .header-search {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
  }

  .main-navigation {
    width: 260px;
  }

  .nav-menu > li > a {
    padding: var(--tcp-space-3, 0.75rem) var(--tcp-space-3, 0.75rem);
  }

  .nav-menu .menu-item-has-children > a {
    padding-right: 45px;
  }

  .nav-menu .menu-item-has-children > a::after {
    right: var(--tcp-space-3, 0.75rem);
  }

  .site-main,
  #main-content {
    margin-top: 66px !important;
  }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (max-width: 768px) {
  .menu-toggle:focus-visible,
  .header-search:focus-visible {
    outline: 2px solid var(--tcp-primary, #0066cc);
    outline-offset: 2px;
  }

  .nav-menu a:focus-visible {
    outline: 2px solid var(--tcp-primary, #0066cc);
    outline-offset: -2px;
  }

  @media (prefers-reduced-motion: reduce) {
    .main-navigation,
    .nav-menu .sub-menu,
    .nav-menu .menu-item-has-children > a::after,
    body.menu-open::before {
      transition: none !important;
      animation: none !important;
    }
  }
}
/* ===================================
   ACCESSIBILITY & ANIMATIONS
   =================================== */

/* Focus styles for keyboard navigation */
.nav-menu a:focus {
  outline: 2px solid var(--tcp-primary);
  outline-offset: 2px;
}

/* Keep submenu open when focused */
.nav-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Smooth entrance animation for submenu items */
.nav-menu .sub-menu li {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-menu > li:hover > .sub-menu li {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger animation for submenu items */
.nav-menu > li:hover > .sub-menu li:nth-child(1) {
  transition-delay: 0.05s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(2) {
  transition-delay: 0.1s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(3) {
  transition-delay: 0.15s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(4) {
  transition-delay: 0.2s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(5) {
  transition-delay: 0.25s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(6) {
  transition-delay: 0.2s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(7) {
  transition-delay: 0.18s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(8) {
  transition-delay: 0.16s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(9) {
  transition-delay: 0.14s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(10) {
  transition-delay: 0.12s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(11) {
  transition-delay: 0.1s;
}
.nav-menu > li:hover > .sub-menu li:nth-child(12) {
  transition-delay: 0.08s;
}
/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .nav-menu .sub-menu,
  .nav-menu .sub-menu li,
  .nav-menu .menu-item-has-children > a::after {
    transition: none !important;
    animation: none !important;
  }

  .nav-menu .sub-menu {
    transform: none;
  }
}

/* ===================================
   MEGA MENU SUPPORT (Optional)
   =================================== */

/* Add class "mega-menu" to menu item for wide dropdown */
.nav-menu > .mega-menu > .sub-menu {
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 600px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--tcp-space-4);
  padding: var(--tcp-space-4);
}

.nav-menu > .mega-menu:hover > .sub-menu {
  transform: translateX(-50%) translateY(0);
}

.nav-menu > .mega-menu > .sub-menu > li {
  border: none;
}

/* Mega menu columns */
.nav-menu > .mega-menu > .sub-menu > li > a {
  font-weight: 600;
  color: var(--tcp-gray-900);
  padding-bottom: var(--tcp-space-2);
  border-bottom: 1px solid var(--tcp-gray-200);
  margin-bottom: var(--tcp-space-2);
}

.nav-menu > .mega-menu > .sub-menu .sub-menu {
  position: static;
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0;
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 1024px) {
  .nav-menu > .mega-menu > .sub-menu {
    grid-template-columns: repeat(2, 1fr);
    min-width: 400px;
  }
}

@media (max-width: 768px) {
  .nav-menu > .mega-menu > .sub-menu {
    grid-template-columns: 1fr;
    min-width: auto;
    left: 0;
    transform: none;
  }
}
