header{
  .header__search-bar{
    .search-form {
      position: relative;
    }
    .search-field {
        padding-right: 36px; /* spazio per la lente */
        padding-left: 12px;
        height: 40px;
        border-radius: 20px;
        border: 3px solid #000;;
        background-color: #fff;
    }
    .search-field::placeholder{
      color: #7d7d7d;
      font-size: .75rem;
    }
    .search-submit {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        font-size: 22px;
        padding: 0;
        line-height: 1;
        color: #000;
    }
  }

  .header__first-row{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    padding: 10px;

    .vertical-line{
      width: 4px;
      background-color: #000;
      border-radius: 99999px; }

    .icon-circle{
      border: 3px solid #000;
      border-radius: 50%;
      padding: 5px;
      color: #000;
      background: #fff;
    }

    .cnr-iom-logo img{height: 40px; }

    .header__utility{
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      gap: 10px;

      a, a:hover, a:visited{color: #000; text-decoration: none; }

      .horizontal-line{ display: none; }

      .header__social, .header__tools{
        display: flex;
        flex-direction: row;
        gap: 3px;
      }
      .header__tools{
        a, a:hover, a:visited{color: var(--blue-iom);}
        .icon-circle{
            background: #000;
            border-color: var(--blue-iom);
            color: var(--blue-iom);
          }
        .header__phonebook.icon-circle{
          color: #000;
          background: var(--blue-iom);
          border-color: #000;
        }
        .header__logout, .header__login{
          color: var(--blue-iom);
        }
      }
    }
  }


  .header__second-row{
    position: relative;
    height: 60px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;

    .second-row__cnr-iom-logo {
      position: absolute;
      top: 50%;
      left: 5px;
      transform: translateY(-50%);
      opacity: 0;
      margin-left:20px;

    }

    ul#menu-nav{
      list-style-type: none;
      display:flex;
      flex-direction: row;
      gap: 5px;
      width: fit-content;
      margin: 0 auto;

      a, a:visited{
        color: #fff;
        padding: 20px 10px;
        display: inline-block;
        text-decoration: none;
        font-size: 22px;
      }
      a:hover{ background: var(--blue-iom); color: #000;}
      a:active{ background: #00535e; transform: scale(.85);}
      @media (max-width: 1100px){
        a{ font-size: 1.2rem; }
      }
    }

  }


  .header__mobile{ display: none; }

  @media (max-width: 900px){
    .header__first-row, .header__second-row{ display: none; }

    .header__mobile{
      height: 70px;
      position: relative;
      display: flex;
      justify-content: space-between;
      padding: 10px;
      overflow: hidden;

      .mobile-cnr-iom-logo img{ width: 250px; height: auto; position: absolute; top: 10px; left: 10px; z-index: 1}
      .mobile-cnr-iom-logo .color-logo{ opacity: 1; }
      .mobile-cnr-iom-logo .negative-color-logo{ opacity: 0;}
      .mobile-cnr-iom-logo.menu--open .negative-color-logo{
        opacity: 1;
        transition: opacity .3s .1s;
      }
      .mobile-cnr-iom-logo.menu--open .color-logo{ opacity: 0; }

      .hamburger{
        font-size: 2rem;
        z-index:10;
        background: #e6ecee;
        border-radius: 5px;
        padding: 5px;
      }
      .hamburger:hover{ cursor: pointer; }

      .mobile-menu{
        position: absolute;
        top: 0;
        right:0;
        transform: translateX(100%);
        opacity: 0;
        padding-top:80px;
        height: 100vh;
        height:100dvh;
        max-height:100dvh;
        min-height: 100svh;    /* small viewport (senza barre) */
        min-height: -webkit-fill-available; /* Safari vecchi */
        background: #000;
        text-align: right;
        transition: transform .3s, opacity .4s ease-in-out;
        width: 100%;
        max-width: 100dvw;
        position: fixed;
      }
      .mobile-menu.menu--open{
          transform: translateX(0);
          opacity: 1;
          transition: transform .3s, opacity .4s  ease-in-out;
      }
      .mobile-menu li a{
          display: block ;
      }
      .mobile-menu li a{
        padding: 10px 20px;

      }
      .mobile-menu li a, .mobile-menu li a:visited, .mobile-menu li a:hover, .mobile-menu li a:active{ color: var(--blue-iom); text-decoration: none; font-size:1.5rem;}
      .mobile-menu li a:hover{ background: var(--blue-iom); color: #000; }
      .mobile-menu .mainmenu{ padding: 0; }


      .header__utility{
        position:absolute;
        bottom: 0;
        left: 0;
        width: 100vw;

        a, a:visited, a:active{ color: #d4d4d4; text-decoration: none;}

        .horizontal-line{
          background: linear-gradient(to right, transparent, #00a9bf, transparent);
          height: 10px;
          width: 100%;
          border-radius: 10px;
          border: none;
          margin: 30px 0;
        }

        .header__search-bar{
          display: flex;
          justify-content: center;

          .search-field{
            border-color: #fff;
            color: #fff;
            background: #000;
          }
          .search-submit{ color: #fff; }
        }

        .icon-circle{
          border: 3px solid #00a9bf;
          border-radius: 50%;
          padding: 30px;
          color: #d4d4d4;
          background: #000;
          font-size: 2rem;
        }

        .vertical-line{ display: none; }

        .header__social, .header__tools{
          display: flex;
          justify-content: center;
          margin: 30px;
          gap: 20px;
        }
        .header__instagram.icon-circle{ font-size: 1.5rem; }

        .header__tools{
          .icon-circle{ color: #00a9bf; }
          .header__phonebook.icon-circle{
            border-color: #d4d4d4;
            background: #000;
            color: #d4d4d4;
          }
        }
      }  /* header__utility */
    }
  }
}
