/**
Header
 */

header {
  --color-white: #FFFFFF;
  --color-light-grey: #D9D9D9;
  --color-black: #222222;
}

.sticky-container {
  position: sticky;
  top: 0;
  z-index: 100;
}

.desktop {
  @media only screen and (max-width: 1023px) {
    display: none;
  }
}
.main-content-wrapper .mega-menu__stallions .desktop {
  display: none;
}

body.toolbar-horizontal:not(.is-path-frontpage) .header.sticky-container {
  top: 78px;
}

.header {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-light-grey);

  a {
    color: #000;
    display: block;
    font-size: 15px;
    font-weight: normal;
    line-height: 17px;

    @media only screen and (max-width: 1023px) {
      font-size: 18px;
      line-height: 22px;
    }

  }

  ul {
    margin: 0;

    li {
      display: block;
      padding: 0;
      margin: 0;
    }

  }

  .header--container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    max-width: 1280px;
    padding: 0 16px;

    @media only screen and (min-width: 1024px) {
      align-items: stretch;
      gap: 30px;
      flex-direction: row;
      flex-wrap: nowrap;
    }

    .top-navigation-wrap {
      align-items: center;
      display: flex;
      flex: 1;
      height: 72px;
      justify-content: space-between;

      @media only screen and (min-width: 1024px) {
        flex: 0 1;
      }

      .logo {
        width: 96px;

        @media only screen and (min-width: 1024px) {
          width: 135px;
          height: 36px;
        }
      }

      .top-header {
        place-items: center;
        display: flex;
        gap: 12px;

        @media only screen and (min-width: 1024px) {
          display: none;
        }

        .language-switcher {

          .links {
            display: flex;
            font-size: 12px;
            padding: 0;

            li {
              display: none;

              &:not(.is-active) {
                display: block;
              }

              a {
                color: #0037b2;
                font-size: 16px;
              }

            }

          }

        }

        @media only screen and (max-width: 1023px) {

          .menus-toggle {
            cursor: pointer;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;

            &:before {
              content: '';
              display: block;
              margin-bottom: 4px;
              background-color: #0037b2;
              border-radius: 2px;
              cursor: pointer;
              height: 4px;
              width: 33px;
              transform: rotate(0deg);
              transition: all 0.4s ease-in-out;
              position: relative;
              top: 0;
            }

            &:after {
              content: '';
              display: block;
              margin-top: 4px;
              background-color: #0037b2;
              border-radius: 2px;
              cursor: pointer;
              height: 4px;
              width: 33px;
              transform: rotate(0deg);
              transition: all 0.4s ease-in-out;
              position: relative;
              top: 0;
            }

            .content {
              display: block;
              background-color: #0037b2;
              border-radius: 2px;
              cursor: pointer;
              height: 4px;
              width: 33px;
              opacity: 1;
              transition: all 0.4s ease-in-out;
            }

          }

        }

      }

    }

    .top-navigation-main {
      justify-content: space-between;
      flex-direction: column;
      padding: 0;
      width: 100%;

      @media only screen and (min-width: 1024px) {
        align-items: center;
        display: flex;
        flex: 1 1;
        flex-direction: row;
        left: inherit;
        padding: 0;
      }

      @media only screen and (max-width: 1023px) {
        display: none;

        &.is-open {
          display: flex;
          padding: 0 18px 84px 18px;
        }
      }

      .menu-section--main {
        flex: 1;
        height: 100%;

        .menu-arrow {
          display: none;
          position: absolute;
          right: 0;
          top: 20px;
          color: #000;
          font-size: 18px;
          transition: all 0.4s ease-in-out;
        }

        @media only screen and (max-width: 1023px) {

          &.visible {
            display: block;
          }

          .menu-item {
            position: relative;
            padding: 20px 0;

            .menu-arrow {

              .fa-angle-down {
                display: block;
              }

            }

            &.menu-item--collapsed {

              .menu-arrow {
                display: block;
                transform: rotate(-90deg);
              }

              .menu {
                display: none;
              }

            }

            &.menu-item--expanded {

              .menu-arrow {
                display: block;
                top: 24px;
              }

              .menu {
                display: block;
                margin-left: 30px;
              }

            }

          }

        }

        a {
          line-height: 70px;
          text-underline-offset: 4px;

          @media only screen and (min-width: 1024px) {
            height: 100%;
          }

        }

        .menu-section--personalised {
          display: none;
        }

        nav.menu--main {
          height: 100%;

          ul.menu-level-0 {
            align-items: center;
            display: flex;
            flex-direction: row;
            gap: 30px;
            height: 100%;
            justify-content: flex-start;
            position: relative;

            @media only screen and (max-width: 1280px) {
              gap: 18px;
            }

            @media only screen and (max-width: 1023px) {
              flex-direction: column;
              gap: 0;

              > li {
                border-bottom: 1px solid var(--color-light-grey);
                width: 100%;

                &:last-child {
                  border-bottom: none;
                }

                a {
                  line-height: inherit;
                }

              }

            }

            @media only screen and (min-width: 1024px) {
              .menu {
                display: none;
              }

            }

            li {

              @media only screen and (min-width: 1024px) {
                height: 100%;
              }

            }

            /** My Darley **/

            li[data-title="MyDarley"] {
              margin-left: auto;
              position: relative;
              padding-right: 28px;

              sup {
                background-color: #CC1012;
                border-radius: 50%;
                color: #FFFFFF;
                display: none;
                place-items: center;
                font-size: 12px;
                width: 20px;
                height: 20px;

                &:after {
                  content: attr(data-notifications);
                }

                &.notify {
                  display: grid;
                  margin-top: 8px;
                }
              }

              .mydarley__wrapper {
                align-items: center;
                display: flex;
                gap: 8px;

                .fa-angle-down {
                  display: none;
                }

              }

              @media only screen and (max-width: 1023px) {
                padding-right: 0;
              }

              a {
                display: flex;
                align-items: center;
                gap: 8px;

                @media only screen and (min-width: 1024px) {
                  color: #0037B2;

                  span {
                    font-weight: 700;
                  }

                }

              }

              .menu-dropdown, .menu-arrow {
                display: none;
              }

              .menu-section--personalised {

                @media only screen and (min-width: 1024px) {
                  position: absolute;
                  top: 72px;
                  right: -1px;
                  z-index: 999;

                  ul.menu {
                    background-color: var(--color-white);
                    border: 1px solid var(--color-light-grey);
                    display: flex;
                    flex-direction: column;
                    width: 260px;
                    padding-left: 8px;
                    padding-right: 8px;
                    margin-left: 0;

                    li {
                      border-top: 1px solid #0037B2;
                      padding: 0 12px;
                      cursor: pointer;
                      display: flex;
                      align-items: center;
                      justify-content: space-between;

                      &:first-of-type {
                        border: none;
                      }

                      a {
                        color: #000;
                        font-size: 16px;
                        line-height: 60px;
                      }

                    }
                  }

                }

              }

              &:hover {

                .menu-section--personalised {

                  @media only screen and (min-width: 1024px) {
                    display: block;
                  }

                }

              }

            }

            /** Stallions **/

            li[data-title="Stallions"], li[data-title="スタリオン"] {

              .menu-dropdown-0 {
                @media only screen and (min-width: 1024px) {
                  display: none;
                  position: absolute;
                  top: 72px;
                  left: -6px;
                  width: 720px;
                  z-index: 99;

                  &.www_darley_com_au:not(.logged_in),
                  &.darleyeurope_com {
                    width: 1024px;
                  }

                }

                /** stallions mega menu **/

                .mega-menu__stallions {
                  background-color: var(--color-white);

                  @media only screen and (min-width: 1024px) {
                    border-top: 1px solid var(--color-light-grey);
                    display: grid;
                    filter: drop-shadow(0px 4px 2px rgba(0, 0, 0, 0.2));
                    padding: 30px;
                    grid-template-columns: 320px repeat(auto-fit, minmax(290px, 1fr));
                    gap: 30px;

                    > div {

                      &:not(:last-of-type) {
                        border-right: 1px solid #222222;
                      }

                      &:nth-child(2) {
                        color: #0037b2;
                        font-size: 16px;

                        h3, h4 {
                          color: #0037b2;
                          font-family: Meta, "Helvetica Neue", Helvetica, Arial, sans-serif;
                          font-weight: 700;
                          font-size: 18px;
                          margin-bottom: 18px;
                        }

                        h4 {
                          margin: 0;
                        }

                        div {
                          display: flex;
                          flex-direction: column;
                          gap: 12px;

                          a, span {
                            font-size: 18px;
                            line-height: inherit;
                          }

                          span {
                            padding-top: 4px;
                          }

                          a {
                            color: #0037b2;
                            text-decoration: underline;
                            text-underline-offset: 4px;
                          }

                          &.aus-blocks {
                            flex-direction: row;
                            justify-content: space-between;

                            ul {
                              padding: 0;

                              li {
                                height: inherit;

                                a, span {
                                  display: inline-block;
                                  font-size: 15px;
                                }

                                span {
                                  width: 150px;
                                  padding-bottom: 8px;
                                }

                              }

                            }

                          }

                        }

                      }

                    }

                  }

                  .menu-level-1 {

                    .menu-item {

                      a {
                        line-height: 24px;

                        &:not(.menu__link) {

                          @media only screen and (min-width: 1024px) {
                            font-family: "Meta-Serif", Georgia, Times, 'Times New Roman', serif;
                            font-size: 24px;
                            color: #0037b2;
                            margin-bottom: 18px;
                          }

                        }

                      }

                    }

                  }

                  .view-stallion-menu {

                    .view-content {

                      .new-stallion {
                        color: #CC1012;
                        font-weight: 700;
                      }

                      @media only screen and (min-width: 1024px) {
                        display: grid;
                        grid-template-columns:repeat(2, 1fr);
                      }

                    }

                  }

                }

              }

              .menu {

                @media only screen and (min-width: 1024px) {
                  display: block;
                }

                li:not(:first-child) {
                  display: none;
                }

              }

              &:hover {

                .menu-dropdown-0 {
                  display: block;
                }

              }

            }

          }

        }

      }

    }

  }

  .menu-section--regions {
    font-size: 16px;

    @media only screen and (min-width: 1024px) {
      border-left: 1px solid var(--color-light-grey);
      height: 100%;
      position: relative;
    }


    .menu-title {
      align-items: center;
      display: flex;
      gap: 8px;
      height: 100%;
      padding: 0 12px 0 35px;
      text-transform: uppercase;

      @media only screen and (max-width: 1023px) {
        padding: 0;
      }

    }

    .item-list {
      position: absolute;
      top: 72px;
      left: -1px;
      text-transform: uppercase;
      z-index: 999;

      @media only screen and (max-width: 1023px) {
        right: 0;
      }

      ul {
        background-color: var(--color-white);
        border: 1px solid var(--color-light-grey);
        padding: 0 8px;
        text-transform: uppercase;

        li {
          border-top: 1px solid #0037B2;

          &:first-of-type {
            border: none;
          }

          a {
            line-height: 60px;
            padding: 0 12px;
          }

        }

      }

    }

  }

}

