/* =========================================================
   DEUTSCH GO — FINAL HEADER V2
   Desktop: transparent overlay on hero
   Mobile: normal white header
   Mobile menu: above header
   Mobile search: page content starts clearly below header
========================================================= */

:root{
  --dg-navy:#081F2B;
  --dg-petrol:#123B4A;
  --dg-blue:#1C5D70;
  --dg-yellow:#F4C542;
  --dg-paper:#FFF8F1;
}

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

@media (min-width:1024px){

  body .bg-white.sticky.top-0.w-full.z-30:has(.default_header),
  body .bg-white.sticky.top-0.w-full.z-30:has(.default_header_container){
    position:absolute !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
    inset-inline:0 !important;
    width:100% !important;
    z-index:9999 !important;

    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body .default_header,
  body .default_header_container{
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body .default_header{
    color:var(--dg-paper) !important;
    padding-top:10px !important;
    padding-bottom:10px !important;
  }

  body .default_header [class*="bg-white"],
  body .default_header button.bg-white{
    background:transparent !important;
  }

  body .default_header_logo{
    position:relative !important;
    isolation:isolate;
  }

  body .default_header_logo::before{
    content:"";
    position:absolute;
    left:50%;
    top:50%;
    width:150px;
    height:84px;
    transform:translate(-50%,-50%);
    z-index:-1;
    pointer-events:none;

    background:radial-gradient(
      ellipse at center,
      rgba(244,197,66,.22) 0%,
      rgba(244,197,66,.10) 34%,
      rgba(244,197,66,.03) 58%,
      transparent 76%
    );

    filter:blur(13px);
    opacity:.9;
  }

  body .default_header_logo .relative{
    height:58px !important;
    overflow:visible !important;
  }

  body .default_header_logo img{
    width:auto !important;
    height:58px !important;
    object-fit:contain !important;
    filter:
      drop-shadow(0 6px 15px rgba(8,31,43,.34))
      drop-shadow(0 0 8px rgba(244,197,66,.08));
  }

  body .default_header a,
  body .default_header button{
    color:var(--dg-paper) !important;
  }

  body .default_header svg{
    color:currentColor !important;
  }

  body .default_header svg path{
    stroke:currentColor;
  }

  body .default_header .ms-auto a:hover,
  body .default_header .ms-auto button:hover{
    color:var(--dg-yellow) !important;
    opacity:1 !important;
  }

  body .default_header .hidden.lg\:block{
    width:fit-content !important;
    max-width:calc(100vw - 40px) !important;
    margin:8px auto 0 !important;
    padding:6px 9px !important;

    border:1px solid rgba(255,248,241,.13) !important;
    border-radius:18px !important;
    background:rgba(8,31,43,.32) !important;

    backdrop-filter:blur(7px) saturate(112%);
    -webkit-backdrop-filter:blur(7px) saturate(112%);

    box-shadow:
      0 12px 30px rgba(8,31,43,.18),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
  }

  body .default_header .hidden.lg\:block > div{
    display:flex !important;
    width:max-content !important;
    max-width:100% !important;
    justify-content:center !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:6px 10px !important;
  }

  body .default_header .hidden.lg\:block a{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    padding:8px 12px !important;
    border-radius:12px !important;

    background:transparent !important;
    color:rgba(255,248,241,.90) !important;

    font-size:13px !important;
    font-weight:700 !important;
    line-height:1.2 !important;
    text-decoration:none !important;
    white-space:nowrap !important;

    transition:
      color .2s ease,
      background-color .2s ease,
      transform .2s ease,
      box-shadow .2s ease !important;
  }

  body .default_header .hidden.lg\:block a::after{
    content:none !important;
    display:none !important;
  }

  body .default_header .hidden.lg\:block a:hover{
    color:var(--dg-yellow) !important;
    background:rgba(255,255,255,.055) !important;
    transform:translateY(-1px);
    box-shadow:
      inset 0 0 0 1px rgba(244,197,66,.08),
      0 6px 18px rgba(8,31,43,.12) !important;
  }
}

/* =========================================================
   MOBILE AND TABLET
========================================================= */

@media (max-width:1023px){

  body .bg-white.sticky.top-0.w-full.z-30:has(.default_header),
  body .bg-white.sticky.top-0.w-full.z-30:has(.default_header_container){
    position:relative !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    inset:auto !important;
    width:100% !important;
    z-index:40 !important;

    background:#fff !important;
    border:0 !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body .default_header,
  body .default_header_container{
    background:#fff !important;
    color:#131316 !important;
    border:0 !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body .default_header{
    padding-top:8px !important;
    padding-bottom:8px !important;
  }

  body .default_header .lg\:h-16.h-18{
    min-height:58px !important;
    height:58px !important;
    align-items:center !important;
    flex-wrap:nowrap !important;
  }

  body .default_header_logo{
    position:relative !important;
    z-index:2 !important;
  }

  body .default_header_logo::before{
    content:none !important;
    display:none !important;
  }

  body .default_header_logo .relative,
  body .default_header_logo img{
    height:44px !important;
  }

  body .default_header .flex-1.flex.items-center.gap-3,
  body .default_header .ms-auto.flex.items-center.flex-1{
    min-width:0 !important;
    height:100% !important;
    align-items:center !important;
  }

  body .default_header button,
  body .default_header a{
    color:#131316 !important;
  }

  body .default_header button{
    background:transparent !important;
  }

  body .default_header a[href="/search"],
  body .default_header a[href$="/search"]{
    position:relative !important;
    z-index:3 !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    width:40px !important;
    height:40px !important;
    padding:0 !important;
    margin:0 !important;

    pointer-events:auto !important;
    touch-action:manipulation;
  }

  body .default_header button:hover,
  body .default_header a:hover{
    color:var(--dg-blue) !important;
    opacity:1 !important;
  }

  body [role="dialog"],
  body [data-headlessui-portal],
  body .fixed.inset-0,
  body .fixed.inset-y-0,
  body .fixed.z-40,
  body .fixed.z-50{
    z-index:10050 !important;
  }

  body [role="dialog"] > div,
  body [data-headlessui-portal] > div{
    position:relative;
    z-index:10051 !important;
  }

  body.dg-mobile-menu-open
  .bg-white.sticky.top-0.w-full.z-30:has(.default_header){
    z-index:20 !important;
  }

  /* Search page: add a clear visual gap below the header */
  body.dg-search-page main,
  body.dg-search-page [role="main"],
  body.dg-search-page #main,
  body.dg-search-page .main-content{
    position:relative !important;
    z-index:1 !important;
    padding-top:52px !important;
  }

  /* If the search form is the first visible block, push it down too */
  body.dg-search-page form[role="search"],
  body.dg-search-page form[action*="/search"]{
    margin-top:24px !important;
  }

  body.dg-search-page input[type="search"],
  body.dg-search-page input[name="q"]{
    scroll-margin-top:120px;
  }
}

/* =========================================================
   SEARCH PAGE SAFETY FIX
   Keep the header normal on /search and prevent overlap.
========================================================= */

body.dg-search-page .bg-white.sticky.top-0.w-full.z-30:has(.default_header),
body.dg-search-page .bg-white.sticky.top-0.w-full.z-30:has(.default_header_container) {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  inset: auto !important;
  width: 100% !important;
  z-index: 40 !important;

  background: #ffffff !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.dg-search-page .default_header,
body.dg-search-page .default_header_container {
  background: #ffffff !important;
  color: #131316 !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.dg-search-page .default_header a,
body.dg-search-page .default_header button,
body.dg-search-page .default_header svg {
  color: #131316 !important;
}

body.dg-search-page .default_header_logo::before {
  content: none !important;
  display: none !important;
}

body.dg-search-page main,
body.dg-search-page [role="main"],
body.dg-search-page #main,
body.dg-search-page .main-content {
  padding-top: 0 !important;
}

body.dg-search-page form[role="search"],
body.dg-search-page form[action*="/search"] {
  margin-top: 0 !important;
}


/* =========================================================
   ROUTE-SAFE SEARCH / HOME HEADER FIX V3
========================================================= */

/* Search page: normal white header and content safely below it */
body.dg-search-page .bg-white.sticky.top-0.w-full.z-30:has(.default_header),
body.dg-search-page .bg-white.sticky.top-0.w-full.z-30:has(.default_header_container) {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  inset: auto !important;
  width: 100% !important;
  z-index: 40 !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.dg-search-page .default_header,
body.dg-search-page .default_header_container {
  background: #fff !important;
  color: #131316 !important;
}

body.dg-search-page main,
body.dg-search-page [role="main"],
body.dg-search-page #main,
body.dg-search-page .main-content {
  padding-top: var(--dg-search-safe-top, 96px) !important;
}

/* Returning to home/hero: force the desktop header back to transparent */
@media (min-width: 1024px) {
  body:not(.dg-search-page) .bg-white.sticky.top-0.w-full.z-30:has(.default_header),
  body:not(.dg-search-page) .bg-white.sticky.top-0.w-full.z-30:has(.default_header_container) {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    inset-inline: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body:not(.dg-search-page) .default_header,
  body:not(.dg-search-page) .default_header_container {
    background: transparent !important;
    color: var(--dg-paper) !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body:not(.dg-search-page) .default_header a,
  body:not(.dg-search-page) .default_header button,
  body:not(.dg-search-page) .default_header svg {
    color: var(--dg-paper) !important;
  }
}
