/* =====================================================
   Proximity Mega Menu
   Scoped under .proximity-megamenu to avoid conflicts
   with Divi/parent theme styles.
   ===================================================== */

.proximity-megamenu,
.proximity-megamenu * {
    box-sizing: border-box;
}

/* Host: the <li> containing "Products" link */
.proximity-megamenu-host {
    /* Keep Divi positioning, just ensure stacking context if needed */
}

/* Container appended as sibling of the menu inside the header section */
.proximity-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e3e8ef;
    border-bottom: 1px solid #e3e8ef;
    box-shadow:
        0 20px 60px rgba(0, 30, 70, 0.12),
        0 4px 12px rgba(0, 30, 70, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
        opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    pointer-events: none;
    color: #1a2332;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Invisible hover bridge between Products link and the panel,
   so the menu doesn't close when the cursor moves down */
.proximity-megamenu::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

.proximity-megamenu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.proximity-megamenu__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 32px 44px;
}

.proximity-megamenu__header {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    margin-bottom: 20px;
}

.proximity-megamenu__viewall {
    color: #003e7e !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.22s ease;
    border: none !important;
}
.proximity-megamenu__viewall:hover {
    gap: 10px;
    color: #002a55 !important;
}
.proximity-megamenu__viewall svg {
    flex-shrink: 0;
}

.proximity-megamenu__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

.proximity-megamenu__tile {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
    padding: 24px 16px 20px;
    border-radius: 16px;
    transition: background 0.22s ease;
    border: none !important;
}
.proximity-megamenu__tile:hover {
    background: #f2f7ff;
    color: #1a2332 !important;
}

.proximity-megamenu__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    overflow: visible;
    background: transparent !important;
}
.proximity-megamenu__img img {
    max-width: 85%;
    max-height: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.22s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 30, 70, 0.08));
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.proximity-megamenu__tile:hover .proximity-megamenu__img img {
    transform: scale(1.06);
}

.proximity-megamenu__title {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #1a2332;
    transition: color 0.22s ease;
}
.proximity-megamenu__tile:hover .proximity-megamenu__title {
    color: #002a55;
}

.proximity-megamenu__badge {
    display: inline-block;
    background: #0d8a4a;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}

/* Hide on mobile, let responsive menu plugin handle navigation there */
@media (max-width: 980px) {
    .proximity-megamenu {
        display: none !important;
    }
}
