/* =========================================================
   Product (JI-TECH inspired) — Updated Design
   ========================================================= */
:root {
    --jitech-blue: #004c98;
    --jitech-dark: #1a2b4b;
    --jitech-gray: #f4f7f9;
    --jitech-border: #e1e8ed;
    --jitech-text: #333333;
    --jitech-muted: #666666;
    --jitech-white: #ffffff;
}

.prd-wrap {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    color: var(--jitech-text);
    background-color: var(--jitech-white);
}

.prd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* Breadcrumbs */
.prd-breadcrumb {
    padding: 20px 0;
    font-size: 13px;
    color: var(--jitech-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.prd-breadcrumb span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.prd-breadcrumb span:after {
    content: '>';
    font-size: 10px;
}
.prd-breadcrumb span:last-child:after {
    content: none;
}
.prd-breadcrumb a {
    color: var(--jitech-muted);
    text-decoration: none;
}
.prd-breadcrumb a:hover {
    text-decoration: underline;
}

/* Hero Section */
.prd-header-title {
    padding: 40px 0;
    border-bottom: 2px solid var(--jitech-dark);
    margin-bottom: 40px;
}
.prd-header-title h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--jitech-dark);
    margin: 0;
    text-transform: uppercase;
}
.prd-header-title .sub-title {
    font-size: 18px;
    color: var(--jitech-blue);
    margin-top: 10px;
    font-weight: 500;
}

/* Layout with Sidebar */
.prd-main-layout {
    display: flex;
    gap: 40px;
}

.prd-sidebar {
    width: 240px;
    flex-shrink: 0;
}

/* 제품 상세: 좌측 분류 메뉴 */
.prd-view-cl-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prd-view-cl-all {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--jitech-border);
    color: #555;
    text-decoration: none;
    font-weight: 600;
}
.prd-view-cl-all:hover,
.prd-view-cl-all.active {
    color: var(--jitech-blue);
}
.prd-view-cl-group {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--jitech-border);
}
.prd-view-cl-tier1 {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--jitech-dark);
    text-decoration: none;
    margin-bottom: 6px;
}
.prd-view-cl-tier1:hover,
.prd-view-cl-tier1.active {
    color: var(--jitech-blue);
}
.prd-view-cl-tier2 {
    list-style: none;
    margin: 0;
    padding: 0 0 0 4px;
}
.prd-view-cl-tier2 li {
    margin: 4px 0;
}
.prd-view-cl-tier2 a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.prd-view-cl-tier2 a:hover,
.prd-view-cl-tier2 a.active {
    color: var(--jitech-blue);
    font-weight: 700;
}

.prd-sidebar h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--jitech-dark);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--jitech-dark);
    margin-bottom: 0;
    text-transform: uppercase;
}
.prd-side-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.prd-side-menu li a {
    display: block;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-weight: 700;
    padding: 15px 0;
}
.prd-side-menu li a:hover,
.prd-side-menu li a.active {
    color: var(--jitech-blue);
    font-weight: 700;
}

.prd-content {
    flex-grow: 1;
    padding-top: 20px;
}

/* 제품 분류 소개(관리자 에디터 HTML) */
.prd-cl-intro--tier1-above {
    margin-bottom: 20px;
}
.prd-cl-intro img {
    max-width: 100%;
    height: auto;
}
.prd-cl-intro p:last-child {
    margin-bottom: 0;
}

