/* Custom Dropdown Overrides for Attractive & Responsive Menu */

/* Desktop Dropdown Animation */
@media (min-width: 992px) {
    header #mainmenu li ul {
        display: block !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        pointer-events: none;
        top: 100%; /* Ensure it aligns correctly */
        background: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border: none !important;
        border-radius: 0 0 8px 8px;
        min-width: 220px;
        padding: 10px 0;
    }

    header #mainmenu li:hover > ul {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    header #mainmenu li ul li {
        border: none;
        padding: 0;
    }

    header #mainmenu li ul li a {
        color: #555;
        padding: 8px 20px;
        font-weight: 500;
        font-size: 14px;
        text-transform: none; /* Make it look more modern */
        transition: all 0.2s ease;
        display: block;
        text-align: left;
    }

    header #mainmenu li ul li a:hover {
        background: #f8f9fa;
        color: var(--primary-color, #249F6E);
        padding-left: 25px; /* Subtle slide effect */
    }
}

/* Mobile Dropdown Styling */
@media (max-width: 991px) {
    header #mainmenu li ul {
        background: transparent !important;
        box-shadow: none;
        padding-left: 0;
        display: none;
        margin-top: 0;
        border-top: none;
    }

    header #mainmenu li.has-child.open > ul {
        display: block;
    }
    
    /* Ensure text is readable on mobile and indented */
    header #mainmenu li ul li a {
        background: transparent !important; /* Remove any inherited solid background */
        color: #333 !important; /* Force legible dark color */
        padding: 8px 0 8px 30px; /* Indent child items */
        border-bottom: 1px solid rgba(0,0,0,0.03);
        font-size: 14px;
        font-weight: 400;
        text-align: left;
    }

    /* Hover/Active state for mobile dropdown items */
    header #mainmenu li ul li a:hover,
    header #mainmenu li ul li a.active {
        color: var(--primary-color) !important;
        background: transparent !important;
        padding-left: 35px; /* Slight movement on hover */
    }
}

/* General Tweaks */
header #mainmenu li.has-child > a::after {
    /* Ensure the arrow is consistent */
    font-size: 10px;
    margin-left: 5px;
}
