/*
 * Doudoudis CARRAROSPRAY mega menu.
 * Uses the approved shared mega-menu design system while keeping every
 * CARRAROSPRAY-specific rule isolated from Parts and Tractors.
 */

.doudoudis-carrarospray-mega-trigger > .wd-dropdown-menu,
.doudoudis-carrarospray-mega-trigger > .sub-menu-dropdown {
    padding: 0 !important;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-top: 3px solid var(--dou-amber-500);
    border-radius: 0 0 22px 22px;
    background: var(--dou-white);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.doudoudis-carrarospray-mega,
.doudoudis-carrarospray-mega *,
.doudoudis-carrarospray-mega *::before,
.doudoudis-carrarospray-mega *::after {
    box-sizing: border-box !important;
}

.doudoudis-carrarospray-mega {
    max-height: none !important;
    overflow: visible !important;
}

.doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    align-items: start !important;
}

.doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > *,
.doudoudis-carrarospray-mega .doudoudis-mega-menu-column,
.doudoudis-carrarospray-mega .doudoudis-mega-menu-cta {
    min-width: 0 !important;
    max-width: 100% !important;
}

.doudoudis-carrarospray-mega .doudoudis-mega-menu-links {
    grid-template-columns: minmax(0, 1fr) !important;
}

.doudoudis-carrarospray-mega .doudoudis-mega-menu-cta .doudoudis-site-button,
.doudoudis-carrarospray-mega .doudoudis-mega-menu-cta .doudoudis-site-button > span,
.doudoudis-carrarospray-mega .doudoudis-mega-menu-cta .doudoudis-site-button .wd-btn-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 10px 16px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
}

@media (min-width: 1025px) {
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:hover > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:focus-within > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-opened > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-active > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-event-hover > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.menu-item-open > a,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link > a[aria-expanded="true"] {
        background: #0b1530 !important;
        color: #ffffff !important;
    }

    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:hover > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:focus-within > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-opened > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-active > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-event-hover > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.menu-item-open > a .nav-link-text,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:hover > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:focus-within > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-opened > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-active > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-event-hover > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.menu-item-open > a > span,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:hover > a::after,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:focus-within > a::after,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-opened > a::after,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-active > a::after,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-event-hover > a::after,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.menu-item-open > a::after {
        color: #ffffff !important;
        opacity: 1 !important;
    }

    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:hover > a::before,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link:focus-within > a::before,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-opened > a::before,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-active > a::before,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.wd-event-hover > a::before,
    .whb-header-bottom .wd-nav-main > li.doudoudis-carrarospray-link.menu-item-open > a::before {
        color: var(--dou-amber-500) !important;
        opacity: 1 !important;
    }
}