#sub-navigation.area--sub-nav {
  padding: 0;

  @media only screen and (max-width: 1023px) {
    display: none;
  }

  .sub-nav--container {
    max-width: 1280px;

    #block-mainmenu {
      padding: 0 15px 0 165px;

      #block-mainmenu {
        padding: 0;
      }

      .menu {
        display: flex;
        flex-direction: row;
        gap: 38px;
        margin: 0;

        li > a {
          padding: 14px 0;
          transition: 0.4s;
          color: var(--color-white);
          position: relative;

          &:after {
            background-color: var(--color-white);
            content: '';
            position: absolute;
            transform: scaleX(0);
            height: 1px;
            bottom: 32%;
            left: 0;
            transition: transform 0.25s ease-out;
            transform-origin: bottom center;
            width: 100%;
          }

          &.is-active,
          &:hover {
            text-decoration: none;

            &:after {
              transform: scaleX(1);
              transform-origin: bottom center;
            }

          }

          &:focus {
            text-decoration: none;
          }

        }

        #stallion-forms {
          position: relative;

          > a {
            align-items: center;
            display: flex;
            gap: 8px;
          }

          .menu-section--forms {
            display: block;

            @media only screen and (min-width: 1024px) {
              background-color: #0037B2;
              display: none;
              position: absolute;
              top: 45px;
              left: -40px;
              width: 210px;
              transition: 0.4s;
              z-index: 999;
            }

            .menu {
              display: block;
              padding: 0 8px;

              li {
                border-top: 1px solid var(--color-white);
                padding: 0 12px;
                cursor: pointer;

                &:first-child {
                  display: none;
                }

                &:nth-child(2) {
                  border: none;
                }

                a {
                  line-height: 60px;
                  padding: 0 12px;

                  &:after {
                    display: none;
                  }

                }

              }

            }

          }

          &:hover {
            .menu-section--forms {
              display: block;
            }

          }

        }

        .request-nom__menu-item {

          li:first-child {
            display: none;
          }

        }

      }

    }

  }

}

