/* Discount Court Documents mega-menu pattern adapted for Grenier's Towing & Truck Shop.
   Source reference: Discount_Court_Documents_Rebrand/assets/css/discount-court-documents-site.css
   Layout copied from mega-shell / mega-panel pattern; colors use Greniers purple/gold branding. */

:root {
  --gr-mega-purple: #2e0c5e;
  --gr-mega-purple-deep: #17062f;
  --gr-mega-gold: #ffd700;
  --gr-mega-gold-dark: #daa520;
  --gr-mega-cream: #fffaf0;
  --gr-mega-line: rgba(46, 12, 94, 0.16);
  --gr-mega-muted: #4b5563;
  --gr-mega-shadow: rgba(46, 12, 94, 0.22);
  --gr-straddle-logo-height: 230px;
  --gr-mega-below-logo-gap: 14px;
}

@media (min-width: 1200px) and (max-width: 1400px) {
  :root {
    --gr-straddle-logo-height: 173px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  :root {
    --gr-straddle-logo-height: 130px;
  }
}

@media (min-width: 992px) {
  /* Logo straddles the bottom edge of the purple nav; mega menu drops below "Grenier's Towing" text */
  .header-section.header__one {
    position: relative !important;
    overflow: visible !important;
  }

  .header-section.header__one .straddle-logo {
    top: 100% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) translateZ(0) !important;
    z-index: 25 !important;
  }

  .header-section.header__one > .mega-shell {
    position: absolute !important;
    /* Logo is anchored at top:175% sitewide (non-sticky); drop the panel below its bottom edge so it never covers the center logo. */
    top: calc(175% + (var(--gr-straddle-logo-height) / 2) + var(--gr-mega-below-logo-gap)) !important;
    left: 0 !important;
    width: 100% !important;
    pointer-events: none;
    z-index: 12020 !important;
  }

  .header-section.sticky-header.header__one .straddle-logo {
    top: 100% !important;
    transform: translate(-50%, -50%) translateZ(0) !important;
  }

  .header-section.sticky-header.header__one > .mega-shell {
    top: calc(100% + 50px + var(--gr-mega-below-logo-gap)) !important;
  }

  .mega-panel {
    position: absolute;
    top: 0;
    left: 50% !important;
    right: auto !important;
    width: min(1240px, calc(100vw - 32px));
    padding: 28px;
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 240, 0.98)),
      rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.2), 0 10px 28px var(--gr-mega-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(18px);
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
    color: var(--gr-mega-purple-deep);
  }

  .mega-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) !important;
  }

  .mega-panel.is-open::before {
    content: "";
    position: absolute;
    top: -18px;
    left: 0;
    width: 100%;
    height: 18px;
  }

  .header-section > .mega-shell:has(.mega-panel.is-open) {
    pointer-events: auto;
  }

  .mega-panel__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--gr-mega-line);
  }

  .mega-panel__header .button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }

  .mega-panel__eyebrow {
    margin-bottom: 8px;
    color: var(--gr-mega-purple);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .mega-panel__header h2 {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
    line-height: 1.02;
    font-weight: 800;
    color: var(--gr-mega-purple);
  }

  .mega-panel__header p {
    max-width: 72ch;
    margin: 12px 0 0;
    color: var(--gr-mega-muted);
    line-height: 1.7;
    font-size: 0.98rem;
  }

  .mega-panel__cta.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--gr-mega-gold), var(--gr-mega-gold-dark));
    color: var(--gr-mega-purple-deep);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 16px 32px rgba(46, 12, 94, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .mega-panel__cta.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(46, 12, 94, 0.24);
    color: var(--gr-mega-purple-deep);
  }

  .mega-panel__close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(46, 12, 94, 0.2);
    background: rgba(255, 255, 255, 0.9);
    color: var(--gr-mega-purple);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
  }

  .mega-panel__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding-top: 24px;
    max-height: min(62vh, 720px);
    overflow: auto;
  }

  .mega-panel__grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mega-panel__grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mega-panel__grid--one {
    grid-template-columns: minmax(0, 1fr);
  }

  .mega-panel__column {
    display: grid;
    align-content: start;
    gap: 12px;
  }



  .mega-panel__column:hover {
    transform: translateY(-5px);
    border-color: rgba(72, 27, 130, 0.32);
    box-shadow: 0 26px 44px rgba(23, 6, 47, 0.24), -10px -10px 20px rgba(255, 255, 255, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.94);
  }


  .mega-panel__column:hover,
  .mega-panel__column:focus-within {
    transform: translateY(-10px) scale(1.01);
    border-color: rgba(72, 27, 130, 0.36);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.94), inset 0 -1px 0 rgba(46, 12, 94, 0.08);
  }

  .mega-panel__column h3 {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--gr-mega-purple), var(--gr-mega-purple-deep));
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(46, 12, 94, 0.14);
  }

  .mega-panel__links {
    display: grid;
    gap: 10px;
  }

  .mega-link a {
    display: block;
    padding: 13px 15px;
    border-radius: 16px;
    border: 1px solid rgba(46, 12, 94, 0.1);
    background: rgba(255, 255, 255, 0.84);
    color: var(--gr-mega-purple-deep);
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1), border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  }

  .mega-link a:hover,
  .mega-link a:focus-visible {
    transform: translateY(-2px);
    color: var(--gr-mega-purple) !important;
    border-color: rgba(46, 12, 94, 0.24);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.92), rgba(218, 165, 32, 0.86));
    box-shadow: 0 12px 26px rgba(46, 12, 94, 0.1);
  }

  a.nav-item.is-active {
    color: var(--gr-mega-gold);
  }

  .mega-panel[data-mega-panel="gallery"] {
    left: 50%;
    width: min(775px, calc(100vw - 32px));
    padding: 28px;
  }

  .mega-panel[data-mega-panel="gallery"] .mega-panel__grid--gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 991px) {
  .mega-shell {
    display: none;
  }
}

