/*
 Theme Name:     Divi Child
 Theme URI:      https://www.elegantthemes.com/gallery/divi/
 Description:    Divi Child Theme
 Author:         Elegant Themes
 Author URI:     https://www.elegantthemes.com
 Template:       Divi
 Version:        1.0.0
*/


/* 
Pairs with js/main.js. Divi 5's Menu module builds the mobile menu in JS,
so these rules are written against the classes the script adds, not against
a markup structure that exists in the HTML. */

.et_mobile_menu li.ppsd-has-toggle,
.et_mobile_nav_menu li.ppsd-has-toggle,
#mobile_menu1 li.ppsd-has-toggle {
    position: relative;
}

.et_mobile_menu li.ppsd-has-toggle > a,
.et_mobile_nav_menu li.ppsd-has-toggle > a,
#mobile_menu1 li.ppsd-has-toggle > a {
    padding-right: 56px;
}

/* the toggle — a real button, separate from the link */
.ppsd-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 46px;
    padding: 0;
    margin: 0;
    border: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
}

.ppsd-submenu-toggle:focus-visible {
    outline: 2px solid #1b2b5c;
    outline-offset: -2px;
}

.ppsd-submenu-toggle > span {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.25s ease;
    opacity: 0.75;
}

.ppsd-has-toggle.ppsd-open > .ppsd-submenu-toggle > span {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* collapsed by default; the script sets max-height to animate it open */
li.ppsd-has-toggle > .sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* indent children so the hierarchy reads */
li.ppsd-has-toggle > .sub-menu a {
    padding-left: 24px;
}


/* DIVI 5 - VERTICAL AUTO-WIDTH DROPDOWN */
@media (min-width: 981px) {

  /* Dropdown container */
  .et_pb_menu .et-menu-nav ul.sub-menu {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  /* Dropdown items */
  .et_pb_menu .et-menu-nav ul.sub-menu > li {
    display: block !important;
    position: relative !important;
    float: none !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Dropdown links */
  .et_pb_menu .et-menu-nav ul.sub-menu > li > a {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    padding-right: 50px !important;
  }

  /* Align nested dropdown caret to the right */
  .et_pb_menu .et-menu-nav ul.sub-menu
  > li.menu-item-has-children > a::after {
    position: absolute !important;
    right: 16px !important;
    left: auto !important;
    top: 50% !important;
    margin-top: 0 !important;
    transform: translateY(-50%) !important;
  }

  /* Position nested submenu beside parent */
  .et_pb_menu .et-menu-nav ul.sub-menu
  > li > ul.sub-menu {
    position: absolute !important;
    top: 0 !important;
    left: auto !important;
    right: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }

}