/* =========================
  Promo Popup (Spring Only)
========================= */

.promo-modal--spring[aria-hidden='true'] {
  display: none;
}
.promo-modal--spring[aria-hidden='false'] {
  display: block;
}

/* overlay */
.promo-modal--spring {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.promo-modal--spring .promo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* layout - center */
.promo-modal--spring .promo-modal__layout {
  position: relative;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  top: 0;
}

/* panel */
.promo-modal--spring .promo-modal__panel {
  width: min(560px, 100%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  position: relative;

  background: transparent;
  padding: 0;

  max-height: calc(100dvh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* hero background */
.promo-modal--spring .promo-modal__panel--hero {
  background-image: var(--promo-bg);
  background-size: cover;
  background-position: center;
}

/* overlay on hero */
.promo-modal--spring .promo-modal__panel--hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.55)
  );
  pointer-events: none;
}

/* layer */
.promo-modal--spring .promo-modal__panel--hero > * {
  position: relative;
  z-index: 1;
}

/* hero head */
.promo-modal--spring .promo-hero__head {
  padding: 22px 20px 14px;
  color: #fff;
}
.promo-modal--spring .promo-hero__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.promo-modal--spring .promo-hero__desc {
  margin: 10px 0 0;
  font-size: 14px;
  opacity: 0.92;
}

/* alert */
.promo-modal--spring .promo-hero__alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.2px;
  opacity: 1;
  animation: promoSparkle 0.9s infinite;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35);
}

@keyframes promoSparkle {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    filter: brightness(1.15);
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.85);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* =========================
  card (공통)
========================= */
.promo-modal--spring .promo-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;

  width: calc(100% - 32px);
  max-width: 100%;
  margin: 0 auto 14px;

  padding: 14px;
  border-radius: 16px;
  text-decoration: none;
  color: #111;

  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.6);

  box-sizing: border-box;
}

/* media (기본) */
.promo-modal--spring .promo-card__media {
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}

/* ✅ 기본(PC/태블릿)에서는 contain + fill */
.promo-modal--spring .promo-card__media img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block;
}

/* fallback */
.promo-modal--spring .promo-card__media--fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0, #ffffff);
}

/* content */
.promo-modal--spring .promo-card__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* text sizes */
.promo-modal--spring .promo-card__badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.3);
  color: #18655f;
  margin-bottom: 10px;
}
.promo-modal--spring .promo-card__name {
  font-size: 18px;
  font-weight: 950;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-modal--spring .promo-card__sub {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-modal--spring .promo-card__cta {
  font-size: 15px;
  font-weight: 950;
}

/* footer */
.promo-modal--spring .promo-modal__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
  color: #fff;
}

.promo-modal--spring .promo-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 950;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  user-select: none;
}
.promo-modal--spring .promo-modal__check input {
  transform: translateY(1px) scale(1.05);
}

.promo-modal--spring .promo-modal__btn {
  border: 0;
  cursor: pointer;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}

/* =========================
  ✅ 모바일(좁은 화면) : 제품사진 "짤림 0" 보장
  - iOS에서 height:100%+object-fit이 가끔 잘려 보이는 이슈 회피
  - media 박스를 자연 높이로 만들고, img는 height:auto로
========================= */
@media (max-width: 560px) {
  .promo-modal--spring .promo-card {
    grid-template-columns: 140px 1fr;
    width: calc(100% - 24px);
  }
  .promo-modal--spring .promo-card__name {
    font-size: 17px;
  }
  .promo-modal--spring .promo-card__sub,
  .promo-modal--spring .promo-card__cta {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .promo-modal--spring .promo-card {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
  }

  /* ✅ 사진이 잘려 보이지 않게: 비율 고정 제거 + 여백 조금 */
  .promo-modal--spring .promo-card__media {
    aspect-ratio: auto; /* ✅ 고정 비율 제거 */
    padding: 10px; /* ✅ 이미지 숨쉴 공간 */
  }

  /* ✅ 모바일에서는 height:auto로 "전체가 보이게" */
  .promo-modal--spring .promo-card__media img {
    width: 100% !important;
    height: auto !important; /* ✅ 핵심 */
    max-height: 320px !important; /* ✅ 너무 커지는 것만 방지 */
    object-fit: contain !important;
  }
}

/* =========================
  ✅ PC 팝업 크기 키우기 (파란 네모 수준)
  - 패널 폭 크게
  - 카드/여백/폰트도 같이 자연스럽게 업
========================= */
@media (min-width: 900px) {
  .promo-modal--spring .promo-modal__layout {
    padding: 28px;
  }

  .promo-modal--spring .promo-modal__panel {
    width: min(980px, 92vw); /* ✅ 팝업 자체 확장 */
    border-radius: 22px;
    max-height: calc(100dvh - 56px);
  }

  /* PC에서 밭 배경 더 시원하게 */
  .promo-modal--spring .promo-modal__panel--hero {
    background-size: 130% auto;
    background-position: center 55%;
  }

  .promo-modal--spring .promo-hero__head {
    padding: 26px 26px 16px;
  }
  .promo-modal--spring .promo-hero__title {
    font-size: 26px;
  }

  .promo-modal--spring .promo-card {
    grid-template-columns: 220px 1fr; /* ✅ 카드도 같이 커짐 */
    width: calc(100% - 52px);
    padding: 18px;
    margin-bottom: 16px;
  }

  .promo-modal--spring .promo-card__badge {
    font-size: 14px;
    padding: 8px 14px;
  }
  .promo-modal--spring .promo-card__name {
    font-size: 22px;
  }
  .promo-modal--spring .promo-card__sub {
    font-size: 16px;
  }
  .promo-modal--spring .promo-card__cta {
    font-size: 16px;
  }

  .promo-modal--spring .promo-modal__check {
    font-size: 17px;
  }
  .promo-modal--spring .promo-modal__btn {
    font-size: 16px;
    padding: 12px 18px;
  }
}

/* =========================================
  ✅ PC 최종 크기 조정 + 카드 반투명 효과
========================================= */
@media (min-width: 900px) {
  /* 🔵 팝업창 전체 크기 살짝 축소 */
  .promo-modal--spring .promo-modal__panel {
    width: min(860px, 88vw); /* ← 980px → 860px로 축소 */
    border-radius: 22px;
    max-height: calc(100dvh - 60px);
  }

  /* 🔵 카드 폭도 비율 맞춰 자연스럽게 */
  .promo-modal--spring .promo-card {
    grid-template-columns: 200px 1fr;
    width: calc(100% - 60px);
    padding: 20px;
  }

  /* ✨ 흰색 카드 반투명 + 유리느낌 */
  .promo-modal--spring .promo-card {
    background: rgba(255, 255, 255, 0.3); /* 기존 0.92 → 0.75 */
  }

  /* 살짝 더 세련되게 그림자 약화 */
  .promo-modal--spring .promo-card {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
}