/** Menu open - mobile **/
.menu-open {

  .header {
    @media only screen and (max-width: 1023px) {
      height: 100vh;
      overflow-y: auto;
    }

    .header--container {

      .top-navigation-wrap {
        .top-header {

          .menus-toggle {

            &:before {
              background-color: #0037b2;
              transform: rotate(45deg);
              transition: all 0.4s ease-in-out;
              top: 8px;
            }

            &:after {
              background-color: #0037b2;
              transform: rotate(-45deg);
              transition: all 0.4s ease-in-out;
              top: -8px;
            }

            .content {
              opacity: 0;
              transition: all 0.4s ease-in-out;
            }

          }

        }

      }

    }

    .top-navigation-main {

      .menu-section--regions {
        display: none;
      }

    }

  }

}

/** pweb **/
.pweb-logged-in {

  .header--container {
    .top-navigation-main {
      .menu-section--main {
        nav.menu--main {
          ul.menu-level-0 {
            li[data-title="MyDarley"] {

              .mydarley__wrapper {

                a {

                  span + .fa-angle-down {
                    display: block;

                    @media only screen and (max-width: 1023px) {
                      display: none;
                    }

                  }

                }

              }

              .menu-item {

                a {
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                }

              }

              .menu-dropdown, .menu-arrow {
                @media only screen and (max-width: 1023px) {
                  display: block;
                }
              }

            }
          }
        }
      }
    }
  }

}

