/* 
Theme Name:		 primaclinic
Theme URI:		 http://childtheme-generator.com/
Description:	 primaclinic is a child theme of Hello Elementor, created by ChildTheme-Generator.com
Author:			 WEBSENIOR SRL
Author URI:		 http://childtheme-generator.com/
Template:		 hello-elementor
Version:		 1.0.0
Text Domain:	 primaclinic
*/


/*
    Add your custom styles here
*/

/* Mega Menu */
.has-mega-menu > a::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent !important;
    transition: transform 0.25s ease;
    opacity: 1 !important;
    right: -10px;

}
.has-mega-menu:hover > a::after {
    transform: rotate(180deg);
}
.has-mega-menu > .custom-mega-menu {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.has-mega-menu:hover > .custom-mega-menu,
.has-mega-menu:focus-within > .custom-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
/* Override Elementor nav-menu hiding ul inside mega menu */
.custom-mega-menu ul {
    display: block !important;
    position: static !important;
    width: auto !important;
    border: none !important;
    box-shadow: none !important;
    top: auto !important;
}

.has-mega-menu > .custom-mega-menu::before {
    content: "";
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    height: 30px;
}

/* Mega Menu — Mobile toggle button */
.mega-menu-toggle {
    display: none;
}

@media (max-width: 1024px) {
    /* Hide native chevron ::after on mobile for mega menu items */
    .has-mega-menu > a::after {
        display: none !important;
    }

    /* Layout: place link + toggle side by side */
    .has-mega-menu {
        position: relative;
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
    }
    .has-mega-menu > a {
        flex: 1;
        min-width: 0;
    }

    /* Show toggle button */
    .mega-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 35px;
        height: 35px;
        background: #DC0900;
        color: #fff;
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }
    .mega-menu-toggle svg {
        transition: transform 0.3s ease;
    }
    .mega-menu-toggle:active {
        background: #b00700;
    }
    .mega-open > .mega-menu-toggle svg {
        transform: rotate(180deg);
    }

    /* Override desktop hover behaviour on mobile */
    .has-mega-menu > .custom-mega-menu {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        flex-basis: 100%;
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, max-height 0.4s ease, visibility 0.3s ease;
        pointer-events: none;
    }
    .has-mega-menu:hover > .custom-mega-menu {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        max-height: 0;
    }

    /* Open state via JS toggle */
    .has-mega-menu.mega-open > .custom-mega-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        max-height: 2000px;
        overflow: visible;
    }
}
