/* plastic_solution.css */

/* 플라스틱 솔루션 전용 배경색 */
body.page-plastic {
    background-color: #F8F9FA;
    overflow-y: auto; /* 게이트 페이지의 hidden 덮어쓰기 */
    height: auto;
    min-height: 100vh;
}

/* 페이지 헤더 (타이틀 및 탭) */
.page-header {
    background-color: #FFFFFF;
    padding: 30px 40px 0 40px;
    border-bottom: 1px solid #EAEAEA;
}

.page-title-container h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-tabs {
    display: flex;
    gap: 30px;
}

.page-tabs .tab {
    text-decoration: none;
    color: #888;
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 12px;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.page-tabs .tab:hover {
    color: #333;
}

.page-tabs .tab.active {
    color: #333;
    border-bottom: 3px solid var(--primary-color);
}

/* 메인 컨텐츠 영역 */
.solution-container {
    display: flex;
    padding: 40px;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

/* 좌측 사이드바 (LNB) */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background-color: transparent;
    position: sticky;
    top: 40px; /* 화면 스크롤 시 상단에 고정 */
    align-self: flex-start;
    max-height: calc(100vh - 80px); /* 화면을 넘어갈 경우 내부 스크롤 허용 */
    overflow-y: auto;
}

/* 스크롤바 숨기기 (선택사항, 깔끔하게 보이기 위해) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap; /* 글자 줄바꿈 방지 */
}

.category-btn img, .category-btn svg {
    width: 20px;
    height: 20px;
    /* 원본 SVG 색상(흰색, 검은색 등)에 상관없이 모두 어두운 회색으로 통일 */
    filter: brightness(0) opacity(0.6);
    transition: filter 0.2s;
}

.category-btn:hover {
    background-color: rgba(81, 77, 111, 0.05); /* primary color 연하게 */
}

/* 활성화된 카테고리 (design_system.md 규칙 적용) */
.category-btn.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.category-btn.active img, .category-btn.active svg {
    /* 활성화 시 모두 흰색으로 통일 */
    filter: brightness(0) invert(1); 
}

/* 우측 메인 컨텐츠 영역 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 사이즈 검색 배너 */
.size-search-banner {
    background-color: var(--white-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #F0F0F0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-text-area h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.search-text-area p {
    color: #666;
    font-size: 0.95rem;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    padding-right: 15px;
}

.input-group input {
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 1rem;
    width: 120px;
    outline: none;
    font-family: var(--font-family);
}

.input-group .unit {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.multiply {
    color: #999;
    font-weight: bold;
    font-size: 1.2rem;
}

.search-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-left: 10px;
}

.search-btn:hover {
    opacity: 0.9;
}

.search-result-msg {
    color: #d32f2f;
    font-weight: 500;
    font-size: 0.95rem;
    margin-top: -5px;
}

/* 우측 제품 그리드 */
.product-grid {
    display: grid;
    /* 항상 가로열 최대 4개의 제품만 나오도록 설정 */
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
}

/* 제품 카드 */
.product-card {
    background-color: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #F0F0F0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-image {
    width: 100%;
    /* 플라스틱 용기 등 제품 비율에 가장 잘 맞는 4:3 비율 프레임 설정 */
    aspect-ratio: 4 / 3;
    background-color: #FFFFFF; /* 레터박스가 생겨도 자연스럽게 흰색 배경 적용 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px; /* 여백 추가 */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 크롭되지 않고 원본 비율 유지 (레터박스 허용) */
    transition: transform 0.5s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

/* Placeholder 아이콘 */
.card-image svg {
    width: 48px;
    height: 48px;
    stroke: #CCC;
}

.card-content {
    padding: 20px;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}

/* 반응형 처리 */
@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 중간 화면에서 3열 */
    }
}

@media (max-width: 1024px) {
    .solution-container {
        flex-direction: column;
        padding: 20px;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        position: relative; /* 모바일에서는 고정 해제 */
        top: 0;
        max-height: none;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .category-btn {
        width: auto;
        white-space: nowrap;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 태블릿에서 2열 */
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr; /* 모바일에서 1열 */
    }
}
