.site_popup,
.site_popup * {
  box-sizing: border-box;
}

@media screen and (min-width: 768px) {
  .site_popup {
    position: fixed;
    bottom: 20px;
    z-index: 999;
    width: 100%;
    max-width: 980px;
    margin: 0;
    padding: 0;
    background: transparent;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s;
  }
  .site_popup .banner_popup_row,
  .site_popup > a {
    display: block;
    background-color: rgba(255, 255, 255, 0.4);
    margin-top: 22px;
    padding: 6px;
  }
  .site_popup .banner_popup_row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 6px;
  }
  .site_popup .banner_popup_row > a,
  .site_popup .banner_popup_row > img {
    flex: 0 0 calc((100% - 18px) / 4);
    width: calc((100% - 18px) / 4);
    max-width: calc((100% - 18px) / 4);
    min-width: 0;
    height: auto;
  }
  .site_popup .banner_popup_row > img,
  .site_popup .banner_popup_row a img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  .site_popup .close_btn {
    display: block;
    background-image: url(../img/icon_banner_close.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 18px;
    height: 18px;
    cursor: pointer;
  }
  .site_popup .close_btn:hover {
    opacity: 0.7;
  }
}

@media screen and (max-width: 767px) {
  .site_popup.pc {
    display: none !important;
  }
  .site_popup {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    width: max-content;
    max-width: calc(100% - 22vw);
    margin: 0;
    transform: translateX(-50%);
    z-index: 999;
    opacity: 1;
    pointer-events: auto;
  }
  .site_popup .banner_popup_row {
    display: inline-block;
    position: relative;
    width: auto;
    max-width: 100%;
    margin: 22px 0 0;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.4);
    transition: width 0.7s ease, height 0.7s ease;
  }
  .site_popup .banner_popup_row > .banner_popup_item {
    display: block;
    width: auto;
    max-width: none;
    height: auto;
    opacity: 0;
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
  }
  .site_popup .banner_popup_row > .banner_popup_item:first-child {
    opacity: 1;
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 1;
    pointer-events: auto;
  }
  .site_popup .banner_popup_row.is_ready > .banner_popup_item,
  .site_popup .banner_popup_row.is_ready > .banner_popup_item:first-child {
    opacity: 0;
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 0;
    pointer-events: none;
  }
  .site_popup .banner_popup_row.is_ready > .banner_popup_item.is_active {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
  }
  .site_popup .banner_popup_row img {
    display: block;
    width: auto;
    height: auto;
    max-height: 80px;
    max-width: calc(100vw - 25vw - 12px);
  }
  .site_popup .close_btn {
    display: block;
    background-image: url(../img/icon_banner_close.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 18px;
    height: 18px;
    cursor: pointer;
  }
}
