/**

    Archivo de estilado de Headers generales de la web

    Style file for general web headers

**/

#headerSocial {
  #headerSocial__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0;
    margin: 0;
  }
}

.headerSocial__list__item a {
  background-color: hsl(var(--primary-500));
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: background-color 0.3s ease-in-out;
}

.headerSocial__list__item a[data-social="x"] {
  background-color: var(--color-x);
}

.headerSocial__list__item a[data-social="x"]:hover {
  background-color: color-mix(in srgb, var(--color-x) 80%, #000);
}

.headerSocial__list__item a[data-social="facebook"] {
  background-color: var(--color-facebook);
}

.headerSocial__list__item a[data-social="facebook"]:hover {
  background-color: color-mix(in srgb, var(--color-facebook) 80%, #000);
}

.headerSocial__list__item a[data-social="youtube"] {
  background-color: var(--color-youtube);
}

.headerSocial__list__item a[data-social="youtube"]:hover {
  background-color: color-mix(in srgb, var(--color-youtube) 80%, #000);
}

.headerSocial__list__item a[data-social="linkedin"] {
  background-color: var(--color-linkedin);
}

.headerSocial__list__item a[data-social="linkedin"]:hover {
  background-color: color-mix(in srgb, var(--color-linkedin) 80%, #000);
}

.headerSocial__list__item a[data-social="instagram"] {
  background-color: var(--color-instagram);
}

.headerSocial__list__item a[data-social="instagram"]:hover {
  background-color: color-mix(in srgb, var(--color-instagram) 80%, #000);
}

.headerSocial__list__item a[data-social="rrss"] {
  background-color: var(--color-rss);
}

.headerSocial__list__item a[data-social="rrss"]:hover {
  background-color: color-mix(in srgb, var(--color-rss) 80%, #000);
}

.headerSocial__list__item img {
  width: 18px;
  aspect-ratio: 1 / 1;
}


#headerMenu {
  justify-self: end;
  #headerMenu__bg {
    visibility: hidden;
    opacity: 0;
    background-color: #000;
    height: 100dvh;
    width: 100dvw;
    left: 0;
    top: 0;
    position: fixed;
    transition: all .3s ease-in-out;
    &.is--opened {
      opacity: .8;
      visibility: visible;
    }
    @media (width >= 1024px) {
      display: none;
    }
  }
  #headerMenu__nav {
    --width: 60dvw;
    position: fixed;
    height: 100dvh;
    width: var(--width);
    padding-top: 1rem;
    background-color: var(--primary-dark-1);
    top: 0;
    right: 0;
    transform: translateX(var(--width));
    transition: transform .3s ease-in-out;
    &.is--opened {
      transform: translateX(0);
    }
    @media (width >= 1024px) {
      display: flex;
      align-items: center;
      gap: 1.5rem;
      width: 100%;
      border-top: 1px solid var(--shadow-light-3);
      border-bottom: 1px solid var(--shadow-light-3);
      padding-top: 0;
      position: relative;
      width: auto;
      height: auto;
      background-color: transparent;
      transform: none;
    }
    > a {
      display: flex;
      align-items: center;
    }
    ul.menu {
      list-style: none;
      padding: 0;
      display: flex;
      flex-direction: column;
      @media (width >= 1024px) {
        display: flex;
        flex-direction: row;
        gap: .5rem;
        margin: 0;
      }
      .menu-item-has-children {
        & > a {
          position: relative;
          @media (width >= 1024px) {
            &::after {
              content: "";
              background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='icon icon-tabler icon-tabler-caret-down-filled' width='32' height='32' viewBox='0 0 24 24' stroke-width='1.5' stroke='%23000000' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z' stroke-width='0' fill='%23000' /%3E%3C/svg%3E");
              width: 10px;
              height: 10px;
              background-size: contain;
              background-position: center;
              background-size: no-repeat;
              position: absolute;
              right: 0;
              top: 50%;
              transform: translateY(-50%);
            }
          }
        }
      }
      a {
        text-decoration: none;
        transition: color .3s ease-in-out;
        color: #fff;
        font-weight: 300;
        padding: .75rem var(--mobile-pd);
        display: flex;
        font-size: var(--fs-sm);
        text-transform: uppercase;
        @media (width >= 1024px) {
          color: hsla(var(--shadow-500),1);
          font-size: var(--fs-base);
          padding: var(--mobile-pd);
          text-transform: none;
        }
      }
      a:hover {
        color: var(--brown);
        & + .sub-menu {
          display: flex;
        }
      }
      ul.sub-menu {
        background-color: color-mix(in hsl, hsl(var(--primary-500)) 40%, #000);
        list-style: none;
        padding: 0;
        @media (width >= 1024px) {
          flex-direction: column;
          display: none;
          position: absolute;
          top: 100%;
          background-color: #fff;
          border-radius: 4px;
          border: 1px solid var(--shadow-light-3);
          gap: 0;
          min-width: 200px;
          margin: 0 auto;
        }
        a {
          padding: .75rem var(--mobile-pd);
        }
      }
      ul.sub-menu:hover {
        display: flex;
      }
    }
  }
  #headerMenu__nav__innova {
    padding: 0 var(--mobile-pd);
    @media (width >= 1024px) {
      padding: 0;
    }
    picture {
      display: flex;
    }
  }
  #headerMenu__secondary-menu {
    @media (width >= 1024px) {
      display: none;
    }
  }
  #headerMenu__mobile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    border: none;
    background-color: transparent;
    padding: 0;
    margin-left: auto;
    span {
      text-transform: uppercase;
      font-weight: bold;
      font-size: .75rem;
    }
    @media (width >= 1024px) {
      display: none;
    }
  }
  #headerMenu__mobile-btn-close {
    position: absolute;
    right: .5rem;
    top: .5rem;
    border-radius: 99999px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    @media (width >= 1024px) {
      display: none;
    }
  }
  #headerMenu__mobile-btn-close:hover {
    background-color: var(--primary-dark-2);
  }
}

