/**
 * 2025-12-29: 팝업 배너 스타일
 * PC: 하단 슬라이드업 배너
 * 모바일: 바텀시트 형식
 */

/* 공통 배너 컨테이너 */
.popup-banner {
  position: fixed;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-banner.is-visible {
  opacity: 1;
  visibility: visible;
}

/* 2025-12-29: 500px 초과 - 배너 박스 가운데 표시 */
@media (min-width: 501px) {
  .popup-banner {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  }

  .popup-banner.is-visible {
    transform: translateX(-50%) translateY(0);
  }

  /* 2025-12-29: PC에서 핸들(드래그바) 숨김 */
  .popup-banner__handle {
    display: none;
  }

  .popup-banner__inner {
    padding: 12px;
  }

  .popup-banner__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }

  .popup-banner__image {
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
  }

  .popup-banner__image img {
    width: 100%;
    height: auto;
    display: block;
  }

  .popup-banner__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: var(--spacing-sm);
  }

  .popup-banner__hide-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-gray);
    font-size: var(--font-small);
    cursor: pointer;
  }

  .popup-banner__hide-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }

  /* PC 닫기 버튼 - 텍스트 형태 */
  .popup-banner__close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--text-dark);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-small);
    cursor: pointer;
  }

  .popup-banner__close:hover {
    background: #000;
  }

  /* PC에서도 아이콘 숨기고 텍스트만 */
  .popup-banner__close .material-icons {
    display: none;
  }

  .popup-banner .mobile-only {
    display: inline;
  }
}

/* 2025-12-29: 500px 이하 - 전체 너비 바텀시트 */
@media (max-width: 500px) {
  .popup-banner {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    background: white;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    max-height: 70vh;
    overflow: hidden;
  }

  .popup-banner.is-visible {
    transform: translateY(0);
  }

  /* 바텀시트 핸들 */
  .popup-banner__handle {
    display: flex;
    justify-content: center;
    padding: var(--spacing-sm) 0;
  }

  .popup-banner__handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
  }

  .popup-banner__inner {
    padding: 0 var(--spacing-md) var(--spacing-md);
  }

  .popup-banner__content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .popup-banner__image {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .popup-banner__image img {
    width: 100%;
    height: auto;
    display: block;
  }

  .popup-banner__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
  }

  .popup-banner__hide-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-gray);
    font-size: var(--font-small);
    cursor: pointer;
  }

  .popup-banner__hide-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }

  /* 2025-12-29: 모바일 닫기 버튼 - 텍스트만 표시 */
  .popup-banner__close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #222;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
  }

  /* 모바일에서 아이콘 숨김 */
  .popup-banner__close .material-icons {
    display: none;
  }
}

/* 2025-12-29: PC/모바일 공통으로 닫기 텍스트 표시 (기존 숨김 규칙 제거) */

/* 2025-12-29: 배경 오버레이 - 모바일만 (PC는 투명) */
.popup-banner__overlay {
  display: none;
}

@media (max-width: 500px) {
  .popup-banner__overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .popup-banner__overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }
}

/* 2025-12-29: Swiper 슬라이더 스타일 */
.popupBannerSwiper {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* 하단 정렬 - 높이 다른 배너 전환 시 자연스럽게 */
.popupBannerSwiper .swiper-wrapper {
  align-items: flex-end;
}

.popupBannerSwiper .swiper-slide {
  height: auto;
}

.popupBannerSwiper .swiper-slide a {
  display: block;
  text-decoration: none;
}

.popupBannerSwiper .swiper-slide img {
  width: 100%;
  height: auto;
  max-height: 50vh; /* 화면 높이의 50% 제한 */
  object-fit: contain;
  display: block;
}

/* Swiper 페이지네이션 스타일 */
.popup-banner__pagination {
  position: static !important;
  margin-top: var(--spacing-sm);
  display: flex;
  justify-content: center;
  gap: 6px;
}

.popup-banner__pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #ddd;
  opacity: 1;
  margin: 0 !important;
}

.popup-banner__pagination .swiper-pagination-bullet-active {
  background: #333;
}