/* 2차 분류: 카드 그리드 — 열 수 = 2차 개수 (--prd-cl-tier2-count, index.php에서 설정) */
.prd-cl-tier2-cards {
    --prd-cl-tier2-count: 1;
    display: grid;
    grid-template-columns: repeat(var(--prd-cl-tier2-count), minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 900px) {
    .prd-cl-tier2-cards {
        grid-template-columns: repeat(min(2, var(--prd-cl-tier2-count)), minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .prd-cl-tier2-cards {
        grid-template-columns: 1fr;
    }
}
.prd-cl-subcard {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--jitech-border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.prd-cl-subcard:hover {
    border-color: var(--jitech-blue);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}
.prd-cl-subcard.is-active {
    border-color: var(--jitech-blue);
    box-shadow: 0 0 0 2px rgba(33, 120, 200, 0.2);
}
.prd-cl-subcard-title {
    margin: 0;
    padding: 16px 18px 12px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    border-bottom: 1px solid var(--jitech-border);
    background: linear-gradient(to bottom, #fafbfc, #fff);
}
.prd-cl-subcard-title a {
    color: var(--jitech-dark);
    text-decoration: none;
}
.prd-cl-subcard-title a:hover {
    color: var(--jitech-blue);
}
.prd-cl-subcard.is-active .prd-cl-subcard-title a {
    color: var(--jitech-blue);
}
.prd-cl-subcard-body {
    padding: 16px 18px 18px;
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.65;
    color: #444;
    word-break: break-word;
    min-height: 0;
}
.prd-cl-subcard-body img {
    max-width: 100%;
    height: auto;
}
.prd-cl-subcard-body p:last-child {
    margin-bottom: 0;
}
.prd-cl-subcard[role='button'] {
    cursor: pointer;
}
.prd-cl-subcard[role='button']:focus-visible {
    outline: 2px solid var(--jitech-blue);
    outline-offset: 2px;
}

.prd-list-mount {
    position: relative;
    min-height: 40px;
}
.prd-list-mount.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.prd-list-tier3-title {
    margin: 28px 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--jitech-dark);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--jitech-border);
}
.prd-list-inner > .prd-list-tier3-title:first-child {
    margin-top: 0;
}
.prd-list-inner .prd-list-grid {
    margin-bottom: 8px;
}
.prd-list-inner .prd-list-grid:last-child {
    margin-bottom: 0;
}
.prd-list-empty[hidden] {
    display: none !important;
}
.prd-list-empty-inner {
    padding: 80px 20px;
    text-align: center;
    color: #999;
    border: 1px dashed #ddd;
    border-radius: 12px;
}

/* Search Bar */
.prd-search-box {
    margin-bottom: 30px;
    display: flex;
    justify-content: flex-end;
}
.prd-search-box form {
    display: flex;
    border: 1px solid var(--jitech-border);
    border-radius: 4px;
    overflow: hidden;
}
.prd-search-box input {
    border: none;
    padding: 8px 15px;
    width: 200px;
    outline: none;
}
.prd-search-box button {
    background: var(--jitech-dark);
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}

/* Grid Layout */
.prd-list-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.prd-item-card {
    border: 1px solid var(--jitech-border);
    transition: border-color 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}
button.prd-item-card {
    font: inherit;
    font-family: inherit;
    text-align: left;
    background: #fff;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
button.prd-item-card:focus-visible {
    outline: 2px solid var(--jitech-blue);
    outline-offset: 2px;
}
.prd-item-card:hover {
    border-color: var(--jitech-blue);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.prd-item-img {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}
.prd-item-img img {
    width: 100%;
    transition: transform 0.3s;
}
.prd-item-card:hover .prd-item-img img {
    transform: scale(1.05);
}
.prd-item-info {
    padding: 20px;
    flex-grow: 1;
}
.prd-item-name {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--jitech-dark);
    margin-bottom: 10px;
}
.prd-item-summary {
    font-size: 14px;
    color: var(--jitech-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* View Page Styling */
.prd-view-top {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
}
.prd-view-image {
    width: 450px;
    flex-shrink: 0;
}
.prd-view-image .main-img {
    border: 1px solid var(--jitech-border);
    margin-bottom: 15px;
}
.prd-view-image .main-img img {
    width: 100%;
    display: block;
}
.prd-view-info {
    flex-grow: 1;
}
.prd-view-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--jitech-dark);
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--jitech-border);
}

.prd-view-table {
    width: 100%;
    border-top: 2px solid var(--jitech-dark);
    border-collapse: collapse;
}
.prd-view-table th, .prd-view-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--jitech-border);
    font-size: 14px;
}
.prd-view-table th {
    background: #f8f9fa;
    width: 140px;
    text-align: left;
    color: #555;
}

.prd-section {
    margin-top: 60px;
}
.prd-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--jitech-dark);
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--jitech-blue);
}
.prd-description {
    line-height: 1.8;
    color: #444;
}

