/**
 * DAP Logistics - shared header navigation (dropdown + off-canvas).
 */

/* ── Desktop Services dropdown ── */
.nav-item.has-submenu {
  position: relative;
}

/* Invisible bridge so cursor can reach the submenu without losing hover */
.nav-item.has-submenu::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

.nav-item.has-submenu .nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-chevron {
  font-size: 14px;
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-item.has-submenu:hover .nav-chevron,
.nav-item.has-submenu:focus-within .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: rgba(5, 16, 31, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  animation: dapNavDropdownIn 0.18s ease;
}

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

.nav-item.has-submenu:hover .nav-submenu,
.nav-item.has-submenu:focus-within .nav-submenu {
  display: block;
}

.nav-submenu a {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-submenu a:hover,
.nav-submenu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Hamburger (shared) ── */
.dap-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  margin-left: 4px;
  background: transparent;
  border: none;
  flex-shrink: 0;
}

.dap-nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.dap-nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.dap-nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.dap-nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Off-canvas overlay + panel ── */
.dap-offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 16, 31, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1098;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dap-offcanvas-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.dap-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: rgba(5, 16, 31, 0.99);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1099;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dap-offcanvas.is-open {
  transform: translateX(0);
}

body.dap-nav-open {
  overflow: hidden;
}

.dap-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.dap-offcanvas-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.dap-offcanvas-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dap-offcanvas-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dap-offcanvas-close i {
  font-size: 18px;
}

.dap-offcanvas-nav {
  flex: 1;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dap-offcanvas-item {
  display: flex;
  flex-direction: column;
}

.dap-offcanvas-toggle,
.dap-offcanvas-link {
  margin: 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
}

.dap-offcanvas-toggle:hover,
.dap-offcanvas-link:hover,
.dap-offcanvas-toggle.active,
.dap-offcanvas-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.dap-offcanvas-toggle i {
  font-size: 16px;
  transition: transform 0.25s ease;
}

.dap-offcanvas-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.dap-offcanvas-submenu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 8px 8px;
}

.dap-offcanvas-submenu[hidden] {
  display: none !important;
}

.dap-offcanvas-submenu a {
  display: block;
  margin: 5px 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 2px solid rgba(29, 110, 255, 0.35);
  transition: color 0.15s ease, background 0.15s ease;
}

.dap-offcanvas-submenu a:hover,
.dap-offcanvas-submenu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.dap-offcanvas-quote {
  font-weight: 600;
  color: #fff;
  background: rgba(29, 110, 255, 0.15);
  border-color: rgba(29, 110, 255, 0.25);
}

.dap-offcanvas-actions {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.dap-offcanvas-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: #25d366;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(37, 211, 102, 0.28);
  transition: background 0.15s ease;
}

.dap-offcanvas-wa:hover {
  background: rgba(37, 211, 102, 0.08);
}

.dap-offcanvas-expand {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 14px;
  color: var(--gold, #c9a84c);
  background: rgba(200, 169, 74, 0.08);
  border-color: rgba(200, 169, 74, 0.2);
}

.dap-offcanvas-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: #1a6bff;
  transition: background 0.15s ease;
}

.dap-offcanvas-cta:hover {
  background: #1558d6;
}

/* Hide legacy full-screen mobile nav when off-canvas is active */
.nav-mobile,
.page-mobile-nav,
.hp-mobile-nav {
  display: none !important;
}

/* ── Tablet + mobile: show hamburger, hide desktop links ── */
@media screen and (max-width: 1024px) {
  .dap-nav-hamburger {
    display: flex !important;
  }

  .nav-links {
    display: none !important;
  }

  .nav-actions .nav-wa-link,
  .nav-right .nav-wa,
  .nav-right .nav-cta,
  .nav-actions .btn-blue:not(.dap-keep-mobile) {
    display: none !important;
  }
}

/* Desktop only: ensure off-canvas is not visible */
@media screen and (min-width: 1025px) {
  .dap-offcanvas,
  .dap-offcanvas-overlay {
    display: none !important;
  }
}
