@charset "utf-8";
/* ===========================
   Product Gallery Styles
   - product1.php ~ product4.php
   =========================== */

/* 기본 레이아웃 안정화 */
#product_gallery {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 15px;
    position: relative;
    min-height: 500px;
    font-family: 'Pretendard', sans-serif;
}

/* 정렬 및 개수 표시 유틸바 */
.gallery_utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.count_info { font-size: 16px; color: #444; font-weight: 500; }
.count_info b { color: #3ec890; font-weight: 700; }

.sort_select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}
.sort_select:focus { border-color: #3ec890; outline: none; }

/* 카테고리 탭 스타일 */
.category_tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}
.category_tabs button,
.category_tabs a {
    display: inline-block;
    padding: 12px 28px;
    border: 2px solid #3ec890;
    background: #fff;
    color: #3ec890;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 50px;
    text-decoration: none;
}
.category_tabs button:hover,
.category_tabs button.active,
.category_tabs a:hover,
.category_tabs a.active {
    background: #3ec890;
    color: #fff;
    box-shadow: 0 4px 12px rgba(62, 200, 144, 0.2);
}

/* 갤러리 그리드 설정 */
.gallery_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* 갤러리 아이템 스타일 */
.gallery_grid .item {
    position: relative;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 95%;
    margin: 0 auto;
}
.gallery_grid .item.show { display: block; }
.gallery_grid .item[onclick] { cursor: pointer; }
.gallery_grid .item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #3ec890;
}

.gallery_grid .item .img_box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gallery_grid .item .img_box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.gallery_grid .item:hover .img_box img { transform: scale(1.05); }

.gallery_grid .item .info_box {
    padding: 20px 15px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #f5f5f5;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

/* Hover 상세 정보 */
.hover_info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(62, 200, 144, 0.92);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 25px;
    text-align: center;
    z-index: 2;
    border-radius: 12px;
}
.gallery_grid .item:hover .hover_info { opacity: 1; }
.hover_info h3 { font-size: 20px; margin-bottom: 12px; font-weight: 700; }
.hover_info p { font-size: 15px; line-height: 1.6; margin-bottom: 20px; word-break: keep-all; }

/* 버튼 그룹 - 2행 레이아웃 */
.hover_info .hover_btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.hover_info .hover_btns_row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.hover_info .hover_btns_row a {
    flex: 1;
    text-align: center;
}

/* 상세보기 버튼 */
.hover_info .detail_btn {
    display: inline-block;
    padding: 10px 15px;
    border: 1.5px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
    text-decoration: none;
}
.hover_info .detail_btn:hover { background: #fff; color: #3ec890; }

/* 샘플구매 버튼 - 상세보기와 동일 스타일 */
.hover_info .sample_btn {
    display: inline-block;
    padding: 10px 15px;
    border: 1.5px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
    text-decoration: none;
}
.hover_info .sample_btn:hover { background: #fff; color: #3ec890; }

/* OEM/ODM/사입 문의 버튼 - 전체 너비 */
.hover_info .inquiry_btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: 1.5px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
    text-decoration: none;
    text-align: center;
}
.hover_info .inquiry_btn:hover { background: #fff; color: #3ec890; }

/* TOP 버튼 */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 55px;
    height: 55px;
    background: #3ec890;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}
#backToTop.visible { opacity: 1; visibility: visible; }
#backToTop:hover { background: #2fb17d; transform: translateY(-5px); }

/* 모달 카테고리 라벨 */
.modal_category {
    display: inline-block;
    padding: 4px 12px;
    background: #3ec890;
    color: #fff;
    font-size: 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* Brand Top 영역 - product4.php 브랜드 배너 */
.brand_top {
    position: relative;
    height: 280px;
    margin: 30px 0;
    overflow: hidden;
    display: none;
}
.brand_top.show {
    display: block;
}
.brand_top .brand_bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
.brand_top .brand_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 60%, transparent 100%);
}
.brand_top .brand_content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 30px 50px;
    max-width: 1200px;
    margin: 0 auto;
}
.brand_top .brand_logo {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 40px;
}
.brand_top .brand_logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.brand_top .brand_info {
    flex: 1;
}
.brand_top .brand_info h2 {
    color: #222;
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 15px 0;
    line-height: 1.3;
}
.brand_top .brand_info h2 b {
    color: #3ec890;
}
.brand_top .brand_info p {
    color: #555;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    max-width: 450px;
    word-break: keep-all;
}

/* 모달 푸터 버튼 */
.modal_footer_btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.modal_footer_btns .btn_download {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}
.modal_footer_btns .btn_inquiry {
    background: #3ec890;
    color: #fff;
}
.modal_footer_btns .btn_sample {
    background: #ff6b35;
    color: #fff;
}

/* 반응형 설정 */
@media (max-width: 992px) {
    .gallery_grid { grid-template-columns: repeat(2, 1fr); }
    .brand_top { height: 240px; }
    .brand_top .brand_content { padding: 20px 30px; }
    .brand_top .brand_logo { width: 140px; height: 140px; margin-right: 25px; }
    .brand_top .brand_info h2 { font-size: 22px; }
    .brand_top .brand_info p { font-size: 14px; }
}
@media (max-width: 768px) {
    .brand_top { height: 200px; }
    .brand_top .brand_overlay { width: 100%; background: rgba(255,255,255,0.85); }
    .brand_top .brand_content { padding: 20px; flex-direction: column; text-align: center; }
    .brand_top .brand_logo { width: 80px; height: 80px; margin-right: 0; margin-bottom: 15px; }
    .brand_top .brand_info h2 { font-size: 18px; margin-bottom: 8px; }
    .brand_top .brand_info p { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-width: 600px) {
    .gallery_grid { grid-template-columns: repeat(1, 1fr); }
    .category_tabs button,
    .category_tabs a { padding: 8px 18px; font-size: 14px; }
    .sort_select { height: 40px; padding: 5px 10px; }
    #backToTop { bottom: 20px; right: 20px; width: 45px; height: 45px; }
}
