/* ======================================================================
   PRODUCTS MEGA MENU
   Dedicated, cache-busted styles for the complete 19 + 21 catalogue.
   ====================================================================== */

.mega-menu-products {
    --pm-accent: #7fa69b;
    --pm-accent-deep: #55786f;
    --pm-ink: #1f3430;
    --pm-muted: #6b7d78;
    --pm-line: rgba(83, 119, 110, 0.14);
    background:
        radial-gradient(circle at 12% 10%, rgba(127, 166, 155, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(248, 251, 250, 0.995), rgba(239, 246, 243, 0.99));
    border-top: 1px solid rgba(127, 166, 155, 0.24);
    border-image: none;
    border-radius: 0 0 26px 26px;
    box-shadow: 0 30px 80px rgba(31, 52, 48, 0.18), 0 8px 25px rgba(31, 52, 48, 0.08);
    overflow: hidden;
}

.mega-menu-products::before {
    background-image:
        linear-gradient(rgba(127, 166, 155, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 166, 155, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.9;
}

.mega-menu-products::after {
    top: auto;
    right: -120px;
    bottom: -180px;
    left: auto;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(127, 166, 155, 0.16), transparent 68%);
    animation: none;
}

.mega-menu-products .mega-menu-container {
    max-width: 1510px;
    padding: 18px 26px 24px;
}

.mega-menu-products .product-mega-shell {
    position: relative;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    min-height: 390px;
    border: 1px solid rgba(83, 119, 110, 0.15);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 18px 44px rgba(31, 52, 48, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
    isolation: isolate;
}

/* Left navigation rail */
.mega-menu-products .product-mega-sidebar {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px 22px 20px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.13), transparent 32%),
        linear-gradient(155deg, #264a43 0%, #365f57 52%, #1e3b36 100%);
    overflow: hidden;
}

.mega-menu-products .product-mega-sidebar::before {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -95px;
    width: 245px;
    height: 245px;
    border: 42px solid rgba(255, 255, 255, 0.035);
    border-radius: 50%;
    pointer-events: none;
}

.mega-menu-products .product-mega-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.26), transparent);
}

.mega-menu-products .product-mega-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
}

.mega-menu-products .product-mega-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    font-size: 1.05rem;
}

.mega-menu-products .product-mega-eyebrow {
    display: block;
    margin: 0 0 3px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.mega-menu-products .product-mega-brand h3 {
    margin: 0;
    color: #fff;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.mega-menu-products .product-mega-intro {
    position: relative;
    z-index: 1;
    margin: 0 0 17px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
    line-height: 1.55;
}

.mega-menu-products .product-mega-tabs {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mega-menu-products .product-mega-tab {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 62px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.mega-menu-products .product-mega-tab::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #d7ebe5;
    opacity: 0;
    transform: scaleY(0.45);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-tab:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.mega-menu-products .product-mega-tab.active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.105));
    box-shadow: 0 10px 24px rgba(10, 32, 27, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: none;
}

.mega-menu-products .product-mega-tab.active::before {
    opacity: 1;
    transform: scaleY(1);
}

.mega-menu-products .product-mega-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    transition: color 0.25s ease, background 0.25s ease;
}

.mega-menu-products .product-mega-tab.active .product-mega-tab-icon {
    color: #31584f;
    background: #fff;
}

.mega-menu-products .product-mega-tab-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.mega-menu-products .product-mega-tab-copy strong {
    display: block;
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.2;
}

.mega-menu-products .product-mega-tab-copy small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.6rem;
    font-weight: 400;
    line-height: 1.2;
}

.mega-menu-products .product-mega-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 27px;
    padding: 0 7px;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.68rem;
    font-weight: 700;
}

.mega-menu-products .product-mega-tab.active .product-mega-tab-count {
    color: #31584f;
    background: #fff;
}

.mega-menu-products .product-mega-summary {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.mega-menu-products .product-mega-summary div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mega-menu-products .product-mega-summary strong {
    color: #fff;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.1;
}

.mega-menu-products .product-mega-summary span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.58rem;
}

.mega-menu-products .product-mega-view-all {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-view-all:hover {
    color: #31584f;
    background: #fff;
    transform: translateY(-2px);
}

.mega-menu-products .product-mega-view-all i {
    font-size: 0.62rem;
    transition: transform 0.25s ease;
}

.mega-menu-products .product-mega-view-all:hover i {
    transform: translateX(4px);
}

/* Product catalogue area */
.mega-menu-products .product-mega-content {
    min-width: 0;
    padding: 21px 22px 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(127, 166, 155, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 250, 0.98));
}

.mega-menu-products .product-mega-panel[hidden] {
    display: none;
}

.mega-menu-products .product-mega-panel.active {
    display: block;
    animation: premiumProductPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes premiumProductPanelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-menu-products .product-mega-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 52px;
    margin-bottom: 15px;
    padding: 0 2px 13px;
    border-bottom: 1px solid var(--pm-line);
}

