/* BASIC css start */
/* --- THE LAB CHEMICAL - Mobile Product Detail Theme --- */
/* Designed by Gemini (Final Version) */

/* 1. THEME & COLOR PALETTE 🎨 */
:root {
    --brand-primary: #5F3DC4;      /* 메인 브랜드 색상 (진한 퍼플) */
    --brand-secondary: #364FC7;     /* 보조 브랜드 색상 (진한 블루) */
    --brand-light-purple: #F3F0FF; /* 은은한 퍼플 배경 */
    --brand-light-blue: #E7F5FF;   /* 은은한 블루 배경 */
    --text-main: #212529;           /* 기본 텍스트 */
    --text-subtle: #868E96;         /* 보조 텍스트 (연한 회색) */
    --surface-bg: #F8F9FA;          /* 카드, 섹션 배경 (밝은 회색) */
    --border-color: #E9ECEF;        /* 테두리 색상 */
    --white: #FFFFFF;
    --black: #000000;
}

/* 2. BASE & RESET */
body, html {
    margin: 0; padding: 0; width: 100%;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--white);
    color: var(--text-main);
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* 3. MAIN LAYOUT & HIDE UNUSED */
#container { max-width: 480px; margin: 0 auto; }
main.shopdetail { padding: 16px; }

.page_location, .prd-wish, .shopdetailInfoValue, .shopdetailButton .wish,
.shopdetailButtonBottom, .shopdetailItemPopup, #quick-swipepay, .fixed-btn, .buy_on {
    display: none !important;
}

/* 4. RE-ORDERING & STYLING PRODUCT INFO */
.shopdetailInfo {
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* 상품정보 영역: Flexbox를 이용해 순서 재배치 */
.shopdetailInfo {
    display: flex;
    flex-direction: column;
    align-items: center; /* 자식 요소들을 가운데 정렬 */
    text-align: center;
}

/* [순서 1] 썸네일 */
.shopdetailInfo .shopdetailInfoTop {
    order: 1; /* 첫 번째로 표시 */
    width: 160px;
    margin: 0 auto 16px auto;
}
.shopdetailInfoTop figure {
    width: 100%;
    position: relative;
}
.shopdetailInfoTop img.detail_image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* [순서 2] 상품명 */
.shopdetailInfo h2 {
    order: 2; /* 두 번째로 표시 */
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* [순서 3] Subname */
.product-subname {
    order: 3; /* 세 번째로 표시 */
    font-size: 14px;
    font-weight: 400;
    color: var(--text-subtle);
    margin-bottom: 24px;
}

/* [순서 4] SKU 옵션 */
.shopdetailInfo .shopdetailInfoBottom { order: 4; width: 100%; display: flex; flex-direction: column; }
.option_area { display: block !important; }

.shopdetailInfoOneclick {
    display: block !important; text-align: left; padding: 16px;
    background-color: var(--surface-bg); border-radius: 12px; margin-bottom: 16px;
}
.shopdetailInfoOneclick .shopdetailInfoName {
    font-size: 14px; font-weight: 600; color: var(--text-main);
    margin-bottom: 12px; display: block;
}
.shopdetailInfoOneclick .MK-oneclick-list { display: flex; flex-wrap: wrap; gap: 10px; }
.shopdetailInfoOneclick .MK-oneclick-link {
    display: block; padding: 9px 16px; font-size: 14px; font-weight: 500;
    border: 1.5px solid var(--border-color); background-color: var(--white);
    border-radius: 8px; transition: all 0.2s ease-in-out; cursor: pointer;
}
.shopdetailInfoOneclick .MK-oneclick-link:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.shopdetailInfoOneclick .MK-oneclick-link.selected {
    border-color: var(--brand-primary);
    background: linear-gradient(135deg, var(--brand-light-purple), var(--brand-light-blue));
    color: var(--brand-primary); font-weight: 700;
}

/* ✨ 4.5. 선택된 옵션 스타일 (새로 추가) */
ul.MK_inner-opt-cm {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}
ul.MK_inner-opt-cm li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    background-color: var(--brand-light-purple);
    border-radius: 8px;
    margin-bottom: 8px;
}
.MK_p-name {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    color: var(--brand-primary);
}
.MK_qty-ctrl {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.MK_qty-ctrl input {
    width: 32px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--white);
    -moz-appearance: textfield;
}
.MK_qty-ctrl input::-webkit-outer-spin-button,
.MK_qty-ctrl input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.MK_qty-ctrl a.btn-type-02 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 30px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-subtle);
}
.MK_qty-ctrl span { display: none; } /* +1, -1 텍스트 숨기기 */
.MK_qty-ctrl a.btn-type-02:first-of-type::before { content: "+"; } /* 아이콘처럼 보이게 */
.MK_qty-ctrl a.btn-type-02:last-of-type::before { content: "-"; }

.MK_price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}
a.MK_btn-del img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* [순서 4] 총 상품 금액 */
#MK_innerOptTotal {
    text-align: right;
    margin: 16px 0 24px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
#MK_innerOptTotal .MK_txt-total {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-subtle);
    margin-right: 12px;
}
#MK_innerOptTotal .MK_total {
    font-size: 26px;
    font-weight: 700;
    color: var(--brand-primary);
}
#MK_innerOptTotal .MK_txt-won {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-primary);
    margin-left: 3px;
}

