/* CLW Flagship Navigation Header & 5-Sector Mega-Menu Preview
   Supports Theme A (Architectural Crisp Light — Recommended) & Theme B (Obsidian Seamless Dark) */

.site-header.clw-hdr {
  background: transparent;
  border-bottom: 0;
}

.clw-hdr {
  --hdr-obsidian: #080f1a;
  --hdr-obsidian-deep: #050a12;
  --hdr-ink: #0e1c2c;
  --hdr-muted: #516478;
  --hdr-accent: #e85d2a;
  --hdr-accent-dark: #c9481a;
  --hdr-accent-soft: #f39a76;
  --hdr-line: #e4e9f0;
  position: sticky;
  top: 0;
  z-index: 60;
  font-family: var(--sans, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

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

/* Top Brand Accent Hairline */
.clw-hdr::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #e85d2a 0%, #f39a76 28%, #0f2238 75%, #080f1a 100%);
}

/* =========================================================
   UTILITY BAR (Ultra-slim 32px — saves vertical height)
   ========================================================= */
.clw-hdr-util {
  background: var(--hdr-obsidian);
  color: #c2d1e3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: max-height 0.22s ease, opacity 0.22s ease;
}

.clw-hdr-util-inner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  font-weight: 500;
}

.clw-hdr-util-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.clw-hdr-util-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hdr-accent);
  flex: none;
}

.clw-hdr-util-right {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.clw-hdr-util-badge {
  color: #93a7be;
  letter-spacing: 0.04em;
}

.clw-hdr-mail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e6eef8;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.clw-hdr-mail:hover {
  color: var(--hdr-accent-soft);
}

.clw-hdr-mail svg {
  width: 13px;
  height: 13px;
  color: var(--hdr-accent-soft);
}

/* =========================================================
   MAIN NAV BAR — THEME A: Architectural Crisp Light
   ========================================================= */
.clw-hdr-main {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hdr-line);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.clw-hdr.is-scrolled .clw-hdr-main {
  box-shadow: 0 10px 30px rgba(8, 15, 26, 0.08);
}

.clw-hdr-row {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: min-height 0.2s ease;
}

.clw-hdr.is-scrolled .clw-hdr-row {
  min-height: 60px;
}

/* Brand Logo Switch */
.clw-hdr-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
}

.clw-hdr-brand img {
  display: block;
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: height 0.2s ease;
}

.clw-hdr.is-scrolled .clw-hdr-brand img {
  height: 39px;
}

.clw-hdr-brand .logo-dark-theme {
  display: none;
}

/* Nav Links */
.clw-hdr-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 26px);
}

.clw-hdr-link,
.clw-hdr-drop > summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 2px;
  color: var(--hdr-ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
  transition: color 0.16s ease;
}

.clw-hdr-drop > summary::-webkit-details-marker {
  display: none;
}

.clw-hdr-drop > summary > a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.clw-hdr-chev {
  width: 14px;
  height: 14px;
  color: #7c8ea2;
  flex: none;
  transition: transform 0.2s ease, color 0.16s ease;
}

.clw-hdr-drop[open] > summary .clw-hdr-chev {
  transform: rotate(180deg);
  color: var(--hdr-accent);
}

/* Crisp Animated Terracotta Underline */
.clw-hdr-link::after,
.clw-hdr-drop > summary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--hdr-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.clw-hdr-link:hover,
.clw-hdr-drop:hover > summary,
.clw-hdr-drop[open] > summary {
  color: var(--hdr-accent-dark);
}

.clw-hdr-link:hover::after,
.clw-hdr-drop:hover > summary::after,
.clw-hdr-drop[open] > summary::after {
  transform: scaleX(1);
}

