@import "../shared/styles/tl-variables.scss";

:host {
  font-family: var(--tl-font-family-sans-serif);
  --tl-mobile-display-max-height: 1500px;

  .mega-menu-sections {
    margin: 0px 20px;
  }

  .mega-menu-view-all {
    display: flex;
    justify-content: flex-end;
  }

  wvr-dropdown-component {
    ::ng-deep {
      @import "~@wvr/elements/styles/variables";
      @import "~bootstrap/scss/bootstrap";
      @import "~@wvr/elements/styles/mixins";
      @import "~@wvr/elements/styles/overrides";
      .wvr-dropdown .dropdown {
        .btn.btn-link.dropdown-toggle,
        .btn.btn-link:not(:disabled):not(.disabled).active,
        .btn.btn-link:not(:disabled):not(.disabled):active {
          text-decoration: none !important;
          color: var(--tl-black) !important;
        }

        .btn {
          width: 100%;

          tl-icon-component.x-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(0deg);
          }

          tl-icon-component.plus-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(0deg);
          }
        }
      }
    }
  }

  wvr-dropdown-component:focus-within,
  wvr-dropdown-component:hover {
    ::ng-deep {
      .wvr-dropdown .dropdown {
        .btn {
          tl-icon-component.x-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(90deg);
          }
        }
      }
    }
  }

  wvr-dropdown-component.active {
    ::ng-deep {
      .wvr-dropdown .dropdown {
        .btn {
          tl-icon-component.plus-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(45deg);
          }
        }
      }
    }
  }

  .mobile-display {
    max-height: 0px;
    overflow: hidden;
    transition: max-height 1s ease-in-out;
    background: var(--tl-grey);

    ::ng-deep {
      tl-mega-menu-section-component,
      tl-mega-menu-section {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0px;

        a {
          margin: 0px 15px 0px 0px;
          padding: 20px 0px 0px 60px;
          text-align: start;
          color: var(--tl-black);
          font-size: 17px;
          font-family: var(--tl-font-family-sans-serif);
          font-weight: 300;

          wvre-text {
            font-weight: 400;
            padding: 0px;
            margin: 0px;
            border-bottom: 0.5px solid #e4e4e4;
            display: flex;
            height: 40px;
            width: 97%;
          }
        }

        a:focus-within,
        a:hover {
          border-bottom: none;
          wvre-text {
            border-bottom: none;
          }
        }

        .section-title {
          cursor: pointer;
          margin: 0px 15px 0px 30px;
          padding: 20px 0px;
          text-align: start;
          color: var(--tl-black);
          font-size: 17px;
          font-family: var(--tl-font-family-sans-serif);
          font-weight: 300;
          border-bottom: 0.5px solid #e4e4e4;
          text-decoration: none;
        }

        a.mega-menu-view-all {
          cursor: pointer;
          margin: 0px 15px 0px 30px;
          padding: 20px 0px;
          text-align: start;
          color: var(--tl-black);
          font-size: 17px;
          font-family: var(--tl-font-family-sans-serif);
          font-weight: 300;
          border-bottom: 0.5px solid #e4e4e4;
        }
      }
    }
  }

  .mobile-display.active {
    max-height: var(--tl-mobile-display-max-height);
    transition: max-height 0.5s ease-in-out;
  }

  ::ng-deep {
    tl-button-component {
      --tl-btn-border-radius: 0px;
    }

    .wvr-dropdown .dropdown {
      wvr-button-component {
        width: 100%;

        tl-icon-component.plus-icon {
          display: none;
          float: right;
        }

        tl-icon-component.x-icon {
          display: inline-block;
        }
      }

      [ngbDropdownMenu] {
        padding: 20px 0px;
        border: 1px solid var(--tl-grey);
        border-radius: 3px;
        border-bottom: 12px solid var(--tl-deep-yellow);
        box-shadow: 0px 2px 3px 1px var(--tl-grey);
      }
    }
  }

  @media (max-width: 992px) {
    wvr-dropdown-component {
      ::ng-deep {
        .wvr-dropdown .dropdown {
          .btn {
            text-align: start !important;
          }
        }
      }
    }

    ::ng-deep {
      div[template="dropdown-menu"] {
        display: none;
      }

      .wvr-dropdown .dropdown {
        wvr-button-component {
          tl-icon-component.plus-icon {
            display: inline-block;
          }

          tl-icon-component.x-icon {
            display: none;
          }
        }
      }
    }
  }
}