/* [순서 5] 구매/장바구니 버튼 */
.shopdetailButton {
    display: block !important;
    width: 100%;
}
.shopdetailButton .btn-wrap {
    display: flex !important;
    gap: 10px;
}
.shopdetailButton .btn-wrap a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    transition: all 0.2s ease;
}
.shopdetailButton .cart {
    background-color: var(--white);
    color: var(--brand-secondary);
    border: 1.5px solid var(--border-color);
}
.shopdetailButton .cart:hover {
    border-color: var(--brand-secondary);
    background-color: var(--surface-bg);
}
.shopdetailButton .buy {
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(95, 61, 196, 0.2);
}
.shopdetailButton .buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(95, 61, 196, 0.3);
}

/* ======================================================= */
/* ✨ 불필요한 빈 공간 제거용 CSS (이 코드를 추가해주세요) ✨ */
/* ======================================================= */

/* 내용이 없는 .shopdetailInfoSelect 태그는 화면에서 완전히 숨김 */
.shopdetailInfoSelect:empty {
    display: none;
}

/* 선택된 옵션이 없을 때, 옵션 목록(ul)과 그 주변의 불필요한 여백을 모두 제거 */
.MK_inner-opt-cm:empty {
    display: none;
}

/* 총 가격을 감싸는 영역에 불필요한 여백이 생기지 않도록 처리 */
#MK_innerOptWrap.total:empty {
	display: none;
}

/* 옵션이 추가되는 영역 자체도 비어있으면 숨김 */
#MK_innerOptScroll:has(:not(ul:empty)) + #MK_innerOptTotal {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
/* ======================================================= */
/* ✨ 정보 패널 (이미지 대체) 스타일 - Grid 레이아웃 적용 ✨ */
/* ======================================================= */
.info-panel {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--white);
    margin-top: 32px;
    overflow: hidden;
}

.info-header {
    padding: 24px;
    background-color: var(--white);
}

.logo-text {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.contact-list {
    list-style: none;
    padding: 0;
    font-size: 14px;
    /* ★★★ Grid 레이아웃으로 변경 */
    display: grid;
    grid-template-columns: auto 1fr; /* [라벨] [내용] 2단 구조 */
    gap: 16px 12px; /* 행, 열 간격 */
    align-items: center; /* 수직 중앙 정렬 */
}

.contact-list .label {
    font-weight: 600;
    color: var(--text-main);
}

.contact-list .content {
    color: var(--text-subtle);
    font-weight: 500;
}

.contact-list a, .contact-list strong {
    font-weight: 600;
    color: var(--text-main);
}

.contact-list a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 이하 info-section 스타일은 이전과 동일 */
.info-section {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.info-panel .info-section:last-child {
    border-bottom: none;
}

.info-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.info-section h3::before {
    content: 'i';
    font-style: italic;
    font-weight: bold;
    font-family: serif;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background-color: var(--brand-light-purple);
    color: var(--brand-primary);
    margin-right: 8px;
}

.info-section ol {
    padding-left: 28px;
    font-size: 14px;
    line-height: 1.9;
    color: #555;
    list-style: none; /* 기본 숫자 제거 */
    counter-reset: info-counter; /* 카운터 초기화 */
}

.info-section li {
    position: relative;
    padding-bottom: 8px;
    counter-increment: info-counter; /* 숫자 1씩 증가 */
}
.info-section li::before {
    content: counter(info-counter) "."; /* 카운터 표시 */
    position: absolute;
    left: -28px;
    font-weight: 600;
    color: var(--brand-primary);
}

.info-section .highlight {
    font-weight: 600;
    color: var(--brand-secondary);
}

.info-section a {
    font-weight: 600;
    color: var(--brand-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- 5.2. Product Details (More Engaging) --- */
.shopdetailItem {
    padding: 32px 0;
    line-height: 1.8;
    font-size: 15px;
}

/* 상세정보 콘텐츠의 기본 스타일 통일 */
.shopdetailImage * {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    font-family: inherit !important;
    font-size: 15px !important;
    background: none !important;
    color: var(--text-main) !important;
}

/* '제품 상세 정보' 타이틀 스타일 */
.shopdetailImage > div:first-child {
    padding: 14px 16px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--brand-secondary) !important;
    border-bottom: 2px solid var(--brand-secondary) !important;
    margin-bottom: 0 !important;
    background: linear-gradient(to right, var(--brand-light-blue), var(--white)) !important;
}

/* 상세정보 테이블 스타일 */
.shopdetailImage table {
    border: none !important;
    border-radius: 0 0 12px 12px !important; /* 타이틀과 이어지도록 아래쪽에만 radius */
    overflow: hidden;
    border-collapse: collapse !important;
    border-spacing: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.shopdetailImage td {
    padding: 14px 16px !important;
    text-align: left;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.shopdetailImage tr:last-child td {
    border-bottom: none !important;
}
/* 테이블의 제목 셀(th 역할) */
.shopdetailImage td[style*="font-weight:bold"] {
    background-color: var(--white) !important;
    width: 120px !important;
    font-weight: 600 !important;
}
/* 테이블 행에 교차로 색상 부여 (Zebra Striping) */
.shopdetailImage tr:nth-child(even) td {
    background-color: var(--surface-bg) !important;
}

/* MSDS 바로가기 버튼 스타일 */
.shopdetailImage a[style*="background:#223a7a"] {
    display: inline-flex !important; /* 아이콘 정렬을 위해 flex로 변경 */
    align-items: center;
    gap: 6px;
    width: auto !important;
    padding: 8px 14px !important;
    background-color: var(--brand-primary) !important;
    border-radius: 6px !important;
    color: var(--white) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}
.shopdetailImage a[style*="background:#223a7a"]:hover {
    background-color: var(--brand-secondary) !important;
    transform: translateY(-2px);
}

/* 하단의 안내문구 스타일 */
.shopdetailImage div[style*="text-align:center"] {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background-color: var(--surface-bg);
    margin-top: 32px !important;
}
/* BASIC css end */

