/* ==========================================================================
   THEME: SUBMENU STYLE
   ========================================================================== */

/* --- 1. First and Last Link Border Radius --- */

/* Excludes the mini-cart dropdown to prevent styling conflicts. 
   Rounds the top corners of the first submenu link. */
.header-navigation:not(.kadence-header-cart) .sub-menu > li:first-child > a {
    border-radius: 20px 20px 0 0;
}

/* Rounds the bottom corners of the last submenu link. */
.header-navigation:not(.kadence-header-cart) .sub-menu > li:last-child > a {
    border-radius: 0 0 20px 20px;
}


/* --- 2. Submenu Container --- */

/* Main dropdown wrapper styling */
.header-navigation:not(.kadence-header-cart) .header-menu-container ul ul.sub-menu {
    border-radius: 20px;
    padding: 0; 
    
    /* Applies an inner shadow effect via gradient over a dark background base */
    background: linear-gradient(to right, rgba(0,0,0,0.6) 0%, transparent 8%, transparent 90%, rgba(0,0,0,0.6) 100%), rgba(10, 0, 0, 0.95);
}


/* --- 3. Hover & Active States --- */

/* Darkens the edges of the hovered or currently active submenu items */
.header-navigation:not(.kadence-header-cart) .sub-menu li:hover > a,
.header-navigation:not(.kadence-header-cart) .sub-menu li.current-menu-item > a {
    background-image: linear-gradient(to right, rgba(0,0,0,0.4) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.4) 100%) !important;
}


/* --- 4. Dynamic Menu Item Fix (Logg Inn / Logout) --- */

/* Ensures the top corners remain rounded for the dynamic guest button 
   when it appears as the first element but isn't technically the :first-child natively */
.header-navigation:not(.kadence-header-cart) .sub-menu > li.hide-if-connect:not(:last-child) > a {
    border-radius: 20px 20px 0 0 !important;
}