/* Main top menu */
#headerTopMenu {
  align-self: center;
  display: none;
  @media (width >= 1024px) {
    display: flex;
  }
  ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    @media (width >= 1024px) {
      display: flex;
      flex-direction: row;
    }
    li {
      position: relative;
    }
    ul.sub-menu {
      background-color: color-mix(in hsl, hsl(var(--primary-500)) 40%, #000);
      list-style: none;
      padding: 0;
      @media (width >= 1024px) {
        flex-direction: column;
        display: none;
        position: absolute;
        top: 100%;
        background-color: #fff;
        border-radius: 4px;
        border: 1px solid var(--shadow-light-3);
        gap: 0;
        min-width: 200px;
        margin: 0 auto;
      }
      a {
        display: block;
        padding: .40rem var(--mobile-pd);
      }
    }
    ul.sub-menu:hover {
      display: flex;
    }
    a {
      text-decoration: none;
      color: hsla(var(--shadow-500),1);
      font-size: var(--fs-sm);
      transition: color .3s ease-in-out;
      @media (1024px <= width <= 1280px) {
        font-size: var(--fs-xs);
      }
    }
    a:hover {
      color: hsla(var(--shadow-500),.5);
      & + .sub-menu {
        display: flex;
      }
    }
  }
}

#headerSearch {
  #searchform {
    position: relative;
  }
  input {
    background-color: var(--shadow-light-3);
    border: none;
    border-radius: 4px;
    padding: 6px 10px 6px 10px;
    height: 34px;
    width: 100%;
    box-sizing: border-box;
  }
  #searchsubmit {
    background-color: var(--secondary-light-1);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 4px);
    aspect-ratio: 1 / 1;
  }
}

.wpml-ls-legacy-dropdown {
  width: auto;
}
.wpml-ls-legacy-dropdown a {
  background-color: #fff;
  border-color: var(--shadow-light-3);
  border-radius: 4px;
}

#mainHeader {
    padding: 0 var(--mobile-pd);
    #mainHeader__wrap {
        --logo-w: 100px;
        padding: var(--mobile-pd) 0;
        width: 100%;
        max-width: var(--container);
        margin: 0 auto;
        border-bottom: 1px solid var(--shadow-light-3);
        display: grid;
        gap: 1rem;
        grid-template: 
            "search search search lang lang lang"
            "ad ad ad ad ad ad"
            "logo social social social social menu";
        grid-template-rows: repeat(3,auto);
        grid-template-columns: var(--logo-w) 1fr 1fr 1fr 1fr 1fr;
        row-gap: 1rem;
        @media (width >= 640px) {
            --logo-w: 10rem;
            grid-template: 
            "search search search search lang lang"
            "ad ad ad ad ad ad"
            "logo social social social social menu";
        }
        @media (width >= 1024px) {
            grid-template: 
            "top-menu search social lang"
            "logo ad ad ad"
            "menu menu menu menu";
            grid-template-columns: 3fr 230px auto 10rem;
            border: none;
            padding-bottom: 0;
        }
    }
    #headerSearch {
        grid-area: search;
    }
    #headerAdvertising {
        grid-area: ad;
        align-self: center;
    }
    #headerLang {
        grid-area: lang;
        align-self: center;
    }
    #headerLogo {
        grid-area: logo;
        width: 100%;
        @media (width >= 1024px) {
            max-width: 230px;
        }
        img {
            max-width: 100%;
        }
    }
    #headerSocial {
        grid-area: social;
        place-content: center;
    }
    #headerMenu {
        grid-area: menu;
        place-content: center;
        width: 100%;
    }
    .adsHorizontalDouble {
        margin: 0;
    }
}