/* Four true columns on normal desktop and laptop widths, including 1366px. */
@media (min-width: 1281px) {
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
        display: grid !important;
        grid-template-columns:
            minmax(0, 1.08fr)
            minmax(0, 1fr)
            minmax(0, 0.92fr)
            minmax(0, 1.02fr) !important;
        grid-template-rows: min-content !important;
        grid-auto-rows: min-content !important;
        gap: 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > section:nth-of-type(1) {
        grid-column: 1 / 2 !important;
        grid-row: 1 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > section:nth-of-type(2) {
        grid-column: 2 / 3 !important;
        grid-row: 1 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > section:nth-of-type(3) {
        grid-column: 3 / 4 !important;
        grid-row: 1 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > aside.doudoudis-mega-menu-cta {
        grid-column: 4 / 5 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-self: start !important;
        width: auto !important;
        height: clamp(360px, calc(100dvh - 430px), 460px) !important;
        min-height: clamp(360px, calc(100dvh - 430px), 460px) !important;
        max-height: clamp(360px, calc(100dvh - 430px), 460px) !important;
        margin-left: clamp(10px, 1.3vw, 22px) !important;
        padding: clamp(20px, 1.8vw, 28px) !important;
    }
}

/* 1200–1280px: three information columns and a full-width horizontal CTA. */
@media (min-width: 1200px) and (max-width: 1280px) {
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
        grid-template-columns:
            minmax(0, 1.08fr)
            minmax(0, 1fr)
            minmax(0, 0.92fr) !important;
        gap: 16px 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > aside.doudoudis-mega-menu-cta {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(240px, 320px) !important;
        align-items: center !important;
        gap: 28px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 176px !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 24px 28px !important;
    }
}

/* 1025–1199px: clean two-column information layout and full-width CTA. */
@media (min-width: 1025px) and (max-width: 1199px) {
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column,
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column:first-child {
        padding: 3px 16px 10px !important;
        border-left: 1px solid var(--dou-slate-200) !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column:nth-child(odd) {
        padding-left: 2px !important;
        border-left: 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > aside.doudoudis-mega-menu-cta {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(230px, 300px) !important;
        align-items: center !important;
        gap: 24px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 170px !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 22px 26px !important;
    }
}

/* Short laptop height: compact the menu while keeping the footer visible. */
@media (min-width: 1281px) and (max-height: 900px) {
    .doudoudis-carrarospray-mega {
        padding-top: 12px !important;
        padding-bottom: 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-title {
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links {
        gap: 0 8px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li,
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li > a {
        height: 34px !important;
        min-height: 34px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li > a {
        padding: 0 9px 0 18px !important;
        font-size: 12.5px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-all-brands {
        margin-top: 6px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > aside.doudoudis-mega-menu-cta {
        height: clamp(330px, calc(100dvh - 410px), 380px) !important;
        min-height: clamp(330px, calc(100dvh - 410px), 380px) !important;
        max-height: clamp(330px, calc(100dvh - 410px), 380px) !important;
        padding: 20px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-cta .doudoudis-site-eyebrow {
        margin-bottom: 8px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-cta h3 {
        margin-bottom: 8px !important;
        font-size: 22px !important;
        line-height: 1.08 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-cta p {
        margin-bottom: 10px !important;
        font-size: 12.5px !important;
        line-height: 1.42 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-footer {
        margin-top: 6px !important;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
    }
}

@media (min-width: 1281px) and (max-height: 720px) {
    .doudoudis-carrarospray-mega {
        padding-top: 8px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-title {
        margin-bottom: 5px !important;
        padding-bottom: 5px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li,
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li > a {
        height: 30px !important;
        min-height: 30px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-links li > a {
        font-size: 12px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid > aside.doudoudis-mega-menu-cta {
        height: clamp(280px, calc(100dvh - 400px), 320px) !important;
        min-height: clamp(280px, calc(100dvh - 400px), 320px) !important;
        max-height: clamp(280px, calc(100dvh - 400px), 320px) !important;
        padding: 16px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-footer {
        margin-top: 4px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
}

@media (max-width: 1024px) {
    .doudoudis-carrarospray-mega-trigger > .wd-dropdown-menu,
    .doudoudis-carrarospray-mega-trigger > .sub-menu-dropdown {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .doudoudis-carrarospray-mega {
        width: 100% !important;
        padding: 14px 0 !important;
        background: transparent !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 22px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column,
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-column:first-child {
        padding: 0 !important;
        border: 0 !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-cta {
        width: 100% !important;
        height: auto !important;
        min-height: 280px !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 24px !important;
        border-radius: 18px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-footer {
        align-items: flex-start !important;
        flex-direction: column !important;
        margin-top: 22px !important;
        padding-inline: 0 !important;
    }
}

@media (max-width: 767px) {
    .doudoudis-carrarospray-mega .doudoudis-mega-menu-grid {
        gap: 18px !important;
    }

    .doudoudis-carrarospray-mega .doudoudis-mega-menu-cta {
        min-height: 240px !important;
        padding: 20px !important;
    }
}