/** Japan **/
.domain-www_darley_co_jp {

  .header {

    .menu-section--main {
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      .language-switcher {

        ul {
          display: flex;
          flex-direction: row;
          list-style: none;
          gap: 15px;
          margin-right: 28px;

          a {
            color: #0037b2;
          }
        }

      }

    }

  }

}

/** Stallion page **/
.is-page-node-type-stallion {

  #sub-navigation.area--sub-nav {

    @media only screen and (max-width: 1023px) {
      display: block;
    }

    .sub-nav--container {

      .stallion-mobile-menu {
        color: var(--color-white);
        cursor: pointer;
        display: none;
        justify-content: space-between;
        padding: 20px 30px;
        font-size: 18px;

        @media only screen and (max-width: 1023px) {
          display: flex;
        }

        .menu-arrow {
          transform: rotate(-90deg);
        }

        &.is-open {
          .menu-arrow {
            transform: rotate(0deg);
          }

          & + nav {
            background-color: #0037b2;
            height: 100vh;
            overflow: auto;
            overscroll-behavior: contain;
          }

        }

      }

      #block-mainmenu {
        .desktop-menu {
          display: flex;
        }

        @media only screen and (max-width: 1023px) {
          padding: 0;

          .mobile-menu {
            display: none;
            padding: 0 30px;

            li {

              border-bottom: 1px solid var(--color-white);

              &#stallion-forms {

                @media only screen and (max-width: 1023px) {
                  height: 340px;

                  .menu-section--forms {

                    .menu {

                      li, a {
                        padding-left: 0;
                      }

                    }

                  }

                }

              }

              &:last-child {
                border-bottom: none;
              }

              > a {
                padding: 20px 0;

                &:after {
                  display: none;
                }

              }

            }

          }

        }

      }

    }

  }

  .layout__region {
    scroll-margin-top: 132px;

    @media only screen and (max-width: 1023px) {
      scroll-margin-top: 128px;
    }
  }

}

