/* =====================================================================
   Icicles Adventure - site header (v2)
   Two rows: white info/CTA strip  +  dark primary navigation bar.
   Scoped with .ic-header* / .ic-nav* so it sits alongside style.css.
   Loaded AFTER style.css so it wins where selectors overlap.
   ===================================================================== */

:root {
  --ich-red: #ef4838;
  --ich-red-dark: #d92d22;
  --ich-ink: #151515;
  --ich-muted: #6c6c6c;
  --ich-line: #e8e8e8;
  --ich-soft-red: #fff1ef;
  --ich-nav-a: #202020;
  --ich-nav-b: #151515;
}

/* ===================== TOP STRIP (white) ===================== */
.ic-header {
  background: #fff;
  position: relative;
  z-index: 1000;
}
.ic-header-top {
  background: #fff;
  border-top: 1px solid #f2f2f2;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.ic-header-top .container {
  max-width: 1240px;
}
.ic-header-grid {
  min-height: 118px;
  padding: 18px 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto auto;
  align-items: center;
  gap: 28px;
}

/* Logo */
.ic-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}
.ic-brand img {
  width: auto;
  max-width: 340px;
  height: 78px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

/* Shared block (trust + contact) with left divider */
.ic-header-badge,
.ic-header-contact {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  min-height: 62px;
}
.ic-header-contact::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--ich-line);
}

/* Trust / positioning */
.ic-badge-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ich-soft-red);
  color: var(--ich-red);
  font-size: 20px;
}
.ic-badge-copy { line-height: 1.2; }
.ic-badge-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--ich-red);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.ic-badge-copy strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--ich-ink);
  line-height: 1.15;
}
.ic-badge-copy small {
  display: block;
  margin-top: 4px;
  color: var(--ich-muted);
  font-size: 13px;
}

/* WhatsApp / phone */
.ic-contact-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .04);
  color: #25d366;
  font-size: 24px;
}
.ic-contact-copy { min-width: 0; line-height: 1.2; }
.ic-contact-copy > span {
  display: block;
  color: #555;
  font-size: 13px;
}
.ic-contact-copy a {
  display: inline-block;
  margin-top: 2px;
  color: var(--ich-ink);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ic-contact-copy a:hover { color: var(--ich-red); }
.ic-contact-copy small {
  display: block;
  margin-top: 3px;
  color: var(--ich-muted);
  font-size: 12px;
}

/* CTA */
.ic-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f14b3c 0%, #e63628 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(239, 72, 56, .20);
  text-decoration: none;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ic-header-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239, 72, 56, .27);
  background: linear-gradient(180deg, #ec4031 0%, #cf2f22 100%);
}
.ic-header-cta .fa-arrow-right { font-size: 12px; }

/* Mobile actions (hidden on desktop) */
.ic-header-mobile { display: none; }
.ic-mobile-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid #e5e5e5;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--ich-ink);
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}
.ic-mobile-btn.ic-mobile-wa { color: #25d366; }
.ic-mobile-btn.ic-mobile-menu { box-shadow: none; }
.ic-mobile-btn:focus-visible { outline: none; box-shadow: 0 0 0 .2rem rgba(239, 72, 56, .25); }

/* ===================== PRIMARY NAV (dark) ===================== */
/* .down-menu / #navbar-example2 kept from the old markup (JS + sticky hooks) */
.down-menu {
  background: linear-gradient(180deg, var(--ich-nav-a), var(--ich-nav-b));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.down-menu .container { max-width: 1240px; }

.ic-nav {
  display: flex;
  align-items: stretch;
  min-height: 62px;
}

/* Red HOME tab with pointer */
.ic-nav-home {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 24px;
  background: linear-gradient(180deg, #ee4536, #d92d22);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
}
.ic-nav-home:hover { color: #fff; background: linear-gradient(180deg, #e93f30, #c9291f); }
/* Downward pointer only when the home page is the active page
   (body.page-home is set by master.blade.php on Request::is('/')). */
.page-home .ic-nav-home::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid #d92d22;
}

/* Menu links container - centred.
   #navbarSupportedContent is a Bootstrap offcanvas; inside .navbar-expand-xl it
   is neutralised to a static flex row at >=1200px (see Bootstrap _navbar), so we
   just need to let its body fill the bar and centre the menu. Below 1200 (incl.
   tablet landscape) it stays an off-canvas panel. */
.ic-nav .navbar-collapse { justify-content: center; }
.ic-nav .site-main-nav { margin: 0 auto; }
@media (min-width: 1200px) {
  #navbarSupportedContent.offcanvas .offcanvas-body {
    flex-grow: 1;
    justify-content: center;
  }
  /* safety: if the mobile accordion ran before a resize up to desktop */
  .site-main-nav .button-open { display: none; }
}

/* Search toggle */
.ic-nav-search {
  width: 62px;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 17px;
  text-decoration: none;
  transition: background .15s ease;
}
.ic-nav-search:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Collapsible search form */
.ic-header-search { width: 100%; }
.ic-header-search form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  position: relative;
}
.ic-header-search .fa-magnifying-glass {
  position: absolute;
  left: 18px;
  color: #999;
  font-size: 14px;
  pointer-events: none;
}
.ic-header-search input {
  flex: 1;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 15px;
}
.ic-header-search input::placeholder { color: rgba(255, 255, 255, .6); }
.ic-header-search input:focus {
  outline: none;
  border-color: var(--ich-red);
  background: rgba(255, 255, 255, .1);
}
.ic-header-search button {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--ich-red);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
}
.ic-header-search button:hover { background: var(--ich-red-dark); }