/* Primary CTA Button — Crisp White Text on Vibrant Brand Terracotta */
.clw-hdr-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--hdr-accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(232, 93, 42, 0.26);
  transition: background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.clw-hdr-cta:hover {
  background: var(--hdr-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(232, 93, 42, 0.34);
}

.clw-hdr-cta svg {
  width: 14px;
  height: 14px;
}

/* =========================================================
   THEME B: Obsidian Seamless Dark OEM Header
   ========================================================= */
.clw-hdr[data-theme="dark"] .clw-hdr-util {
  background: var(--hdr-obsidian-deep);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.clw-hdr[data-theme="dark"] .clw-hdr-main {
  background: rgba(8, 15, 26, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.clw-hdr[data-theme="dark"].is-scrolled .clw-hdr-main {
  background: rgba(8, 15, 26, 0.98);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
}

.clw-hdr[data-theme="dark"] .clw-hdr-brand .logo-light-theme {
  display: none;
}

.clw-hdr[data-theme="dark"] .clw-hdr-brand .logo-dark-theme {
  display: block;
}

.clw-hdr[data-theme="dark"] .clw-hdr-link,
.clw-hdr[data-theme="dark"] .clw-hdr-drop > summary {
  color: #dce6f2;
}

.clw-hdr[data-theme="dark"] .clw-hdr-chev {
  color: #8ba0b8;
}

.clw-hdr[data-theme="dark"] .clw-hdr-link:hover,
.clw-hdr[data-theme="dark"] .clw-hdr-drop:hover > summary,
.clw-hdr[data-theme="dark"] .clw-hdr-drop[open] > summary {
  color: #ffffff;
}

.clw-hdr[data-theme="dark"] .clw-hdr-burger {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.clw-hdr[data-theme="dark"] .clw-hdr-burger span {
  background: #ffffff;
}

/* =========================================================
   UPGRADED 5-SECTOR ARCHITECTURAL MEGA-MENU & DROPDOWNS
   ========================================================= */
.clw-hdr-drop {
  position: static;
}

.clw-hdr-drop--compact {
  position: relative;
}

.clw-hdr-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 70;
  margin-top: 0;
  background: #ffffff;
  border: 1px solid #dfe6ef;
  border-top: 2px solid var(--hdr-accent);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 26px 56px rgba(8, 15, 26, 0.16);
  color: var(--hdr-ink);
  overflow: hidden;
  animation: clwPanelIn 0.16s ease-out;
}

@keyframes clwPanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.clw-mega-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
}

.clw-mega-sectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 26px;
  padding: 24px 28px;
}

.clw-mega-col-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.clw-mega-group h3 {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #edf1f6;
  font-family: var(--sans, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hdr-accent-dark);
}

.clw-mega-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clw-mega-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  margin: 0 -9px;
  border-radius: 8px;
  color: #1f3145;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.clw-mega-group a:hover {
  background: #f4f7fb;
  color: var(--hdr-accent-dark);
}

/* Right Obsidian Quick-Action Spotlight inside Mega-Menu */
.clw-mega-aside {
  background: linear-gradient(160deg, #0d1a2c 0%, #08111e 100%);
  color: #f4f7fb;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.clw-mega-aside-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hdr-accent-soft);
}

.clw-mega-aside h4 {
  margin: 0;
  font-family: var(--serif, Georgia, "Times New Roman", serif);
  font-size: 19px;
  line-height: 1.24;
  color: #ffffff;
}

.clw-mega-aside p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.56;
  color: #c2d1e3;
}

.clw-mega-aside-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clw-mega-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--hdr-accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.clw-mega-btn-primary:hover {
  background: var(--hdr-accent-dark);
}

.clw-mega-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #edf3fa;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.clw-mega-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Compact Dropdowns (Su chasis, Países, Licitaciones) */
.clw-hdr-panel--compact {
  left: -14px;
  right: auto;
  min-width: 280px;
  padding: 12px;
  border-radius: 0 0 14px 14px;
}

.clw-hdr-panel--countries {
  min-width: 340px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.clw-compact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.14s ease;
}

.clw-compact-item:hover {
  background: #f4f7fb;
}

.clw-compact-item strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--hdr-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.clw-compact-item:hover strong {
  color: var(--hdr-accent-dark);
}

.clw-compact-item span {
  font-size: 12px;
  color: var(--hdr-muted);
  line-height: 1.4;
}

.clw-country-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 20px;
  border-radius: 5px;
  background: #edf2f7;
  color: #273b50;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.clw-compact-item:hover .clw-country-code {
  background: #fdeae2;
  color: var(--hdr-accent-dark);
}

/* Mobile Hamburger */
.clw-hdr-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.clw-hdr-burger span {
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: var(--hdr-ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.clw-hdr-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.clw-hdr-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.clw-hdr-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   MOBILE RESPONSIVE
   ========================================================= */
@media (max-width: 1060px) {
  .clw-hdr-util-badge {
    display: none;
  }
  .clw-hdr-row {
    flex-wrap: wrap;
    min-height: 62px;
    padding: 8px 0;
  }
  .clw-hdr-brand img {
    height: 38px;
  }
  .clw-hdr-burger {
    display: flex;
  }
  .clw-hdr-nav {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 0 14px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
  }
  .clw-hdr-nav[data-open="true"] {
    display: flex;
  }
  .clw-hdr-link,
  .clw-hdr-drop > summary {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 4px 2px;
    border-bottom: 1px solid rgba(130, 148, 168, 0.2);
  }
  .clw-hdr-drop > summary > a {
    flex: 1;
  }
  .clw-hdr-link::after,
  .clw-hdr-drop > summary::after {
    display: none;
  }
  .clw-hdr-panel,
  .clw-hdr-panel--compact {
    position: static;
    border: 0;
    border-left: 2px solid var(--hdr-accent);
    border-radius: 0 10px 10px 0;
    box-shadow: none;
    margin: 6px 0 10px 4px;
    min-width: 0;
    animation: none;
  }
  .clw-mega-grid {
    grid-template-columns: 1fr;
  }
  .clw-mega-sectors {
    grid-template-columns: 1fr;
    padding: 14px 16px;
    gap: 14px;
  }
  .clw-mega-aside {
    padding: 16px;
  }
  .clw-hdr-panel--countries {
    grid-template-columns: 1fr;
  }
  .clw-hdr-cta {
    margin: 14px 0 0;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .clw-hdr-util-right {
    display: none;
  }
}
