/* =========================
   공통 기본 설정
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --main-color: #ff0000;
  --sub-color: #f1c40f;
  --text-color: #222;
  --background-color: #e9e9e9;
  --line-color: #ddd;
}
html {
  font-size: clamp(12px, 1.2vw, 16px);
  scroll-behavior: smooth;
}
body {
  font-size: 1rem;
  font-family: "Noto Sans KR", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f5f3eb; /* 신문지 종이색 */
  overflow-x: hidden;
}

/* ===================== 섹션 ===================== */
section {
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-behavior: smooth;
  clear: both;
  flex-direction: column;
  padding: 5rem 0;
  width: 100%; /* 화면 전체 넓이 */
}

.wrap {
  width: 100%;
  max-width: 1400px; /* 콘텐츠 최대 넓이 제한 */
  margin: 0 auto; /* 중앙 정렬 */
  padding: 0 20px; /* 양쪽 여백 (모바일 대비) */
  box-sizing: border-box;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}
a:hover {
  color: var(--main-color);
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.text-center {
  text-align: center;
}
button {
  cursor: pointer;
}

/* =========================
   텍스트 자동 반응형
   ========================= */
h1 {
  font-size: clamp(28px, 5vw, 48px);
}
h2 {
  font-size: clamp(24px, 4.5vw, 40px);
}
h3 {
  font-size: clamp(20px, 4vw, 32px);
}
h4 {
  font-size: clamp(16px, 3vw, 24px);
}
h5 {
  font-size: clamp(14px, 2.5vw, 18px);
}
h6 {
  font-size: clamp(12px, 2vw, 16px);
}

p,
span,
li,
a,
button {
  font-size: clamp(12px, 1.2vw, 16px);
}
.highlight {
  background-color: #131313;
  padding: 0 0.5rem;
  color: #fff;
}
.text_color1 {
  opacity: 0.7;
}

section .badge {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  z-index: 2;
  flex-direction: column;
  margin: 1rem 0;
}

section h2 {
  line-height: 1;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  text-align: center;
  padding: 0.3px 1px;
  color: var(--background-color);
  background-color: var(--text-color);
  letter-spacing: -0.06em; /* 🔹 자간 줄이기 */
  margin-top: 1rem;
}

#about {
  background: #f1c40f;
}
#pro_link {
  background: #d4d4d4;
}
#story2 {
  background: #d1d9df;
}

/* =========================
   상단 고정 마퀴 텍스트
   ========================= */
.marquee-text {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 25px;
  line-height: 25px;
  background-color: #dc4e5a;
  color: var(--background-color);
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 9999;
}
.marquee-content {
  display: inline-flex;
  animation: marquee 50s linear infinite;
}
.marquee-content span {
  padding-right: 2rem;
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* =========================
   헤더(Header)
   ========================= */

header {
  position: fixed;
  top: 25px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background-color: #f5f3eb; /* 신문지 종이색 */
  transition: all 0.3s ease;
  z-index: 999;
  width: 100%;
  border-bottom: 1px solid var(--line-color);
  overflow-x: hidden;
}

header .logo img {
  height: 50px;
  transition: all 0.3s ease;
}

nav a {
  margin-left: 30px;
  font-size: clamp(16px, 3vw, 24px);
  font-weight: 600;
  transition: all 0.3s ease;
}

.kakao-btn a {
  font-size: 24px;

  margin-left: 20px;
  transition: all 0.3s ease;
}

/* 스크롤 시 줄어드는 클래스 */
header.scrolled {
  padding: 10px 40px;
}

header.scrolled .logo img {
  height: 40px;
}

header.scrolled nav a {
  margin-left: 20px;
}

header.scrolled .kakao-btn a {
  font-size: 20px;
}

/* =========================
   메인 배너
   ========================= */
.main_banner1 {
  position: relative;
  top: 50px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 600px;

  background: url("img/main_bag1.png") no-repeat center center; /* 🔹 가운데 한 번만 */
  background-size: contain; /* 🔹 비율 유지하면서 자동 크기 조정 */

  display: flex;
}

.text-overlay {
  font-family: "Noto Sans KR", sans-serif;
  line-height: 1.5; /* 🔹 중앙 정렬 */
  display: flex;
  flex-direction: column; /* 혹시 여러 텍스트 줄일 경우 위→아래 방향 */
  justify-content: center; /* 세로 중앙 */
}

.banner-slideshow {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.banner-slideshow img {
  position: absolute;

  width: 400px;
  height: auto;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}
.banner-slideshow img.active {
  opacity: 1;
}

/* =========================
   히어로 섹션
   ========================= */
#pro {
  display: flex;
  flex-direction: column; /* 위에서 아래로 쌓이도록 */
  position: relative;
}
/* =========================
   히어로 섹션
========================= */
.story {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 기본 4열 */
  gap: 20px; /* 아이템 사이 간격 */
  width: 100%;
}

.story-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: 0.3s;
}

.story-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.story-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;

  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(1.03) contrast(0.95) saturate(1.05);
}

.story-item img:hover {
  transform: scale(1.03);
  filter: brightness(1.08);
}
.story-item p {
  text-overflow: ellipsis; /* 넘치면 … 표시 */
}
.story-item .data {
  font-size: clamp(9px, 2vw, 11px);
  color: #ededed;
}
/* =========================
         🔝 맨 위로 가기 버튼
      ========================= */