/* ================================================================== */
/* Greniers Mega Menu Glass / Soft UI Refresh - 2026-06-14             */
/* Scope: active desktop mega menu only.                               */
/* ================================================================== */
:root {
  --gr-mega-glass-panel: rgba(255, 255, 255, 0.96);
  --gr-mega-glass-panel-strong: rgba(248, 247, 252, 0.98);
  --gr-mega-glass-edge: rgba(255, 255, 255, 0.82);
  --gr-mega-raised-shadow: 0 42px 96px rgba(23, 6, 47, 0.4), 0 22px 52px rgba(46, 12, 94, 0.3), 0 4px 0 rgba(255, 255, 255, 0.88) inset, inset 0 -3px 0 rgba(46, 12, 94, 0.12);
  --gr-mega-soft-card: 0 18px 0 rgba(72, 27, 130, 0.08), 18px 22px 38px rgba(23, 6, 47, 0.24), -12px -12px 22px rgba(255, 255, 255, 0.9), inset 0 3px 0 rgba(255, 255, 255, 0.96), inset 0 -3px 0 rgba(46, 12, 94, 0.12);
  --gr-mega-pressed: inset 6px 7px 14px rgba(23, 6, 47, 0.22), inset -5px -5px 12px rgba(255, 255, 255, 0.82);
}