/* The CMS menu's first item is a bare home icon - redundant now that we have
   the dedicated red HOME tab, so hide that one item (icon-only link). */
.site-main-nav > li.nav-item:has(> a.nav-link > .fa-home:only-child),
.site-main-nav > li.nav-item:has(> a.nav-link > .fa-house:only-child) {
  display: none;
}

/* ---- Restyle the DB-driven menu for the dark bar ---- */
.down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link {
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 20px 14px;
  color: #f4f4f4;
  white-space: nowrap;
}
.down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link:hover,
.down-menu .ic-nav .site-main-nav > li.nav-item.show > .nav-link,
.down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link.show,
.down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link[aria-expanded="true"] {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

/* ---- Dropdown panels: soft shadow, square, borderless ---- */
/* Top-level panels only (direct child of the nav item) so the mega-menu's inner
   column lists are left untouched. */
.down-menu .ic-nav .site-main-nav > li.dropdown > .dropdown-menu {
  border: 0;
  border-radius: 0;
  background-color: #fff;
  box-shadow:
    0 20px 44px rgba(20, 20, 20, .18),
    0 6px 14px rgba(20, 20, 20, .08);
}

/* Simple (non-mega) dropdowns: pad the panel, drop the trailing divider. */
.down-menu .ic-nav .site-main-nav > li.dropdown:not(.mega-menu) > .dropdown-menu {
  padding: 6px 0;
}
.down-menu .ic-nav .site-main-nav .dropdown:not(.mega-menu) .dropdown-menu > .nav-item:last-child > .nav-link {
  border-bottom: 0;
}

/* Flyout sub-menus sit flush against their parent's right edge - carry the same
   surface. */
.down-menu .ic-nav .site-main-nav .dropdown:not(.mega-menu) .dropdown-menu .dropdown-menu {
  border: 0;
  border-radius: 0;
  background-color: #fff;
  box-shadow:
    0 20px 44px rgba(20, 20, 20, .18),
    0 6px 14px rgba(20, 20, 20, .08);
}

/* Mega-menu can be taller than the viewport - cap it and scroll inside.
   Desktop only; below 1200px the nav is an off-canvas accordion that scrolls
   with the panel. */
@media (min-width: 1200px) {
  .down-menu .ic-nav .site-main-nav > li.mega-menu > .dropdown-menu.show {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .down-menu.sticky .ic-nav .site-main-nav > li.mega-menu > .dropdown-menu.show {
    max-height: calc(100vh - 80px);
  }
  .down-menu .ic-nav .site-main-nav > li.mega-menu > .dropdown-menu.show::-webkit-scrollbar {
    width: 8px;
  }
  .down-menu .ic-nav .site-main-nav > li.mega-menu > .dropdown-menu.show::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .22);
    border-radius: 4px;
  }

  /* Let the columns shrink instead of spilling their text into the neighbour,
     and let long trek names break rather than overflow. */
  .down-menu .ic-nav .site-main-nav > li.mega-menu > .dropdown-menu > .nav-item {
    min-width: 0;
  }
  .down-menu .ic-nav .site-main-nav > li.mega-menu .nav-link {
    overflow-wrap: break-word;
  }
}

