/* WordPress Megamenu 1:1 Port - Exact Replication */

/* WordPress Base Styles */
.mega-menu.sub-menu {
    border: none !important;
    padding: 0 !important;
}

/* WordPress Animation Keyframes - Exact Copy */
@-webkit-keyframes slide-in-bottom {
    0% {
        -webkit-transform: translateY(1000px);
        transform: translateY(1000px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    0% {
        -webkit-transform: translateY(1000px);
        transform: translateY(1000px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes swing-out-left-fwd {
    0% {
        -webkit-transform: rotateY(0);
        transform: rotateY(0);
        -webkit-transform-origin: left;
        transform-origin: left;
        opacity: 1;
    }
    100% {
        -webkit-transform: rotateY(-70deg);
        transform: rotateY(-70deg);
        -webkit-transform-origin: left;
        transform-origin: left;
        opacity: 0;
    }
}

@-webkit-keyframes swing-out-left-fwd {
    0% {
        -webkit-transform: rotateY(0);
        transform: rotateY(0);
        -webkit-transform-origin: left;
        transform-origin: left;
        opacity: 1;
    }
    100% {
        -webkit-transform: rotateY(-70deg);
        transform: rotateY(-70deg);
        -webkit-transform-origin: left;
        transform-origin: left;
        opacity: 0;
    }
}

/* WordPress Animation Classes - Exact Copy */
.slide-in-bottom {
    -webkit-animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.2s both;
    animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.2s both;
}

.swing-out-left-fwd {
    -webkit-animation: swing-out-left-fwd 0.55s cubic-bezier(0.600, -0.280, 0.735, 0.045) alternate forwards;
    animation: swing-out-left-fwd 0.55s cubic-bezier(0.600, -0.280, 0.735, 0.045) alternate forwards;
}

/* WordPress Hover Animations - Exact Timing */
li:hover .feasibility-1 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.7s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 2.25s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.7s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 2.25s 1 alternate forwards;
}

li:hover .feasibility-2 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.65s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 3.5s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.65s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 3.5s 1 alternate forwards;
}

li:hover .feasibility-3 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.6s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 4.75s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.6s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 4.75s 1 alternate forwards;
}

li:hover .feasibility-4 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.55s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 6s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.55s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 6s 1 alternate forwards;
}

li:hover .feasibility-5 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 7.25s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 7.25s 1 alternate forwards;
}

li:hover .feasibility-6 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.45s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 8.5s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.45s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 8.5s 1 alternate forwards;
}

li:hover .feasibility-7 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.4s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 9.75s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.4s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 9.75s 1 alternate forwards;
}

li:hover .feasibility-8 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.35s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 11s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.35s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 11s 1 alternate forwards;
}

li:hover .feasibility-9 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.3s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 12.25s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.3s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 12.25s 1 alternate forwards;
}

li:hover .feasibility-10 {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.25s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 13.5s 1 alternate forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.25s 1 normal forwards, swing-out-left-fwd .5s cubic-bezier(0.600, -0.280, 0.735, 0.045) 13.5s 1 alternate forwards;
}

/* Separate timing for Demand vs Feasibility cover page reveals */
/* Demand megamenu: cover appears 1s after feasibility-7 finishes (10.25s + 1s = 11.25s) */
li:hover .demand-last {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 11.25s 1 normal forwards;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 11.25s 1 normal forwards;
}

/* Feasibility megamenu: cover appears 1s after feasibility-10 finishes (14s + 1s = 15s) */
li:hover .feasibility-last {
    -webkit-animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 15s 1 normal forwards !important;
    animation: slide-in-bottom .5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 15s 1 normal forwards !important;
}