.mega-menu-products .product-mega-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mega-menu-products .product-mega-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba(127, 166, 155, 0.2);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #83aa9f, #55786f);
    box-shadow: 0 7px 16px rgba(85, 120, 111, 0.22);
    font-size: 0.85rem;
}

.mega-menu-products .product-mega-panel-icon.chemical {
    background: linear-gradient(145deg, #688f86, #3f675e);
}

.mega-menu-products .product-mega-panel-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--pm-accent-deep);
    font-size: 0.57rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.mega-menu-products .product-mega-panel-title h4 {
    margin: 0;
    color: var(--pm-ink);
    font-size: 1.02rem;
    font-weight: 720;
    line-height: 1.2;
}

.mega-menu-products .product-mega-panel-heading > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    color: var(--pm-accent-deep);
    background: rgba(127, 166, 155, 0.06);
    font-size: 0.65rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-panel-heading > a:hover {
    color: #fff;
    border-color: var(--pm-accent-deep);
    background: var(--pm-accent-deep);
    transform: translateY(-2px);
}

.mega-menu-products .product-mega-panel-heading > a i {
    font-size: 0.55rem;
}

.mega-menu-products .product-mega-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    min-height: 300px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega-menu-products .product-mega-grid li {
    min-width: 0;
    margin: 0;
}

.mega-menu-products .product-mega-grid li > a {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 15px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 57px;
    height: 100%;
    padding: 8px 9px;
    border: 1px solid rgba(83, 119, 110, 0.115);
    border-radius: 12px;
    color: var(--pm-ink);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 7px rgba(31, 52, 48, 0.025);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.mega-menu-products .product-mega-grid li > a::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--pm-accent), var(--pm-accent-deep));
    opacity: 0;
    transform: scaleY(0.45);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-grid li > a:hover {
    border-color: rgba(83, 119, 110, 0.32);
    background: #fff;
    box-shadow: 0 9px 22px rgba(31, 52, 48, 0.1);
    transform: translateY(-3px);
}

.mega-menu-products .product-mega-grid li > a:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.mega-menu-products .product-mega-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(127, 166, 155, 0.15);
    border-radius: 10px;
    color: var(--pm-accent-deep);
    background: linear-gradient(145deg, rgba(127, 166, 155, 0.14), rgba(127, 166, 155, 0.06));
    font-size: 0.69rem;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-item-icon.chemical {
    color: #466f66;
}

.mega-menu-products .product-mega-grid li > a:hover .product-mega-item-icon {
    color: #fff;
    background: linear-gradient(145deg, var(--pm-accent), var(--pm-accent-deep));
    transform: scale(1.04);
}

.mega-menu-products .product-mega-item-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.mega-menu-products .product-mega-item-copy strong {
    display: -webkit-box;
    min-width: 0;
    padding: 0;
    color: var(--pm-ink);
    background: transparent;
    font-size: 0.65rem;
    font-weight: 650;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.mega-menu-products .product-mega-item-copy small {
    color: #8a9a96;
    font-size: 0.52rem;
    font-weight: 450;
    line-height: 1.15;
}

.mega-menu-products .product-mega-item-arrow {
    display: block;
    width: auto;
    height: auto;
    color: #a6b3af;
    background: transparent;
    font-size: 0.51rem;
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.mega-menu-products .product-mega-grid li > a:hover .product-mega-item-arrow {
    color: var(--pm-accent-deep);
    background: transparent;
    opacity: 1;
    transform: translate(0, 0);
}

/* Responsive desktop/tablet states. The global navigation switches to its
   mobile menu below 768px, where mega menus are intentionally hidden. */
@media (max-width: 1360px) {
    .mega-menu-products .mega-menu-container {
        padding-right: 18px;
        padding-left: 18px;
    }

    .mega-menu-products .product-mega-shell {
        grid-template-columns: 285px minmax(0, 1fr);
    }

    .mega-menu-products .product-mega-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 350px;
    }
}

@media (max-width: 1100px) {
    .mega-menu-products .product-mega-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .mega-menu-products .product-mega-sidebar {
        padding: 20px 17px 18px;
    }

    .mega-menu-products .product-mega-content {
        padding: 18px;
    }

    .mega-menu-products .product-mega-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 430px;
    }
}

@media (max-width: 992px) {
    .mega-menu-products .mega-menu-container {
        padding: 12px;
    }

    .mega-menu-products .product-mega-shell {
        grid-template-columns: 235px minmax(0, 1fr);
    }

    .mega-menu-products .product-mega-intro,
    .mega-menu-products .product-mega-summary {
        display: none;
    }

    .mega-menu-products .product-mega-view-all {
        margin-top: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mega-menu-products *,
    .mega-menu-products *::before,
    .mega-menu-products *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
