/* ========================================
   기본 설정
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    -ms-overflow-style: none;
}

::-webkit-scrollbar {
    display: none;
}

.hidden {
    display: none !important;
}

/* ========================================
   헤더
   ======================================== */
.header-wrapper {
    background: linear-gradient(to right, #1a1a1a 0%, #2c2c2c 100%);
    width: 100%;
}

header {
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.mobile-menu-btn {
    display: none;
}

.logo {
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 6px;
    flex-shrink: 0;
}

nav {
    display: flex;
    gap: 30px;
    flex: 1;
    justify-content: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
    white-space: nowrap;
}

nav a:hover {
    color: #64b5f6;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 5px 15px;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    padding: 5px;
    width: 200px;
}

.search-box span {
    margin-left: 5px;
    color: #999;
    cursor: pointer;
}

/* ========================================
   메인 컨테이너
   ======================================== */
.container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
}

/* ========================================
   사이드바
   ======================================== */
.sidebar {
    width: 250px;
    background: #fff;
    padding: 20px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.sidebar h3 {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}

.filter-group {
    margin-bottom: 30px;
}

.filter-group h4 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    user-select: none;
    margin-bottom: 10px;
}

.filter-group h4::after {
    content: '−';
    font-size: 18px;
    font-weight: normal;
    transition: transform 0.3s;
    margin-left: 10px;
    flex-shrink: 0;
}

.filter-group h4.collapsed::after {
    content: '+';
}

.filter-group-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-group-content.collapsed {
    max-height: 0;
}

.filter-group label {
    display: block;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
}

.filter-group label.highlighted {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { background: transparent; }
    50% { background: #ffeb3b; }
    100% { background: transparent; }
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}

/* ========================================
   메인 콘텐츠
   ======================================== */
.main-content {
    flex: 1;
    padding: 30px;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.page-title {
    font-size: 32px;
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

/* ========================================
   제품 그리드
   ======================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 280px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
}

.product-specs {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.product-number {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.category-buttons {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    border: none;
}

.category-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

/* ========================================
   상세 페이지
   ======================================== */
.detail-page {
    display: none;
    background: #fff;
    width: 100%;
    min-height: 100vh;
}

.detail-page.active {
    display: block;
}

#listPage.hidden {
    display: none;
}

.detail-header {
    background: #000;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.detail-logo {
    color: #fff;
    font-size: 14px;
    letter-spacing: 3px;
    text-align: right;
}

.detail-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.detail-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
}

.detail-title-text {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.detail-header-buttons {
    display: flex;
    gap: 10px;
}

.btn-compare,
.btn-back {
    padding: 10px 22px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    border-radius: 4px;
}

.btn-compare {
    background: #8b7355;
    color: white;
}

.btn-compare:hover {
    background: #6d5a43;
}

.btn-back {
    background: #333;
    color: white;
}

.btn-back:hover {
    background: #555;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

.detail-main-layout {
    display: flex;
    gap: 40px;
    padding: 30px 0;
}

.detail-left-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-right-section {
    flex-shrink: 0;
    width: 600px;
    max-width: 50%;
    position: relative;
}

/* 아이콘 그리드 */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 0fr);
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.icon-wrapper {
    /* border: 1px solid #ddd; */
    padding: 5px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box {
    width: 65px;
    height: 65px;
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 11px;
    line-height: 1.1;
}

.icon-box.icon-image {
    padding: 5px;
    background: white;
}

.icon-box.icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-circle {
    border-radius: 50%;
}

.icon-diamond {
    border: 2px solid #333;
    transform: rotate(45deg);
    position: relative;
}

.icon-diamond-content {
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* 제품 스펙 테이블 */
.spec-table-section {
    margin-top: 10px;
    background: white;
    /* border: 1px solid #ddd; */
    border-radius: 8px;
    padding: 20px;
}

.spec-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.spec-table tr:last-child {
    border-bottom: none;
}

.spec-table td {
    padding: 12px 8px;
    font-size: 14px;
}

.spec-label {
    font-weight: bold;
    color: #333;
    width: 150px;
    background: #f9f9f9;
}

.spec-value {
    color: #666;
}

/* 메인 제품 이미지 */
.main-product-image {
    width: 100%;
    height: 500px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    margin-bottom: 20px;
    position: relative;
}

.main-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* 썸네일 스크롤 */
.thumbnails-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    justify-content: flex-end;
}

.thumbnails-scroll::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.thumbnails-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.thumbnails-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s;
    background: white;
    overflow: hidden;
}

.thumbnail-item:hover {
    border-color: #999;
}

.thumbnail-item.active {
    border-color: #333;
    border-width: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.thumbnail-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========================================
   오버레이
   ======================================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ========================================
   페이지네이션
   ======================================== */
.pagination-container {
    margin-top: 50px;
    margin-bottom: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
}

.page-btn:hover {
    background: #f0f0f0;
}

.page-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.page-dots {
    color: #999;
    padding: 0 5px;
    font-size: 14px;
}

/* ========================================
   카카오톡 버튼
   ======================================== */
.kakao-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #FEE500;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: all 0.3s;
    text-decoration: none;
}

.kakao-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.kakao-button img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

/* ========================================
   푸터
   ======================================== */
footer {
    background: #2a2a2a;
    color: #999;
    padding: 40px 30px 25px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-section {
    flex: 0 0 auto;
    text-align: left;
}

.footer-section h3 {
    color: #c9a961;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: normal;
}

.footer-section p {
    line-height: 1.6;
    font-size: 12px;
}

.copyright {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 11px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #444;
}

/* ========================================
   반응형 - 데스크톱
   ======================================== */
@media (min-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (min-width: 1025px) and (max-width: 1399px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ========================================
   반응형 - 태블릿
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px;
    }
    
    .product-image {
        height: 240px;
    }
    
    .product-image img {
        padding: 12px;
    }
    
    .detail-main-layout {
        flex-direction: column;
    }
    
    .detail-right-section {
        width: 100%;
        max-width: 100%;
    }
    
    .main-product-image {
        height: 400px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(5, 0fr);
        gap: 8px;
    }
    
    .icon-box {
        width: 60px;
        height: 60px;
    }
}

/* ========================================
   반응형 - 모바일
   ======================================== */
@media (max-width: 768px) {
    header {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        padding: 15px;
        gap: 0;
    }

    .mobile-menu-btn {
        display: block;
        grid-column: 1;
        grid-row: 1;
        background: none;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        width: 30px;
        height: 30px;
        padding: 0;
    }

    .logo {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
        font-size: 14px;
        letter-spacing: 3px;
    }

    nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
        gap: 25px;
        padding: 12px 0;
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    nav a {
        font-size: 12px;
    }

    .search-box {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: 15px;
        padding: 10px 20px;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        font-size: 14px;
    }

    .search-box span {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        z-index: 1000;
        transition: left 0.3s;
        height: 100vh;
    }

    .sidebar.active {
        left: 0;
    }

    .container {
        flex-direction: column;
    }

    .main-content {
        padding: 20px 10px;
        width: 100%;
    }

    .page-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px 0 !important;
    }
    
    .product-card {
        width: 100%;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-image img {
        padding: 10px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px !important;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .product-specs {
        font-size: 11px !important;
        line-height: 1.5;
    }
    
    .category-buttons {
        gap: 4px;
        margin-top: 8px;
    }
    
    .category-btn {
        padding: 3px 6px !important;
        font-size: 10px !important;
    }
    
    #productTypeFilters {
        gap: 8px !important;
        padding: 0 10px;
        margin-bottom: 20px !important;
    }
    
    #productTypeFilters button {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }

    .detail-header {
        padding: 15px;
    }

    .detail-logo {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .detail-content {
        padding: 20px 15px;
    }
    
    .detail-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .detail-title-text {
        font-size: 20px;
        text-align: center;
    }
    
    .detail-header-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-compare,
    .btn-back {
        width: 100%;
        padding: 10px;
        font-size: 12px;
    }
    
    .detail-main-layout {
        flex-direction: column;
        gap: 25px;
        padding: 20px 0;
        display: flex;
    }
    
    .detail-left-section {
        order: 2;
    }
    
    .detail-right-section {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        order: 1;
    }
    
    .main-product-image {
        height: 300px;
        padding: 20px;
        order: 1;
    }
    
    .main-product-image img {
        max-height: 300px;
    }
    
    .thumbnails-scroll {
        order: 2;
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(5, 0fr);
        gap: 6px;
        margin-top: 30px;
        margin-bottom: 20px;
        padding: 0 10px;
    }
    
    .icon-wrapper {
        padding: 3px;
    }
    
    .icon-box {
        width: 50px;
        height: 50px;
        font-size: 9px;
    }
    
    .spec-table td {
        padding: 10px 5px;
        font-size: 13px;
    }
    
    .spec-label {
        width: 110px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 32px;
    }
    
    .page-dots {
        font-size: 12px;
        padding: 0 3px;
    }

    footer {
        padding: 30px 20px 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 25px;
        align-items: flex-start;
    }

    .footer-section {
        width: 100%;
        text-align: left;
    }
    
    .kakao-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .kakao-button img {
        width: 30px;
        height: 30px;
    }
}

/* ========================================
   반응형 - 작은 모바일
   ======================================== */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-image img {
        padding: 8px;
    }
    
    .product-name {
        font-size: 12px !important;
    }
    
    .product-specs {
        font-size: 10px !important;
    }
    
    #productTypeFilters button {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .detail-title-text {
        font-size: 18px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(5, 0fr);
        gap: 4px;
    }
    
    .icon-wrapper {
        padding: 2px;
    }
    
    .icon-box {
        width: 45px;
        height: 45px;
        font-size: 8px;
        border: 1.5px solid #333;
    }
    
    .icon-diamond {
        border: 1.5px solid #333;
    }
    
    .spec-table td {
        font-size: 12px;
    }
    
    .spec-label {
        width: 100px;
    }
    
    .main-product-image {
        height: 250px;
        padding: 15px;
    }
    
    .main-product-image img {
        max-height: 250px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
}