#topBtn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: #333;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  display: none;
  transition: background 0.3s;
}

#topBtn:hover {
  background: #555;
}

/* =========================
   Masonry (상품 갤러리)
   ========================= */
.masonry {
  column-count: 5;
  column-gap: 15px;
  width: 100%;
  margin: 0 auto;
}
.masonry-item {
  position: relative;
  display: inline-block;
}
.masonry-item img {
  width: 100%;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  cursor: pointer;
}
.img-number,
.sold-number {
  position: absolute;
  font-size: clamp(10px, 2vw, 12px);
  bottom: 8px;
  left: 8px;
  color: #a8a8a8;
  background-color: var(--background-color);
  border-radius: 3px;
  padding: 2px 4px;
}
.sold-number {
  background: var(--main-color);
}

/* =========================
   푸터(Footer)
   ========================= */
footer {
  background: #a8915f;
  width: 100%;
  color: #fff;
  height: 250px;
}

.footer-container {
  display: flex; /* 가로 정렬 */
  justify-content: space-between; /* 좌우 배치 */
  align-items: center; /* 세로 중앙 정렬 */
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex-wrap: wrap; /* 모바일에서 줄바꿈 허용 */
  gap: 20px; /* 줄바꿈 시 간격 */
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-left img {
  height: 60px;
}

.footer-left p {
  line-height: 1.2rem;
  margin: 2px 0;
}

.footer-right {
  display: flex; /* 버튼 가로 정렬 */
  gap: 10px;
  align-items: center;
}
.footer-right .buttons {
  display: flex; /* 버튼 가로 정렬 */
  gap: 8px; /* 버튼 사이 간격 */
  flex-wrap: wrap; /* 화면 좁으면 줄바꿈 */
}
/* 버튼 스타일 */
.footer-right button {
  height: 30px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  cursor: pointer;
}
.footer-right button:hover {
  background: #555;
}

/* 모달 기본 숨김 */
.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999; /* ✅ 다른 요소 위에 확실히 */
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.qr-modal.active {
  display: flex !important; /* ✅ 모바일에서도 강제로 표시 */
}

.qr-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-modal-content img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.qr-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 48px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000; /* ✅ 닫기버튼이 이미지 위에 */
  transition: 0.3s;
}

.qr-close:hover {
  color: #dc4e5a;
}

/* =========================
   모달 팝업
   ========================= */
#imageModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
#imageModal.active {
  display: flex;
}
.modal-content {
  position: relative;

  border-radius: 12px;
  width: 800px;
  max-width: 95%;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
}
.modal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 20px;
}
.modal-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.modal-main .caption {
  margin-top: 10px;
  text-align: center;
  font-size: 1rem;
  color: #fff;
}
.modal-thumbnails {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  overflow-x: auto;
}
.modal-thumbnails img {
  height: 70px;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
}
.modal-thumbnails img.active {
  border-color: #dc4e5a;
}
.modal-thumbnails img:hover {
  transform: scale(1.05);
}
.modal-content .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content .close:hover {
  background: #dc4e5a;
}

.close-menu {
  display: none;
}

/* =========================
   반응형
   ========================= */

@media (max-width: 768px) {
  .main_banner1 {
    top: 50px;

    background: url("img/main_bag2.png") no-repeat center center; /* 🔹 가운데 한 번만 */
    min-height: 500px; /* 화면 줄여도 높이 유지 */
    background-position: center;
    background-size: contain;
  }
  .banner-slideshow img {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 350px;
  }
  header {
    padding: 10px 15px;
    background-color: #f5f3eb; /* 배경 유지 */
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  }

  header .logo img {
    height: 28px;
  }

  .kakao-btn a {
    font-size: 20px;
  }

  /* 스크롤 시 축소 효과 */
  header.scrolled {
    padding: 8px 15px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
  }
  header.scrolled .logo img {
    height: 25px;
  }
  header.scrolled nav a {
    margin-left: 10px;
  }

  /*  */

  .masonry {
    column-count: 3;
    column-gap: 10px;
  }

  .modal-content {
    height: 80vh;
  }

  .sold-number,
  .main_banner1none,
  .header.scrolled,
  .text-overlay {
    display: none;
  }
  .img-number {
    bottom: 3px;
    left: 3px;

    padding: 1px 2px;
    font-size: 9px;
  }

  .footer-container {
    margin: 2rem 0;
  }
  .footer-container {
    flex-direction: column; /* 세로 정렬 */
    align-items: flex-start; /* 왼쪽 정렬 */
    height: auto; /* 높이 자동 */
    gap: 15px;
  }

  .footer-right {
    align-self: stretch; /* 버튼 전체 폭 사용 가능 */
    justify-content: flex-start;
    margin-top: 1rem;
  }
  .footer-left img {
    height: 40px;
  }
  .footer-right .buttons {
    justify-content: flex-start;
  }

  .qr-modal-content img {
    max-width: 90vw;
    max-height: 80vh;
  }

  .qr-close {
    font-size: 36px;
    top: 15px;
    right: 15px;
  }

  /* =========================
   히어로 섹션
========================= */
  .story {
    grid-template-columns: repeat(2, 1fr); /* 2열 */
    font-size: 10px;
  }

  #topBtn {
    bottom: 5px;
    right: 5px;

    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}
