@charset "UTF-8";

/* ===============================================
ハンバーガーボタンのスタイリング
=============================================== */
.hamberger_menu {

  input[type="checkbox"] {
      opacity: 0;
      visibility: hidden;
      position: absolute;
    }
}


.hamburger {
  display: block;
  width: 40px;
  height: 40px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.hamburger span,
.hamburger span::before,
.hamburger span::after {
  position: absolute;
  display: block;
  content: "";
  width: 100%;
  height: 3px;
  background-color: #fff;
  transition: all 0.5s;
}
.hamburger span::before {
  top: -10px;
}
.hamburger span::after {
  bottom: -10px;
}
input[type="checkbox"]:checked + .hamburger span {
  background-color: transparent;
}
input[type="checkbox"]:checked + .hamburger span::before {
  top: 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:checked + .hamburger span::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* ===============================================
メニューのスタイリング
=============================================== */
.nav {
  position: fixed;
  width: 50%;
  height: 100vh;
  top: 80px;
  right: -120%;
  background-color: #f3f3f3;
  color: #fff;
  transition: all 0.5s;
  border-left: 1px solid #333;

  h3 {
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #333;
    padding: 0 20px;
    color: #333;
    font-size: 2rem;
    text-decoration: none;
  }

  .category {
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
  }
  .container {
    padding: 0 20px;

    .category_list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 20px;
      margin-top: 20px;


      li {

        a {
            display: grid;
            grid-template-columns: 50px auto;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: #333;

            img {
                display: block;
                width: 100%;
                padding: 5px;
                background-color: #fff;
                border: 1px solid #fff;
                transition: border 0.2s;
            }

            p {
                font-size: 1.6rem;
            }

            &:hover img {
                border: 1px solid #999;
            }

            &:hover p {
                text-decoration: underline;
            }
          }
      } 
    }
  } 
}

input[type="checkbox"]:checked ~ .nav {
  right: 0;
}

@media (max-width: 1300px) {
  .nav {
    .container {
  
      .category_list {
        grid-template-columns: repeat(3, 1fr);
      }
    }
  }
}


@media (max-width: 900px) {
  .nav {
    width: 70%;
  }
}

@media (max-width: 600px) {
  .nav {
      top: 130px;
      width: 90%;

      .container {
    
        .category_list {
          grid-template-columns: repeat(2, 1fr);
        }
      }
  }
}

@media (max-width: 450px) {
  .nav {
    min-width: 320px;

    .container {
  
      .category_list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;

        li {

          a {
              grid-template-columns: 40px auto;
  
              img {

                  padding: 2px;
              }
          }
        }
      }
    }
  }
}