@charset "utf-8";
/* 모바일 알림창 — 첫 화면을 덮지 않게 작게 띄운다.
   넓은 화면은 손대지 않는다. 기존 css 도 건드리지 않는다. */

@media (max-width: 1023px) {

  /* ── 자리 ──────────────────────────────────────────────────────
     첫 화면 한가운데를 비우고 아래쪽 구석으로 내린다.
     사진이 주인공인 자리를 알림창이 가리지 않게 하는 것이 이 파일의 목적이다.
     화면에 붙여 두어 스크롤해도 따라오고, 언제든 닫을 수 있다. */
  #hd_pop .hd_pops {
    position: fixed !important;
    top: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    left: 14px !important;
    right: auto !important;
    width: 200px !important;
    max-width: 56vw !important;
    height: auto !important;
    max-height: calc(100vh - 140px);
    border: 0 !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
    background: #fff;
  }

  /* ── 안내 이미지 ───────────────────────────────────────────────
     넓은 화면 규칙이 100vw 로 펴 두었으므로 상자 폭에 맞춰 되돌린다. */
  #hd_pop .hd_pops .hd_pops_con {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    display: block;
    line-height: 0;          /* 이미지 아래 빈 줄 없앰 */
  }

  #hd_pop .hd_pops .hd_pops_con img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }

  /* 작게 줄인 안내문을 그대로 읽을 수 있도록 눌러서 원본을 여는 자리.
     상자 전체가 누를 칸이라 손가락 크기 요건을 넉넉히 넘는다. */
  #hd_pop .hd_pops .hd_pops_con a {
    display: block;
    position: relative;
    line-height: 0;
  }
  /* 눌러서 크게 볼 수 있다는 것을 알려 주는 표시 —
     안내문 글자를 가리지 않도록 빈 여백인 오른쪽 위 모서리에 작게 둔다. */
  #hd_pop .hd_pops .hd_pops_con a::after {
    content: "크게 보기";
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 7px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: -0.03em;
    color: #fff;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
  }

  /* ── 아래 단추줄 ───────────────────────────────────────────────
     상자가 좁아 두 단추가 한 줄에 다 들어가지 않으므로 접어 내린다.
     단추 높이와 글자 크기는 다른 규칙이 정한 값을 그대로 쓴다. */
  #hd_pop .hd_pops .hd_pops_footer {
    flex-wrap: wrap;
    gap: 2px;
  }

  #hd_pop .hd_pops .hd_pops_footer button {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }

  #hd_pop .hd_pops .hd_pops_footer button.hd_pops_close {
    position: static !important;   /* 오른쪽 위 고정을 풀어 아래로 내려 놓는다 */
  }

  /* 상자 높이가 모자라면 안내 그림 쪽을 줄이고 단추줄은 늘 보이게 한다 */
  #hd_pop .hd_pops {
    display: flex;
    flex-direction: column;
  }
  #hd_pop .hd_pops .hd_pops_con {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #hd_pop .hd_pops .hd_pops_footer {
    flex: 0 0 auto;
  }

  /* 하단 상담 띠가 있으면 그 위에 띄운다 */
  html.ss-mbar-on #hd_pop .hd_pops {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100vh - 200px) !important;
  }
}

/* 가로로 눕힌 폰 — 세로가 낮아 그림 옆에 단추줄을 둔다 */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 500px) {
  #hd_pop .hd_pops {
    flex-direction: row;
    width: auto !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100vh - 140px) !important;
  }
  html.ss-mbar-on #hd_pop .hd_pops {
    height: calc(100vh - 172px - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100vh - 172px - env(safe-area-inset-bottom, 0px)) !important;
  }
  #hd_pop .hd_pops .hd_pops_con {
    flex: 0 0 auto;
    width: auto !important;
    height: 100% !important;
  }
  #hd_pop .hd_pops .hd_pops_con a,
  #hd_pop .hd_pops .hd_pops_con picture {
    display: block;
    height: 100%;
  }
  #hd_pop .hd_pops .hd_pops_con img {
    width: auto !important;
    height: 100% !important;
  }
  #hd_pop .hd_pops .hd_pops_footer {
    flex: 0 0 132px;
    width: 132px;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
  }
  #hd_pop .hd_pops .hd_pops_footer button {
    flex: 0 0 auto;
    display: block;
    padding: 6px 8px !important;
    line-height: 1.4;
  }
}
