/* products-style.css */

body {
    margin: 0;
    background-color: #151515;
    color: #fff;
  }

/* 남는 공간을 모두 차지하도록 함 */  
.gallery-section{
  flex-grow: 1;
  margin-bottom: 100px;
}


/* 제목 및 소제목 */
.title-wrapper {
    margin-top:100px;
    text-align: center;
    padding: 40px 20px 20px;
}
.title-wrapper h1 {
    font-size: 3rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
}
.title-wrapper p {
    font-size: 1.1rem;
    color: #ccc;
    margin: 0;
}


  /* 검색창 */
  .search-wrapper {
    position: relative;
    width: 250px;
    margin: 20px auto;
    /*margin-top:150px;*/
  }
  #faq-search {
    padding: 10px 40px 10px 15px;
    border-radius: 20px;
    border: 1px solid #555;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
  }
  

  .search-button {
    position: absolute; /* 버튼을 wrapper 내부에 절대 위치로 변경 */
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    background-color: transparent;
    color: #ccc;
    border: none;
    padding: 0 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
}

.search-button:hover {
    color: var(--color-text-primary);
}

.search-button .icon {
    width: 1.25rem;
    height: 1.25rem;
}


  /* 필터 버튼 */
  .gallery-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  button.filter-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background-color: #333;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  button.filter-btn:hover { background-color: #b50000; }

  button.filter-btn.active {
    background-color: #b50000;
    color: #ffffff;
    font-weight: 700;
  }
  
  
  /* 갤러리 */
  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .gallery-item {
    background-color: #333;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    text-align: center;
  }

  .gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
  }
  /*.gallery-item img:hover { transform: scale(1.05); }*/

  .gallery-item .name {
    margin: 0 auto;
    padding:5px 5px;
    font-size: 0.9rem;
    background-color: #333;
    color: #fff;
  }

  /* 오버레이 */
  .overlay {
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    display:flex;
    justify-content:center;
    align-items:center;
    color:#fff;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none; /* 클릭은 이미지가 받도록 */
  }
  .gallery-item:hover .overlay {
    opacity: 1;
  }
  .overlay span {
    pointer-events: auto; /* 텍스트는 클릭 가능 */
  }

  @media (max-width: 768px) {
    .gallery-section{
      height: auto;
      margin-bottom: 50px;
    }
    .gallery { 
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    }
  }



  /* 모달 전체 */
  .modal {
    display: none; /* 기본은 숨김 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    overflow: auto; /* 이미지가 클 경우 스크롤 */
    z-index: 1000;
  }

  /* 모달 이미지 */
  .modal img {
    display: block;
    
    
    margin: auto;
    cursor: pointer; /* 클릭 시 닫힘 안내 */
  }

  /* 모바일 대응 */
  @media (max-width: 768px) {
    .modal img {
      max-width: 80%;
      
    }
  }

  

/* 모달 내부 컨텐츠를 감싸는 래퍼 */
.modal .modal-content-wrapper {
  position: relative; 
  display: inline-block; 
  margin: auto; 
}

/* 구매 버튼 기본 스타일 */
.buy-now-button {
  position: fixed; /* 이미지 위에 겹치도록 설정 */
  left: 50%; /* 가운데 정렬 */
  transform: translateX(-50%); /* 가운데 정확히 맞춤 */
  z-index: 10; 
  
  background-color: #e50914; 
  color: white;
  padding: 12px 24px; 
  border-radius: 5px; 
  text-decoration: none; 
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.3s;
  white-space: nowrap; /* 버튼 글자 줄바꿈 방지 */
}

.buy-now-button:hover {
  background-color: #f6121d;
}

/* 데스크탑 화면용 (768px 이상) */
@media (min-width: 768px) {
  .buy-now-button {
    top: 50px; /* 데스크탑 여백 */
  }
}

/* 모바일 화면용 (768px 미만) */
@media (max-width: 767px) {
  .title-wrapper {  
    margin-top:50px;    
  }
  .title-wrapper h1 {
      font-size: 2.5rem;
  }  
  .modal img {
    max-width: 90%; 
  }
  .buy-now-button {
    top: 30px; /* 모바일 여백 */
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  /* 모바일 페이지네이션 스타일 */
  .products-pagination {
    flex-wrap: wrap; 
    gap: 0.5rem; 
  /*padding: 0 1rem;*/
  }
}

/* --- 페이지네이션 --- */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    /*margin-top: 2rem;*/
    margin-bottom: 2rem;
    gap: 0.75rem;
}

.products-pagination button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    border: none;
    background-color: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.products-pagination button:hover {
    color: #b50000;
}

.products-pagination button.active {
    background-color: #b50000;
    color: #ffffff;
    font-weight: 700;
    border-radius: 0.25rem;
}

.products-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