.prd-hazard-flags {
    margin: 0;
    padding-left: 1.25em;
    line-height: 1.7;
    color: #444;
}
.prd-msds-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}
.prd-msds-list a {
    color: var(--jitech-blue);
    font-weight: 600;
    text-decoration: none;
}
.prd-msds-list a:hover {
    text-decoration: underline;
}

.prd-bottom-btns {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.prd-btn-list {
    display: inline-block;
    padding: 12px 40px;
    background: var(--jitech-dark);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
}

/* Gallery Styling */
.prd-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.prd-gallery a {
    display: block;
    border: 1px solid var(--jitech-border);
    overflow: hidden;
    aspect-ratio: 1;
}
.prd-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.prd-gallery a:hover img {
    transform: scale(1.1);
}

/* Gallery Modal */
body.prd-gallery-lock {
    overflow: hidden;
}

.prd-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.prd-gallery-modal.is-open {
    display: flex;
}

.prd-gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.prd-gallery-modal.is-open .prd-gallery-modal-backdrop {
    opacity: 1;
}

.prd-gallery-modal-inner {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 1;
}

.prd-gallery-modal.is-open .prd-gallery-modal-inner {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.prd-gallery-modal-imgwrap {
    width: 100%;
    max-height: 90vh;
}

.prd-gallery-modal-imgwrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.prd-gallery-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

.prd-gallery-modal-close:hover {
    background: rgba(0,0,0,0.85);
}

/* Responsive */
@media (max-width: 1024px) {
    .prd-main-layout {
        flex-direction: column;
    }
    .prd-sidebar {
        width: 100%;
    }
    .prd-side-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 15px;
    }
    .prd-side-menu li {
        flex: 1 1 calc(50% - 10px);
    }
    .prd-side-menu li a {
        padding: 10px 15px;
        border: 1px solid var(--jitech-border);
        background: #fdfdfd;
        text-align: center;
    }
    .prd-side-menu li a.active {
        background: var(--jitech-blue);
        color: white;
        border-color: var(--jitech-blue);
    }
    .prd-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .prd-view-top {
        flex-direction: column;
    }
    .prd-view-image {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .prd-list-grid {
        grid-template-columns: 1fr;
    }
    .prd-side-menu li {
        flex: 1 1 100%;
    }
    .prd-header-title h1 {
        font-size: 28px;
    }
}

/* 비동기 제품 리스트 상단에 붙는 Bio Solvents 표 등 */
.prd-list-async-extra--bio-spec {
    margin-bottom: 8px;
}
#prd_list_inner > .prd-list-async-extra--bio-spec:first-child .prd-bio-solvents-table-wrap {
    margin-top: 0;
}

/* Bio Solvents(cl_id=13 대응) 스펙 표 */
.prd-bio-solvents-table-wrap {
    margin: 20px 0 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.prd-cl-subcard-body .prd-bio-solvents-table-wrap {
    margin-top: 16px;
    margin-bottom: 0;
}
.prd-bio-solvents-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.45;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    color: #333;
}
.prd-bio-solvents-table thead tr {
    background: #e8e8e8;
}
.prd-bio-solvents-table th,
.prd-bio-solvents-table td {
    border: 1px solid #c8c8c8;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.prd-bio-solvents-table thead th {
    font-weight: 700;
}
.prd-bio-solvents-table tbody th[scope="row"] {
    font-weight: 700;
    background: #fafafa;
    white-space: nowrap;
}

/* 제품 목록 상세 팝업 */
.prd-list-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.prd-list-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.prd-list-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}
.prd-list-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    max-height: min(88vh, 900px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.prd-list-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--jitech-dark);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.prd-list-modal-close:hover {
    color: var(--jitech-blue);
}
.prd-list-modal-scroll {
    overflow-y: auto;
    padding: 28px 24px 32px;
    -webkit-overflow-scrolling: touch;
}