/* WordPress Image Positioning - Centered in Animation Column */
.feasibility-image {
    position: absolute;
    width: 280px;
    height: auto !important;
    opacity: 0;
    transform-style: preserve-3d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.megamenu-animation-container {
    position: relative;
    overflow: hidden;
    perspective: 1500px;
}

/* WordPress Stacked Image Positioning */
.feasibility-1 {
    top: 40px;
    left: 20px;
    z-index: 100;
}

.feasibility-2 {
    top: 44px;
    left: 24px;
    z-index: 99;
}

.feasibility-3 {
    top: 48px;
    left: 28px;
    z-index: 98;
}

.feasibility-4 {
    top: 52px;
    left: 32px;
    z-index: 97;
}

.feasibility-5 {
    top: 56px;
    left: 36px;
    z-index: 96;
}

.feasibility-6 {
    top: 60px;
    left: 40px;
    z-index: 95;
}

.feasibility-7 {
    top: 64px;
    left: 44px;
    z-index: 94;
}

.feasibility-8 {
    top: 68px;
    left: 48px;
    z-index: 93;
}

.feasibility-9 {
    top: 72px;
    left: 52px;
    z-index: 92;
}

.feasibility-10 {
    top: 76px;
    left: 56px;
    z-index: 91;
}

.feasibility-last {
    top: 40px;
    left: 20px;
    z-index: 100;
}

/* WordPress Button Styling - Exact Copy */
.megamenu-btn-primary {
    border: 1px solid #046865;
    background-color: rgba(4,104,101,.1);
    padding: 12px 24px;
    color: #046865 !important;
    text-align: center;
    margin-right: 15px;
    margin-bottom: 10px;
    font-size: 13px !important;
    line-height: 26px !important;
    font-family: Montserrat, Open Sans, sans-serif !important;
    display: inline-block;
    min-width: 160px;
    font-weight: 600 !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.megamenu-btn-primary:hover {
    background-color: rgba(4,104,101,.2);
}

.megamenu-btn-primary i {
    font-size: 14px !important;
    top: 0px !important;
    margin-left: 0px !important;
    position: relative !important;
    font-weight: 600 !important;
}

/* WordPress Typography - Exact Copy */
.megamenu-greatfor {
    font-family: Montserrat, Open Sans, sans-serif !important;
    font-weight: 700;
    color: #046865;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 100%;
    margin: 15px 0 3px;
}

.megamenu-greatfor-list {
    display: flex;
    justify-content: space-between;
    font-family: Montserrat, Open Sans, sans-serif !important;
    gap: 30px;
    width: 80%;
}

.megamenu-greatfor-list li {
    font-style: italic;
    flex: 1; /* Each item takes equal space */
    text-align: left;
}

.megamenu-button-div {
    margin: 35px 0 15px;
}

.mega-menu p {
    font-size: 13px !important;
    line-height: 24px !important;
}

/* WordPress Header Styling */
.mega-menu-header {
    font-family: Montserrat, Open Sans, sans-serif !important;
    font-weight: 700;
    font-size: 18px;
    color: #046865;
    line-height: 1.4;
    margin-bottom: 15px;
    display: block;
    letter-spacing: -0.02em;
}

/* WordPress Megamenu Layout - Left Animation, Right Content */
.megamenu-row {
    display: flex;
    flex-wrap: nowrap;
    margin: 0;
    height: 100%;
}

.megamenu-animation-col {
    position: relative;
    width: 33.333333%;
    background: rgba(4,104,101,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide content extending beyond megamenu boundaries */
}

.megamenu-content-col {
    position: relative;
    width: 66.666667%;
    padding: 40px 50px;
}

/* WordPress Animation Container */
.megamenu-animation-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 320px;
}

/* WordPress Megamenu Container - Aligned with Header Container */
.mega-menu {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 0;
    width: 1280px; /* max-w-7xl = 80rem = 1280px */
    height: 395px;
    overflow: hidden;
    max-width: calc(100vw - 32px); /* Account for padding */
    position: fixed !important;
    top: 72px; /* Height of navigation bar  */
    left: calc(50vw - 640px) !important; /* Align with centered max-w-7xl container */
    right: auto !important;
    transform: none;
    margin-top: 0;
    z-index: 1000;
    /* Default hidden state */
    opacity: 0;
    visibility: hidden;
    /* transform: translateY(10px); */
    transition: all 0.3s ease;
}

/* CSS Hover State Trigger */
.menu-item-has-children:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu.sub-menu {
    position: fixed !important;
    top: 72px;
}

/* Ensure proper z-indexing */
.megamenu-dropdown {
    z-index: 1000;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .mega-menu {
        width: 95vw;
        max-width: none;
        left: 2.5vw !important;
        transform: translateX(0) translateY(10px);
    }

    .megamenu-row {
        flex-direction: column;
    }

    .megamenu-animation-col,
    .megamenu-content-col {
        width: 100%;
    }

    .megamenu-animation-col {
        height: 200px;
        padding: 20px;
    }

    .megamenu-animation-container {
        height: 160px;
        max-width: 240px;
    }

    .feasibility-image {
        width: 200px;
    }

    .megamenu-content-col {
        padding: 30px 25px;
    }

    .megamenu-btn-primary {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* WordPress Color Variables */
:root {
    --wp-primary: #046865;
    --wp-secondary: #008a6e;
    --wp-dark: #182d35;
    --wp-light: #ffffff;
}

/* Additional WordPress Styles */
.mega-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.megamenu-row {
    height: 395px;
}

#menu-main-menu > li {
    height: 72px;
    display: flex;
    align-items: center;
}

/* Listing Preview Card Styles */
.listing-preview-card {
    position: absolute;
    bottom: 0; /* Flush against bottom of green div */
    max-width: 340px;
    width: 340px;
    opacity: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 12px 12px 0 0; /* Only round top corners for popping up effect */
}

.listing-preview-card h4 {
    line-height: 1.5;
}

.listing-preview-fallback {
    position: absolute;
    bottom: 0; /* Flush against bottom of green div */
    max-width: 340px;
    width: 340px;
    opacity: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 12px 12px 0 0; /* Only round top corners for popping up effect */
}

/* Hover effects for listing cards - lift up effect */
.listing-preview-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.listing-preview-fallback:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Pop-up animation for marketplace listing - similar to other megamenus */
.menu-item-has-children:hover .listing-preview-card,
.menu-item-has-children:hover .listing-preview-fallback {
    animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.3s both;
}

/* Text truncation utility for card titles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ensure Material Icons display properly in megamenu */
.megamenu-animation-col .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    color: inherit;
}

/* Responsive adjustments for listing preview */
@media (max-width: 767px) {
    .listing-preview-card,
    .listing-preview-fallback {
        max-width: 240px;
        margin: 0 auto;
    }

    .listing-preview-card .h-32 {
        height: 120px;
    }
}