/* Sticky state (class toggled on #navbar-example2 by master.blade.php JS) */
.down-menu.sticky {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

/* ===================== RESPONSIVE ===================== */

/* Below xl the trust badge is dropped from the top strip */
@media (max-width: 1199.98px) {
  .ic-header-badge { display: none; }
}

/* Tablet (incl. landscape) + mobile: nav becomes an off-canvas panel,
   hamburger moves into the top strip */
@media (max-width: 1199.98px) {
  .ic-header-grid {
    min-height: 78px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .ic-brand img { max-width: 230px; height: 58px; }
  .ic-header-contact,
  .ic-header-cta,
  .ic-nav-home,
  .ic-nav-search,
  .ic-header-search { display: none !important; }
  .ic-header-mobile { display: flex; align-items: center; gap: 9px; }

  .down-menu {
    background: transparent;
    box-shadow: none;
  }
  .down-menu .container { padding-left: 0; padding-right: 0; }
  .ic-nav { min-height: 0; display: block; }

  /* ---------- Off-canvas mobile menu ---------- */
  #navbarSupportedContent.offcanvas {
    --bs-offcanvas-width: min(86vw, 340px);
    background: linear-gradient(180deg, var(--ich-nav-a), var(--ich-nav-b));
    color: #fff;
  }
  #navbarSupportedContent .offcanvas-header {
    padding: 13px 18px;
    background: rgba(0, 0, 0, .28);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  #navbarSupportedContent .offcanvas-title {
    display: inline-flex;
    align-items: center;
    line-height: 0;
  }
  #navbarSupportedContent .offcanvas-title img {
    display: block;
    width: auto;
    height: 34px;
    /* render the full-colour logo as a clean white mark on the dark panel */
    filter: brightness(0) invert(1);
  }
  #navbarSupportedContent .offcanvas-header .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: .8;
  }
  #navbarSupportedContent .offcanvas-header .btn-close:hover { opacity: 1; }
  #navbarSupportedContent .offcanvas-body { padding: 6px 14px 24px 0; }

  #navbarSupportedContent .site-main-nav {
    width: 100%;
    margin: 0;
    flex-direction: column;
  }
  #navbarSupportedContent .site-main-nav > li { width: 100%; }
  .down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link { padding: 12px 20px; }

  /* Expanding a section must not tint its row */
  .down-menu .ic-nav .site-main-nav > li.nav-item.show > .nav-link,
  .down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link.show,
  .down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link.active,
  .down-menu .ic-nav .site-main-nav > li.nav-item > .nav-link[aria-expanded="true"] {
    background: transparent;
  }

  /* Flatten every sub-level (plain + mega) into an indented accordion list;
     the jQuery handler in master.blade.php toggles them open/closed. */
  .site-main-nav .dropdown-menu,
  .site-main-nav .mega-menu > .dropdown-menu,
  .site-main-nav .mega-menu .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    padding: 0 0 0 15px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .site-main-nav .mega-menu .dropdown-menu > .nav-item {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .site-main-nav .dropdown-menu .nav-link { color: #e9e9e9 !important; }
  .site-main-nav .button-open { float: right; padding: 0 6px; }
  /* Mega sub-categories stay expanded (forced by base CSS), so their +/- toggle
     does nothing - hide it to avoid a dead affordance. */
  .site-main-nav .mega-menu .dropdown-menu .button-open { display: none; }

  /* Drop the desktop dropdown carets/pointer triangles - the +/- buttons are
     the mobile affordance. */
  .site-main-nav .nav-link::after,
  .site-main-nav .mega-menu > a::before,
  .site-main-nav .dropdown-menu::before,
  .site-main-nav .dropdown-menu::after { content: none !important; display: none !important; }

  /* Swap Bootstrap's blue focus halo for an outline that doesn't tint the row */
  #navbarSupportedContent .site-main-nav .nav-link:focus-visible {
    box-shadow: none;
    outline: 2px solid rgba(255, 255, 255, .45);
    outline-offset: -3px;
  }
  #navbarSupportedContent .btn-close:focus { box-shadow: none; }
}

@media (max-width: 575.98px) {
  .ic-brand img { max-width: 200px; height: 52px; }
  .ic-mobile-btn { width: 40px; height: 40px; }
}