/* 상단: 왼쪽 텍스트·스펙 / 오른쪽 대표 이미지 */
.prd-list-modal-top {
    display: grid;
    grid-template-columns: 1fr minmax(200px, 300px);
    gap: 28px;
    align-items: start;
    margin-bottom: 8px;
}
.prd-list-modal-col-left {
    min-width: 0;
}
.prd-list-modal-col-right {
    min-width: 0;
}
.prd-list-modal-media {
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prd-list-modal-media:empty {
    display: none;
}
.prd-list-modal-col-right--empty {
    display: none;
}
.prd-list-modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.prd-list-modal-title {
    margin: 0 40px 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--jitech-dark);
    line-height: 1.35;
}
.prd-list-modal-class {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--jitech-muted);
}
.prd-list-modal-class:empty {
    display: none;
}
.prd-list-modal-summary {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}
.prd-list-modal-summary:empty {
    display: none;
}
.prd-list-modal-specs {
    margin: 0 0 16px;
}
.prd-list-modal-specs:empty {
    display: none;
}
.prd-list-modal-specs table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.prd-list-modal-specs th,
.prd-list-modal-specs td {
    border: 1px solid var(--jitech-border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.prd-list-modal-specs th {
    width: 32%;
    background: #fafafa;
    font-weight: 600;
    color: var(--jitech-dark);
}
.prd-list-modal-desc {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
    word-break: break-word;
    margin-top: 4px;
}
.prd-list-modal-desc:empty {
    display: none;
}

/* Hazard Symbol 행 */
.prd-list-modal-hazard {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--jitech-border);
}
.prd-list-modal-hazard[hidden] {
    display: none !important;
}
.prd-list-modal-hazard-label {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--jitech-dark);
}
.prd-list-modal-hazard-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: flex-start;
}
.prd-list-modal-hazard-fig {
    margin: 0;
    text-align: center;
    max-width: 88px;
}
.prd-list-modal-hazard-fig img {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 6px;
    object-fit: contain;
}
.prd-list-modal-hazard-fig figcaption {
    font-size: 12px;
    line-height: 1.35;
    color: var(--jitech-muted);
    word-break: keep-all;
}

/* MSDS 다운로드 + 문의하기 */
.prd-list-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--jitech-border);
}
.prd-list-modal-msds-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}
.prd-list-modal-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--jitech-dark);
    background: #f4f6f8;
    border: 1px solid var(--jitech-border);
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.prd-list-modal-btn-download:hover {
    background: #eef4ff;
    border-color: var(--jitech-blue);
    color: var(--jitech-blue);
}
.prd-list-modal-btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--jitech-blue);
    border: 2px solid var(--jitech-blue);
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    transition: filter 0.2s, box-shadow 0.2s;
}
.prd-list-modal-btn-contact:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 14px rgba(0, 80, 180, 0.25);
    color: #fff;
}
body.prd-list-modal-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
    /* top은 JS에서 scrollY 만큼 음수로 설정해 열 때 스크롤 튐 방지 */
}

@media (max-width: 640px) {
    .prd-list-modal-top {
        grid-template-columns: 1fr;
    }
    .prd-list-modal-col-right {
        order: -1;
    }
    .prd-list-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .prd-list-modal-btn-contact {
        margin-left: 0;
        width: 100%;
        box-sizing: border-box;
    }
    .prd-list-modal-msds-btns {
        width: 100%;
    }
    .prd-list-modal-btn-download {
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        box-sizing: border-box;
    }
}