/** Takeover **/
.takeover {

  .header {

    .header--container {

      .top-navigation-wrap {

        .top-header {

          @media only screen and (max-width: 1023px) {

            .menus-toggle {

              &:before, &:after {
                background-color: var(--color-white);
              }

              .content {
                background-color: var(--color-white);
              }

            }

          }

        }

      }

    }

  }

  &.takeover-black {

    .header {
      background-color: var(--color-black);

      a {
        color: var(--color-white);
      }

      .header--container {

        .top-navigation-main {

          .menu-section--main {

            ul.menu-level-0 {

              li[data-title="Stallions"], li[data-title="スタリオン"] {

                .menu-dropdown-0 {

                  .mega-menu__stallions {
                    background-color: var(--color-black);

                    @media only screen and (min-width: 1024px) {
                      & > div {

                        &:nth-child(2) {
                          color: var(--color-white);

                          h3,h4, a {
                            color: var(--color-white);
                          }

                        }

                      }

                    }

                    .menu-level-1 {

                      .menu-item {

                        a {

                          &:not(.menu__link) {

                            @media only screen and (min-width: 1024px) {
                              color: var(--color-white);
                            }

                          }

                        }

                      }

                    }

                    .view-stallion-menu {

                      .view-content {

                        .new-stallion {
                          color: var(--color-white);
                        }

                      }

                    }

                  }

                }

              }

              li[data-title="MyDarley"] {

                a {
                  @media only screen and (min-width: 1024px) {
                    color: var(--color-white);
                  }

                }

                sup {
                  background-color: var(--color-white);
                  color: var(--color-black);
                }

                .menu-section--personalised {

                  @media only screen and (min-width: 1024px) {

                    ul.menu {
                      background-color: var(--color-black);
                      border-color: var(--color-white);

                      li {
                        border-color: var(--color-white);

                        a {
                          color: var(--color-white);
                        }

                      }

                    }

                  }

                }

              }

            }

          }

        }

        .menu-section--regions {

          .item-list {

            ul {
              background-color: var(--color-black);

              li {
                border-color: var(--color-white);
              }

            }

          }

        }

      }

    }

    &.is-path-frontpage {

      .area--header + .medium-blue-bg {
        background-color: var(--color-black);
      }

    }

    &.is-page-node-type-stallion {

      .back-top-top__btn {
        background-color: var(--color-black);

        a {

          span {

            .fa-arrow-up {
              color: var(--color-black);
            }

          }

        }

      }

    }

  }

  &.takeover-blue {

    .header {
      background-color: #0037b2;

      a {
        color: var(--color-white);
      }

      .header--container {

        .top-navigation-main {

          .menu-section--main {

            ul.menu-level-0 {

              li[data-title="Stallions"], li[data-title="スタリオン"] {

                .menu-dropdown-0 {

                  .mega-menu__stallions {
                    background-color: #0037b2;

                    @media only screen and (min-width: 1024px) {
                      & > div {

                        &:not(:last-of-type) {
                          border-right: 1px solid var(--color-white);
                        }

                        &:nth-child(2) {
                          color: var(--color-white);

                          h3,h4, a {
                            color: var(--color-white);
                          }

                        }

                      }

                    }

                    .menu-level-1 {

                      .menu-item {

                        a {

                          &:not(.menu__link) {

                            @media only screen and (min-width: 1024px) {
                              color: var(--color-white);
                            }

                          }

                        }

                      }

                    }

                  }

                }

                .menu-level-1 {

                  .menu-item {

                    a {

                      &:not(.menu__link) {

                        @media only screen and (min-width: 1024px) {
                          color: var(--color-white);
                        }

                      }

                    }

                  }

                }

                .view-stallion-menu {

                  .view-content {

                    .new-stallion {
                      color: var(--color-white);
                    }

                  }

                }

              }

              li[data-title="MyDarley"] {

                a {
                  @media only screen and (min-width: 1024px) {
                    color: var(--color-white);
                  }

                }

                sup {
                  background-color: var(--color-white);
                  color: #0037b2;
                }

                .menu-section--personalised {

                  @media only screen and (min-width: 1024px) {

                    ul.menu {
                      background-color: #0037b2;
                      border-color: var(--color-white);

                      li {
                        border-color: var(--color-white);

                        a {
                          color: var(--color-white);
                        }

                      }

                    }

                  }

                }

              }

            }

          }

        }

        .menu-section--regions {

          .item-list {

            ul {
              background-color: #0037b2;

              li {
                border-color: var(--color-white);
              }

            }

          }

        }

      }

    }

  }

  &.domain-www_darley_co_jp {

    .header {

      .menu-section--main {

        .language-switcher {

          ul {

            a {
              color: var(--color-white);
            }

          }

        }

      }

    }

  }

}