@media (min-width: 992px) {
  .mega-panel,
  .mega-panel * {
    box-sizing: border-box;
  }

  .mega-panel {
    isolation: isolate;
    width: min(1320px, calc(100vw - 36px));
    padding: 36px;
    border: 1px solid rgba(72, 27, 130, 0.34);
    background:
      linear-gradient(145deg, var(--gr-mega-glass-panel), var(--gr-mega-glass-panel-strong) 54%, rgba(255, 255, 255, 0.96));
    box-shadow: var(--gr-mega-raised-shadow);
    transform-origin: top center;
    backdrop-filter: blur(22px) saturate(148%);
    -webkit-backdrop-filter: blur(22px) saturate(148%);
  }

  .mega-panel::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(72, 27, 130, 0.06) 48%, rgba(46, 12, 94, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), inset 0 -1px 0 rgba(46, 12, 94, 0.1);
  }

  .mega-panel > * {
    position: relative;
    z-index: 1;
  }

  .mega-panel__header {
    align-items: flex-start;
    padding: 26px;
    border: 1px solid rgba(72, 27, 130, 0.24);
    border-bottom-color: rgba(46, 12, 94, 0.14);
    border-radius: 22px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 246, 252, 0.94)),
      rgba(255, 255, 255, 0.96);
    box-shadow: var(--gr-mega-soft-card), 0 26px 44px rgba(46, 12, 94, 0.14);
    transform: translateY(-4px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }


  .mega-panel__header:hover,
  .mega-panel__header:focus-within {
    transform: translateY(-7px);
    box-shadow: 0 20px 0 rgba(72, 27, 130, 0.08), 0 34px 54px rgba(23, 6, 47, 0.24), -12px -12px 22px rgba(255, 255, 255, 0.9), inset 0 3px 0 rgba(255, 255, 255, 0.96);
  }

  .mega-panel__header > div:first-child {
    min-width: 0;
  }

  .mega-panel__eyebrow {
    color: var(--gr-mega-purple);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .mega-panel__header h2 {
    color: var(--gr-mega-purple) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .mega-panel__header p {
    color: #2f2937;
  }

  .mega-panel__header .button-row {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  .mega-panel__cta.button,
  .mega-panel__close {
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  .mega-panel__cta.button {
    min-height: 48px;
    padding: 13px 24px;
    border: 1px solid rgba(46, 12, 94, 0.3);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%),
      linear-gradient(135deg, var(--gr-mega-gold), var(--gr-mega-gold-dark));
    color: var(--gr-mega-purple-deep) !important;
    box-shadow: 0 14px 0 rgba(72, 27, 130, 0.09), 0 24px 34px rgba(46, 12, 94, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.78), inset 0 -3px 0 rgba(46, 12, 94, 0.14);
  }

  .mega-panel__cta.button:hover,
  .mega-panel__cta.button:focus-visible {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 22px 0 rgba(72, 27, 130, 0.1), 0 32px 44px rgba(46, 12, 94, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.82);
  }

  .mega-panel__cta.button:active,
  .mega-panel__close:active,
  .mega-link a:active {
    transform: translateY(0);
    box-shadow: var(--gr-mega-pressed);
  }

  .mega-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(46, 12, 94, 0.18);
    border-radius: 50%;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 246, 252, 0.96));
    color: var(--gr-mega-purple) !important;
    font-size: 1.15rem;
    line-height: 1;
    box-shadow: 0 10px 0 rgba(72, 27, 130, 0.08), 0 18px 28px rgba(23, 6, 47, 0.22), -7px -7px 14px rgba(255, 255, 255, 0.84), inset 0 2px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 0 rgba(46, 12, 94, 0.1);
  }

  .mega-panel__close:hover,
  .mega-panel__close:focus-visible {
    color: var(--gr-mega-purple-deep) !important;
    border-color: rgba(72, 27, 130, 0.42);
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(247, 246, 252, 0.96));
  }

  .mega-panel__grid {
    gap: 26px;
    padding-top: 30px;
  }

  .mega-panel__column {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(72, 27, 130, 0.18);
    border-radius: 24px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 246, 252, 0.94)),
      rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.94), inset 0 -1px 0 rgba(46, 12, 94, 0.08);
    transform: translateY(-6px);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .mega-panel__column h3 {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 46%),
      linear-gradient(135deg, #481b82, var(--gr-mega-purple-deep));
    box-shadow: 0 12px 0 rgba(23, 6, 47, 0.12), 0 20px 28px rgba(46, 12, 94, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
    color: #ffffff !important;
  }

  .mega-panel__links {
    gap: 16px;
  }

  .mega-link {
    min-width: 0;
  }

  .mega-link a {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 54px;
    width: 100%;
    overflow: visible;
    padding: 14px 18px;
    border: 1px solid rgba(46, 12, 94, 0.42);
    border-radius: 14px;
    background-color: #ffffff;
    background-image: linear-gradient(180deg, #ffffff 0%, #f8f7fc 100%);
    color: var(--gr-mega-purple) !important;
    box-shadow: none;
    line-height: 1.35;
    outline: 1px solid rgba(72, 27, 130, 0.18);
    outline-offset: 0;
    transform: translateY(-4px) translateZ(0);
    overflow-wrap: break-word;
  }

  .mega-link a::before {
    content: none;
    display: none;
  }

  .mega-link a:hover,
  .mega-link a:focus-visible {
    z-index: 4;
    transform: translateY(-12px) scale(1.035);
    border-color: rgba(46, 12, 94, 0.74);
    background-color: #ffffff;
    background-image: linear-gradient(180deg, #ffffff 0%, #f4f2fb 100%);
    color: var(--gr-mega-purple) !important;
    outline-color: rgba(72, 27, 130, 0.38);
    box-shadow: none;
  }

  a.nav-item.is-active {
    color: var(--gr-mega-gold) !important;
    text-shadow: 0 1px 10px rgba(72, 27, 130, 0.22);
  }
}

@media (min-width: 992px) and (max-width: 1100px) {
  .mega-panel__grid,
  .mega-panel__grid--three {
    gap: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mega-panel[data-mega-panel="gallery"] .mega-panel__grid--gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mega menu item buttons above card layer - effect only */
.header-section .mega-panel__column,
.header-section .mega-panel__links,
.header-section .mega-link {
  overflow: visible !important;
}

.header-section .mega-link {
  position: relative !important;
  z-index: 50 !important;
}

.header-section .mega-link a {
  position: relative !important;
  z-index: 60 !important;
  -webkit-backdrop-filter: blur(28px) saturate(130%) !important;
  backdrop-filter: blur(28px) saturate(130%) !important;
  transform: translateY(-8px) !important;
  box-shadow:
    0 20px 40px -12px rgba(0, 0, 0, 0.34),
    0 10px 20px -8px rgba(0, 0, 0, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.7) !important;
}

.header-section .mega-link a:hover,
.header-section .mega-link a:focus-visible {
  z-index: 70 !important;
  transform: translateY(-14px) !important;
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.44),
    0 15px 30px -10px rgba(0, 0, 0, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.74) !important;
}

