/* ==========================================================================
   PAGE: MALL VIEW (상품 상세 - 상단 리뉴얼)
   ========================================================================== */

/* --- 0. 레이아웃 초기화 (Legacy Reset) --- */
/* 기존 솔루션의 강제 너비/여백 제거하고 모던하게 재설정 */
.ttery_product-detail {
    width: 100%;
    max-width: var(--w-container);
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.detailArea {
    display: flex;
    flex-wrap: wrap; /* 반응형 대비 */
    gap: 50px;       /* 이미지와 정보 사이 간격 */
    align-items: flex-start;
}

/* --- 1. 좌측 이미지 영역 (Gallery) --- */
.imgArea {
    width: 500px;    /* 이미지 영역 너비 고정 (안정감) */
    flex-shrink: 0;  /* 줄어들지 않게 */
    position: sticky; /* 스크롤 시 따라오게 (선택사항) */
    top: 100px;
}

/* 메인 이미지 박스 */
.keyImg {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f7f7f7; /* 이미지가 없을 때 배경 */
    border: 1px solid #eee;
    margin-bottom: 12px;
}

.keyImg img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1/1; /* 정사각형 비율 유지 */
    object-fit: cover;
}

/* 줌 렌즈 및 결과 (JS 기능용 스타일) */
.zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 100px; height: 100px;
    background-color: rgba(255, 255, 255, 0.4);
    display: none; cursor: crosshair;
}
.zoom-result {
    border: 1px solid #d4d4d4;
    width: 500px; height: 500px;
    position: absolute; top: 0; left: 105%; /* 이미지 오른쪽 */
    z-index: 1000; display: none; background-repeat: no-repeat; background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 썸네일 리스트 */
.subThumb {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 한 줄에 6개 */
    gap: 8px;
}
.subThumb .thumbnail {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    opacity: 0.7;
    transition: 0.2s;
    aspect-ratio: 1/1;
}
.subThumb .thumbnail:hover {
    border-color: var(--c-primary);
    opacity: 1;
}
.subThumb img {
    width: 100%; height: 100%; object-fit: cover;
}


/* --- 2. 우측 정보 영역 (Info) --- */
.infoArea {
    flex: 1;
    min-width: 0;
}

/* 브랜드(공급업체) 라인 */
.prod-brand-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.prod-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    letter-spacing: -0.3px;
}

.prod-title-badges {
    display: flex; gap: 5px; flex-wrap: wrap;
}
.badge-chip {
    font-size: 11px; padding: 3px 8px; border-radius: 3px; font-weight: 600; letter-spacing: -0.3px;
}

/* 키워드 태그 */
.prod-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding: 0 4px;
}
.keyword-tag {
    font-size: 13px;
    color: #6ca041;
    background: #f2f8ed;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.keyword-tag:hover {
    background: #e4f0d9;
    color: #4a7a29;
}

/* 가격 영역 (테이블 밖 독립) */
.price-area {
    padding: 20px 0 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}
.price-original {
    font-size: 15px;
    color: #aaa;
    text-decoration: line-through;
    display: block;
    margin-bottom: 4px;
}
.price-main-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.price-discount-rate {
    font-size: 32px;
    font-weight: 800;
    color: #fa622f;
    letter-spacing: -1px;
}
.price-current {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
}
.price-coupon-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}
.price-coupon-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #e74c3c;
    padding: 2px 6px;
    border-radius: 3px;
}
.price-coupon-value {
    font-size: 18px;
    font-weight: 800;
    color: #e74c3c;
}
.price-coupon-detail {
    font-size: 13px;
    color: #e74c3c;
    font-weight: 500;
}

/* 리뷰포인트 */
.review-point-info {
    font-size: 14px;
    color: #6ca041;
    font-weight: 600;
}



.ttery_product-detaildesign th, 
.ttery_product-detaildesign td {
    padding: 20px 0; /* 여백을 더 넉넉하게 */
    border: none !important;
    border-bottom: 1px solid #f5f5f5 !important; /* 더 연한 구분선 */
    text-align: left;
    vertical-align: middle;
    transition: background 0.2s ease;
}

.ttery_product-detaildesign th {
    width: 140px; /* 너비 약간 증가 */
    vertical-align: top;
    padding-top: 22px;
}

.ttery_product-detaildesign th span {
    font-size: 13px !important;
    color: #999 !important; /* 더 연한 회색 */
    font-weight: 500;
    letter-spacing: -0.3px;
}

/* 내용 (td) */
.ttery_product-detaildesign td span {
    font-size: 15px !important;
    color: #222 !important; /* 더 진한 검정 */
    line-height: 1.7;
    font-weight: 400;
}

.ttery_product-detaildesign tr:last-child th,
.ttery_product-detaildesign tr:last-child td {
    border-bottom: none !important;
}

/* 강조 행 스타일 (판매가, 쿠폰할인가 등) */
.ttery_product-detaildesign tr:has(#span_product_price_text),
.ttery_product-detaildesign tr:has(.coupon_sale_box) {
    background: linear-gradient(to right, #fafcff, #fff);
}

/* 호버 효과 */
.ttery_product-detaildesign tr:hover {
    background: #fafafa;
}

/* 6. 판매가/할인가 텍스트 크기 강조 */
#span_product_price_text {
    font-size: 26px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sale_box { /* 할인율 */
    font-size: 24px !important;
    color: var(--c-point) !important;
    font-weight: 700;
    margin-right: 0;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    color: #fff !important;
    margin-left: 0 !important;
    order: -1;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    letter-spacing: -0.5px;
}

/* 쿠폰 할인 박스 */
.coupon_sale_box {
    font-size: 14px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 15px !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    letter-spacing: -0.3px;
}

/* 소비자가(정가) 취소선 */
.ttery_product-detaildesign strike {
    color: #bbb; 
    text-decoration: line-through; 
    font-size: 16px;
    opacity: 0.7;
}

/* 쿠폰 팝업 버튼 */
.btn-coupon-open {
    height: 34px;
    padding: 0 16px;
    border: 2px solid var(--c-primary);
    color: var(--c-primary);
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: -0.3px;
}
.btn-coupon-open:hover {
    background: var(--c-primary); 
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* --- 3. 옵션 선택 영역 (Option) --- */
.product-option-wrapper {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    margin-top: 24px;
}

/* 셀렉트 박스 */
.select-wrapper select {
    width: 100%;
    height: 48px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 15px;
    color: #333;
    outline: none;
    background: #fff;
    cursor: pointer;
    font-weight: 400;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
.select-wrapper select:focus {
    border-color: #999;
}

/* 선택된 옵션 박스 (JS로 추가되는 부분) */
.selected-option {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 16px;
    margin-top: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.option-info { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}
.option-name { 
    font-size: 14px; 
    color: #333; 
    font-weight: 500;
}
.option-price { 
    font-size: 15px; 
    color: #4CAF50; 
    font-weight: 700;
}

/* 수량 조절 버튼 */
.qty-control {
    display: flex; 
    align-items: center; 
    border: 1px solid #ddd; 
    border-radius: 4px;
    margin: 0 12px; 
    background: #fff;
    overflow: hidden;
}
.qty-control button {
    width: 32px; 
    height: 32px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: #f5f5f5; 
    color: #333; 
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.qty-control input {
    width: 50px; 
    height: 32px;
    border: none; 
    border-left: 1px solid #ddd; 
    border-right: 1px solid #ddd;
    text-align: center; 
    font-size: 14px;
    font-weight: 600;
    color: #111;
}
.qty-control input:focus {
    outline: none;
}

/* 삭제 버튼 (X) */
.remove-btn { 
    cursor: pointer; 
    color: #999; 
    font-size: 18px; 
    padding: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 총 합계 */
.option-summary-total {
    margin-top: 16px;
    padding: 16px 0;
    border-top: 2px solid #e8e8e8;
    display: flex;
    justify-content: end;
    gap:10px;
    align-items: center;
    font-size: 15px;
    color: #666;
    font-weight: 500;
}
.option-summary-total #optionTotalPrice {
    font-size: 24px;
    color: #4CAF50;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.option-summary-total #optionTotalCount {
    font-weight: 600;
    color: #333;
}


/* --- 4. 하단 고정 액션바 & 버튼 (Action) --- */
/* PC 버전 버튼 */
.productAction .action_button {
    display: flex; gap: 10px; margin-top: 20px;
}

/* 주문하기 버튼 */
.orderBtn {
    flex: 1;
    height: 56px;
    background: #5cb85c;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    letter-spacing: -0.3px;
}


/* 모바일 하단 고정바 (PC에선 숨김) */
.fixed-action-bar { display: none; }


/* --- 5. 반응형 (Mobile) --- */
@media (max-width: 1024px) {
    .detailArea {
        flex-direction: column; /* 세로 배치 */
        gap: 30px;
    }
    
    .imgArea {
        width: 100%; /* 꽉 차게 */
        position: static;
    }

    /* 테이블 폰트 조절 */
    .headingArea h1 { font-size: 20px; }
    .ttery_product-detaildesign th { width: 80px; }
    #span_product_price_text { font-size: 20px !important; }
    .sale_box { font-size: 24px !important; }

    /* 모바일 가격 */
    .price-discount-rate,
    .price-current { font-size: 26px; }
    .price-coupon-value { font-size: 16px; }

    /* 모바일 키워드 */
    .prod-keywords { margin-top: 10px; }
    .keyword-tag { font-size: 12px; padding: 3px 8px; }

    /* 모바일 하단 고정바 활성화 */
    .fixed-action-bar {
        display: block;
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: #fff; border-top: 1px solid #eee;
        padding: 10px 15px; z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    .fixed-action-area .action_button { display: flex; gap: 8px; }
    .fixed-action-area .orderBtn { height: 48px; font-size: 16px; margin: 0; }
    .fixed-action-area #actionCart {
        width: 100px;
        background: var(--c-primary);
        color: #fff;
        font-size: 18px;
        font-weight: 700;
        border-radius: 6px; }
    /* 장바구니 텍스트 대신 아이콘만 보이게 처리 가능 */
    
    /* 본문 내 버튼 숨김 (고정바가 있으므로) */
    .productAction { display: none; }
    
    /* 컨텐츠 하단 여백 확보 (고정바 가림 방지) */
    body { padding-bottom: 70px; }

    /* 모바일 탭 */
    .tabs { top: 0; } /* 모바일: header-nav가 숨겨질 수 있음 */
    .tab_menu li,
    .tab_menu li a,
    .tab_menu li button.tab-inquiry-btn {
        height: 44px;
        font-size: 13px;
    }
}





/* ==========================================================================
   PAGE: MALL VIEW (상품 상세 통합 리뉴얼)
   ========================================================================== */

/* [핵심] 전체 컨테이너 중앙 정렬 & 너비 제한 (이게 안 돼서 퍼져 보였던 것) */
.mall_main .product_detail_b2b,
.ttery_product-detail {
    width: 100%;
    max-width: var(--w-container) !important; /* 1100px 강제 적용 */
    margin: 0 auto;
    /*padding: 0 0px;*/
    box-sizing: border-box;
}

/* --- 1. 상단 레이아웃 (이미지 vs 정보) --- */
.detailArea {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    margin-top: 50px;
    padding-bottom: 60px;
}

/* 좌측 이미지 */
.imgArea {
    width: 500px; /* 너비 고정 */
    flex-shrink: 0;
}
.keyImg {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    aspect-ratio: 1/1;
}
.keyImg img { width: 100%; height: 100%; object-fit: cover; }

/* 썸네일 */
.subThumb { display: flex; gap: 8px; overflow-x: auto; }
.subThumb .thumbnail {
    width: 70px; height: 70px; border-radius: 4px; overflow: hidden;
    border: 1px solid transparent; cursor: pointer; opacity: 0.6;
}
.subThumb .thumbnail:hover { opacity: 1; border-color: var(--c-primary); }
.subThumb img { width: 100%; height: 100%; object-fit: cover; }

/* 우측 정보 */
.infoArea { flex: 1;
    min-width: 0;
    width: 100%;
    max-width: var(--w-container) !important;
    margin: 0 auto;
    box-sizing: border-box; }

.headingArea h1 { font-size: 24px; font-weight: 600; color: #111; margin-bottom: 0; line-height: 1.35; letter-spacing: -0.5px; }

/* --- 2. 정보 테이블 (가로선 스타일로 강제 변경) --- */
/* 기존의 격자무늬(border=1)를 CSS로 덮어씌움 */
.ttery_product-detaildesign table,
.option-view-popup-table,
.policy-table {
    width: 100%;
    border-collapse: collapse;
    border: 0 !important;
}

.ttery_product-detaildesign th, .ttery_product-detaildesign td,
.option-view-popup-table th, .option-view-popup-table td,
.policy-table th, .policy-table td {
    border: 0 !important;
    padding: 6px 0;
    text-align: left;
    vertical-align: middle;
}

/* 항목명 스타일 */
.ttery_product-detaildesign th,
.policy-table th {
    width: 120px;
    color: #888;
    font-weight: 400;
}
.ttery_product-detaildesign td,
.policy-table td {
    color: #333;
}

/* 가격 폰트 (레거시 호환) */
#span_product_price_text { font-size: 28px; font-weight: 800; color: #111; }
.sale_box { font-size: 20px !important; color: #e74c3c !important; font-weight: 700; margin-left: 0; margin-right: 10px; }


/* --- 3. 옵션 및 버튼 --- */
.product-option-wrapper {
    background: #fafafa; border: 1px solid #eee; padding: 20px; border-radius: 8px; margin-top: 30px;
}
.select-wrapper select {
    width: 100%; height: 45px; border: 1px solid #ddd; padding: 0 10px; border-radius: 4px;
}
.selected-option {
    background: #fff; border: 1px solid #ddd; padding: 15px; margin-top: 10px; border-radius: 4px;
    display: flex; justify-content: space-between; align-items: center;
}
.qty-control { display: flex; border: 1px solid #ddd; }
.qty-control button { width: 30px; height: 30px; background: #f8f8f8; }
.qty-control input { width: 40px; text-align: center; border: 0; border-left: 1px solid #ddd; border-right: 1px solid #ddd; }

/* 구매 버튼 */
.productAction .action_button { display: flex; gap: 10px; margin-top: 20px; }
.orderBtn {
    flex: 1; height: 56px; background: var(--c-primary); color: #fff;
    font-size: 18px; font-weight: 700; border-radius: 6px;
}
#actionCart {
    width: 180px; height: 56px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 12px; color: #555;
}


/* --- 4. 탭 메뉴 (Sticky + 참고사이트 디자인) --- */
.img_tab_menu {
    /* sticky가 작동하려면 부모가 충분히 커야 함 */
    position: relative;
}

.tabs {
    position: sticky;
    top: 0; 
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    margin-top: 0;
    transition: box-shadow 0.2s ease;
}
.tabs.is-stuck {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tab_menu {
    display: flex;
    max-width: var(--w-container);
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
.tab_menu li {
    flex: 1;
    text-align: center;
    position: relative;
}
.tab_menu li,
.tab_menu li a,
.tab_menu li button.tab-inquiry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    background: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: -0.3px;
    padding: 0;
    margin: 0;
}
.tab_menu li:hover,
.tab_menu li:hover a,
.tab_menu li:hover button.tab-inquiry-btn {
    color: #333;
}

/* 활성 탭 — 밑줄(underline) 스타일 */
.tab_menu li.on {
    color: #111;
    font-weight: 700;
}
.tab_menu li.on a,
.tab_menu li.on button.tab-inquiry-btn {
    color: #111;
    font-weight: 700;
}
.tab_menu li.on::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 3px;
    background: #222;
    border-radius: 3px 3px 0 0;
    transition: width 0.25s ease;
}

/* 탭 사이 구분선 제거 (참고사이트는 구분선 없음) */
.tab_menu li + li {
    border-left: none;
}


/* --- 5. 하단 상세 컨텐츠 (.img_area) - 에디터 콘텐츠 스타일링 --- */
.img_area {
    padding: 60px 20px;
    background: #fff;
}

.img_cont {
    /*max-width: 100%;
    margin: 0 auto;
    line-height: 1.8;
    color: #333;
    padding: 0 20px;
     내용물을 왼쪽으로 정렬 */
     max-width: calc(var(--w-container) - 300px);
     margin: 40px auto;     /* 컨테이너 자체를 중앙 정렬 */
     padding: 0px 10px;
}

/* 에디터로 삽입된 이미지 - 왼쪽 정렬로 변경 */
.img_cont img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    display: block !important;
    margin: 30px 0 !important;  /* 중앙이 아닌 왼쪽 정렬 */
    margin-left: 0 !important;
    margin-right: auto !important;
    border-radius: 8px;
    float: none !important;
}

/* CKEditor figure 태그도 왼쪽 정렬 */
.img_cont figure {
    margin: 30px 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    display: block !important;
}

/* CKEditor 정렬 클래스 모두 왼쪽 정렬로 */
.img_cont .image-style-block-align-left,
.img_cont .image-style-block-align-right,
.img_cont .image-style-align-left,
.img_cont .image-style-align-right,
.img_cont .image-style-side,
.img_cont figure[class*="align"] {
    float: none !important;
    margin: 30px 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* figure 안의 이미지도 왼쪽 정렬 */
.img_cont figure img {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    display: block !important;
    float: none !important;
}

/* 에디터 resize 클래스 무시 */
.img_cont .image_resized {
    width: 100% !important;
    max-width: 100% !important;
}

/* 인라인 스타일로 지정된 width 무시 */
.img_cont figure[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* 에디터로 삽입된 비디오/iframe */
.img_cont video,
.img_cont iframe {
    max-width: 100%;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
}

/* 텍스트 단락 */
.img_cont p {
    margin: 20px 0 !important;  /* 인라인 margin 무시 */
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    word-break: keep-all;
    text-align: left !important;
}

/* 에디터 정렬 클래스 무시 */
.img_cont p[style*="text-align"],
.img_cont p[style*="margin-left"],
.img_cont p[style*="margin-right"],
.img_cont p.text-center,
.img_cont p.text-right {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 첫 번째 단락 */
.img_cont p:first-of-type {
    margin-top: 0;
}

/* 제목 스타일 (h1~h6) */
.img_cont h1,
.img_cont h2,
.img_cont h3,
.img_cont h4,
.img_cont h5,
.img_cont h6 {
    margin: 40px 0 20px 0 !important;  /* margin-left 강제 제거 */
    font-weight: 700;
    color: #111;
    line-height: 1.4;
}

.img_cont h1 { font-size: 28px; }
.img_cont h2 { font-size: 24px; }
.img_cont h3 { font-size: 20px; }
.img_cont h4 { font-size: 18px; }
.img_cont h5 { font-size: 16px; }
.img_cont h6 { font-size: 15px; }

/* 리스트 */
.img_cont ul,
.img_cont ol {
    margin: 20px 0;
    padding-left: 20px;
}

.img_cont li {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.6;
}

/* 링크 */
.img_cont a {
    color: #4a90e2;
    text-decoration: underline;
}

.img_cont a:hover {
    color: #357abd;
}

/* 표 */
.img_cont table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.img_cont table th,
.img_cont table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.img_cont table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* 인용구 */
.img_cont blockquote {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #4a90e2;
    font-style: italic;
    color: #666;
}

/* 코드 블록 */
.img_cont pre,
.img_cont code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.img_cont pre {
    padding: 16px;
    overflow-x: auto;
}

/* 구분선 */
.img_cont hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #e5e5e5;
}

/* strong, em 태그 */
.img_cont strong,
.img_cont b {
    font-weight: 700;
    color: #111;
}

.img_cont em,
.img_cont i {
    font-style: italic;
}

/* 중앙 정렬 클래스 (에디터에서 추가 가능) - 왼쪽으로 변경 */
.img_cont .center,
.img_cont [align="center"],
.img_cont [align="left"],
.img_cont [align="right"] {
    text-align: left !important;
}

/* 이미지/figure는 왼쪽 정렬 */
.img_cont img[align="center"],
.img_cont img[align="left"],
.img_cont img[align="right"],
.img_cont figure[align="center"],
.img_cont figure[align="left"],
.img_cont figure[align="right"] {
    display: block !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    float: none !important;
}

/* 에디터에서 추가한 figure 태그 */
.img_cont figure {
    margin: 30px 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    display: block !important;
}

.img_cont figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: #999;
    font-style: italic;
    text-align: left !important;
}


/* --- 6. 리뷰 섹션 (너비 제한 및 디자인) --- */
.review-list-section, .review-summary-section {
    max-width: var(--w-container); /* 너비 제한 */
    margin: 0 auto;
    padding: 60px 0;
}
.review-grid {
    display: grid;
    grid-template-columns: 1fr; /* 리뷰 한 줄에 하나씩 (깔끔하게) */
    gap: 15px;
    margin-top: 20px;
}
.review-card {
    border: 1px solid #eee; padding: 20px; border-radius: 8px;
    display: flex; gap: 20px; align-items: flex-start;
}
.review-thumb { width: 80px; height: 80px; background: #f9f9f9; border-radius: 4px; overflow: hidden; flex-shrink:0; }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-summary { flex: 1; }


/* --- 7. 페이지네이션 (깨짐 수정) --- */
#pagination {
    display: flex; justify-content: center; gap: 5px; margin-top: 40px;
}
.page-btn {
    width: 32px; height: 32px;
    border: 1px solid #ddd; background: #fff;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; cursor: pointer; color: #666;
}
.page-btn.active {
    background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}


/* --- 8. 배송/반품 안내 --- */
.prod-policy {
    max-width: calc(var(--w-container) - 300px);
    margin: 0 auto;
    padding: 60px 10px;
    border-top: 1px solid #eee;
}
.prod-policy h3 { font-size: 20px; margin-bottom: 15px; color: #111; }
.policy-intro { background: #f5f5f5; padding: 20px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; color: #555; }


/* --- 9. 반응형 (Mobile) --- */
@media (max-width: 1024px) {
    .detailArea { flex-direction: column; gap: 30px; }
    .imgArea { width: 100%; }
    .headingArea h1 { font-size: 22px; }
    
    /* 모바일 하단 고정바 */
    .fixed-action-bar { display: block; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; padding: 10px; z-index: 2000; border-top: 1px solid #eee; }
    .productAction { display: none; } /* 본문 버튼 숨김 */
}

/* ==========================================================================
   [수정] 상품정보제공고시 & 리뷰 (스타일 보강)
   ========================================================================== */

/* --- 1. 상품정보제공고시 (.product_inform) --- */
/* 내부 HTML구조가 테이블일 확률이 높으므로, 테이블 스타일 강제 적용 */
.product_inform {
    margin: 40px auto;
    padding-top: 40px;
    border-top: 1px solid #eee;
    max-width: calc(var(--w-container) - 300px);
}

.product_inform h3 {
    font-size: 20px;
    color: #111;
    margin-bottom: 15px;
    font-weight: 700;
}

/* 테이블 디자인 리셋 및 모던 스타일 적용 */
.product_inform table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid #333 !important; /* 상단 진한 선 */
    table-layout: fixed; /* 레이아웃 깨짐 방지 */
}

.product_inform th,
.product_inform td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee; /* 하단 연한 선 */
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    vertical-align: middle;
}

.product_inform th {
    background-color: #fafafa;
    color: #555;
    font-weight: 400;
    width: 180px; /* 항목 너비 고정 */
}

.product_inform td {
    color: #333;
    word-break: break-all; /* 긴 주소 등 줄바꿈 */
}


/* --- 2. 리뷰 요약 (그래프바 깨짐 해결) --- */
.review-summary-section {
    max-width: var(--w-container);
    margin: 0 auto;
    padding: 60px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    max-width: calc(var(--w-container) - 300px);
}

/* 별점 평균 */
.review-average-score {
    margin-bottom: 40px;
}
.star-big {
    display: block;
    font-size: 48px;
    color: #fadb14;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
}

/* 그래프 영역 너비 잡기 */
.review-distribution {
    width: 100%;
    max-width: 400px; /* 그래프 전체 폭 제한 */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* [중요] Flexbox로 라벨과 막대바 가로 정렬 */
.distribution-row {
    display: flex !important;
    align-items: center;
    width: 100%;
}

.distribution-row .label {
    width: 100px; /* 라벨 너비 확보 */
    font-size: 13px;
    color: #666;
    text-align: left;
    flex-shrink: 0; /* 줄어들지 않게 */
}

/* 막대바 배경 */
.bar-bg {
    flex: 1; /* 남은 공간 모두 차지 */
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative; /* 자식 요소 기준점 */
}

/* 막대바 채움 (실제 데이터) */
.bar-fill {
    display: block;
    height: 100%;
    background-color: var(--c-primary); /* 브랜드 컬러 */
    border-radius: 4px;
    transition: width 0.5s ease; /* 부드럽게 차오르는 효과 */
}


/* --- 3. 리뷰 리스트 페이지네이션 (.page-btn) --- */
/* 기존의 .tbl_pagination과 다른 HTML 구조(#pagination button)를 사용 중이라 별도 스타일 필요 */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 40px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.page-btn.active {
    background-color: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
    font-weight: 700;
}





/* ==========================================================================
   REVIEW SYSTEM (리뷰 작성, 모달, 상세 리스트)
   ========================================================================== */

/* --- 1. 리뷰 작성 버튼 (상단 요약 영역 내) --- */
#showReviewWriteModalBtn {
    background-color: var(--c-primary);
    color: #fff;
    border: 1px solid var(--c-primary);
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}


/* --- 2. 하단 상세 리뷰 리스트 (_reviewLonglistPartial.php) --- */
.review-longlist-container {
    max-width: calc(var(--w-container) - 300px);
    margin: 0 auto;
    padding-bottom: 80px;
    padding: 0 10px;
}

.review-long-card {
    padding: 30px 0;
    border-bottom: 1px solid #eee;
    text-align: left; /* 중앙 정렬 해제 */
    cursor: pointer;
}

/* 별점 */
.long-stars {
    font-size: 14px;
    color: #fadb14; /* 노란색 */
    margin-bottom: 6px;
    letter-spacing: -1px;
}

/* 작성자 정보 */
.long-author {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

/* 리뷰 텍스트 */
.long-text {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap; /* 줄바꿈 보존 */
}

/* 첨부 이미지 리스트 */
.long-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.long-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s;
}
.long-images img:hover {
    transform: scale(1.05);
    border-color: var(--c-primary);
}

/* 상세 리뷰 페이지네이션 */
.long-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}
.long-page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}
.long-page-btn:hover,
.long-page-btn.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
    font-weight: 700;
}


/* --- 3. 리뷰 작성 모달 (#reviewWriteModal) --- */
#reviewWriteModalOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
}

#reviewWriteModal {
    background: #fff;
    width: 90%; max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

/* 모달 헤더 */
.reviewWriteModalHeader {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.reviewWriteModalTitle { font-size: 18px; font-weight: 700; color: #111; }
.reviewWriteModalClose { font-size: 24px; color: #999; line-height: 1; }

/* 모달 바디 (Form 내용) */
.reviewWriteModalBody {
    padding: 20px;
    max-height: 80vh; overflow-y: auto;
}
/* (내부 폼 요소 스타일 예시) */
.reviewWriteModalBody textarea {
    width: 100%; height: 150px;
    padding: 10px; border: 1px solid #ddd; border-radius: 4px;
    resize: none; font-size: 14px; margin-bottom: 15px;
}
.reviewWriteModalBody input[type="file"] { margin-bottom: 15px; }
.reviewWriteModalBody button[type="submit"] {
    width: 100%; height: 48px;
    background: var(--c-primary); color: #fff;
    font-size: 16px; font-weight: 700; border-radius: 6px;
}


#modalProductName { font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.modal-stars { color: #fadb14; font-size: 18px; margin-bottom: 10px; }
.review-text { font-size: 15px; line-height: 1.6; color: #333; margin-top: 10px; }
.review-thumbs-gallery img {
    width: 60px; height: 60px; border-radius: 4px; margin-right: 5px; cursor: pointer;
    border: 2px solid transparent;
}
.review-thumbs-gallery img:hover { border-color: var(--c-primary); }

/* 우측 사이드바 (다른 리뷰 목록) */
.review-modal-sidebar {
    width: 320px; flex-shrink: 0;
    background: #f9f9f9;
    padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
}
#side_h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

/* 사이드바 썸네일 그리드 */
.review-sidebar-other {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.review-sidebar-other img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 4px; cursor: pointer; border: 1px solid #ddd;
}


/* --- 5. 반응형 (Mobile) --- */
@media (max-width: 768px) {
    /* 모바일 상세 리뷰 리스트 */
    .review-long-card { padding: 20px 0; }
    .long-images img { width: 80px; height: 80px; }

    /* 모바일 뷰어 모달 */
    .review-modal-content {
        flex-direction: column; height: 90vh; width: 95%;
    }
    .review-modal-sidebar { display: none; } /* 모바일에서 사이드바 숨김 */
    .review-modal-main-image { height: 50%; }
    .review-modal-content-main { border-right: none; }

    .ttery_product-detaildesign th,
    .policy-table th {
        width: 90px;
        color: #888;
        font-weight: 400;
    }

    .image_resized{
        max-width:100%;
    }
}

/* 애니메이션 정의 */
@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}



/* ==========================================================================
   [추가] 리뷰 작성 모달 내부 폼 스타일
   ========================================================================== */
   .review-write-wrap { padding: 10px 0; }

   .review-form-row { margin-bottom: 20px; }
   .review-form-row label {
       display: block; font-size: 14px; font-weight: 700; color: #111; margin-bottom: 8px;
   }
   
   /* 별점/셀렉트 박스 */
   .review-select {
       width: 100%; height: 45px; border: 1px solid #ddd; border-radius: 4px; padding: 0 10px; font-size: 14px;
   }
   
   /* 텍스트 영역 */
   .review-textarea {
       width: 100%; height: 150px; border: 1px solid #ddd; border-radius: 4px; padding: 12px;
       font-size: 14px; resize: none; line-height: 1.5; font-family: inherit;
   }
   .review-textarea:focus { border-color: var(--c-primary); outline: none; }
   
   /* 파일 업로드 */
   .file-upload-box {
       background: #f9f9f9; padding: 15px; border-radius: 4px; border: 1px dashed #ccc;
   }
   .file-upload-box input[type="file"] {
       display: block; width: 100%; font-size: 13px; margin-bottom: 5px;
   }
   .file-upload-box input[type="file"]:last-child { margin-bottom: 0; }
   
   /* 작성 완료 버튼 */
   .btn-submit-review {
       width: 100%; height: 50px;
       background-color: var(--c-primary); color: #fff;
       font-size: 16px; font-weight: 700; border-radius: 6px;
       border: none; cursor: pointer; transition: 0.2s;
   }
   .btn-submit-review:hover { background-color: var(--c-primary-dark); }


   /* ==========================================================================
   [수정] 리뷰 모달 팝업 (HTML 구조 맞춤형 리뉴얼)
   ========================================================================== */

/* 1. 모달 오버레이 (배경) */
.review-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 1;
}

/* 2. 모달 컨테이너 (위치 잡기) */
.review-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3001; display: none; /* JS로 active 추가 시 보임 */
    justify-content: center; align-items: center;
}
.review-modal.active { display: flex; }

/* 3. 모달 콘텐츠 박스 (흰색 박스) */
.review-modal-content {
    background: #fff;
    width: 95%; max-width: 1200px; /* 너비 넉넉하게 */
    height: 85vh; /* 화면 높이의 85% */
    border-radius: 8px;
    position: relative;
    overflow: hidden; /* 둥근 모서리 유지 */
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* 닫기 버튼 */
.review-modal-close {
    position: absolute; top: 15px; right: 15px; z-index: 100;
    font-size: 30px; color: #333; background: none; border: none; cursor: pointer; line-height: 1;
}

/* 4. 모달 바디 (좌우 분할의 핵심 컨테이너) */
/* [중요] 이 부분에 Flex가 있어야 좌/우 배치가 됩니다 */
.review-modal-body {
    display: flex; 
    width: 100%; 
    height: 100%;
    overflow: hidden;
}

/* --- [LEFT] 메인 콘텐츠 영역 --- */
.review-modal-content-main {
    flex: 1; /* 남은 공간 차지 */
    display: flex; 
    flex-direction: column;
    height: 100%;
    overflow-y: auto; /* 세로 스크롤 허용 */
    border-right: 1px solid #eee; /* 사이드바와 구분선 */
}

/* 메인 이미지 (상단) */
.review-modal-main-image {
    background: #000;
    height: 60%; /* 높이 60% 배분 */
    min-height: 400px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.review-modal-main-image img {
    max-width: 100%; max-height: 100%; object-fit: contain;
}

/* 하단 정보 영역 (상품정보 + 리뷰텍스트) */
.review-modal-info {
    padding: 30px;
    background: #fff;
}

/* 상품 미니 정보 */
.product-info {
    display: flex; gap: 15px; align-items: center;
    padding-bottom: 20px; border-bottom: 1px solid #eee; margin-bottom: 20px;
}
.product-info .product-thumb {
    width: 60px; height: 60px; border-radius: 4px; object-fit: cover; border: 1px solid #eee;
}
#modalProductName { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 4px; }
.modal-stars { font-size: 18px; letter-spacing: -1px; }

/* 리뷰 텍스트 & 작성자 */
.review-meta { margin-bottom: 20px; }
.review-author { font-size: 13px; color: #888; margin-bottom: 10px; }
.review-text { font-size: 15px; line-height: 1.6; color: #333; white-space: pre-wrap; }

/* 갤러리 썸네일 (작은 이미지들) */
.review-thumbs-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.review-thumbs-gallery img {
    width: 60px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer;
    border: 2px solid transparent;
}
.review-thumbs-gallery img:hover { border-color: var(--c-primary); }


/* --- [RIGHT] 사이드바 영역 --- */
.review-modal-sidebar {
    width: 340px; /* 고정 너비 */
    flex-shrink: 0; /* 줄어들지 않음 */
    background: #f9f9f9;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    display: flex; flex-direction: column;
}

#side_h2 { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 15px; }

/* 다른 리뷰 그리드 */
.review-sidebar-other {
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* 2열 */
    gap: 10px;
}
.review-sidebar-other img {
    width: 100%; 
    aspect-ratio: 1/1; /* 정사각형 */
    object-fit: cover; 
    border-radius: 4px; 
    border: 1px solid #ddd;
    cursor: pointer;
    transition: 0.2s;
}
.review-sidebar-other img:hover { border-color: var(--c-primary); opacity: 0.8; }


/* --- 반응형 (모바일) --- */
@media (max-width: 1024px) {
    .review-modal-content {
        width: 100%; height: 100%; max-width: 100%; border-radius: 0;
    }
    
    .review-modal-body {
        flex-direction: column; /* 세로 배치 */
        overflow-y: auto; /* 전체 스크롤 */
    }

    .review-modal-content-main {
        border-right: none; height: auto; flex: none;
    }
    
    .review-modal-main-image { height: 40vh; min-height: 300px; }

    /* 모바일에서 사이드바는 하단으로 */
    .review-modal-sidebar {
        width: 100%; height: auto; border-top: 1px solid #eee;
    }
    .review-sidebar-other {
        grid-template-columns: repeat(4, 1fr); /* 4열로 넓게 */
    }
    
    .review-modal-close {
        color: #fff; text-shadow: 0 0 5px rgba(0,0,0,0.5); /* 이미지 위에서도 보이게 */
    }
}

/* ==========================================================================
   [추가] 모바일 하단 옵션 선택 UI (Bottom Sheet 스타일)
   ========================================================================== */
   @media (max-width: 1024px) {
    /* 1. 새로운 옵션 토글 버튼 스타일 */
    .btnOptionToggle {
        width: 100px; /* 버튼 너비 */
        height: 48px;
        background-color: #333; /* 진한 회색 */
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center; gap: 4px;
    }
    
    /* 주문하기 버튼 너비 자동 조정 */
    .fixed-action-area .orderBtn {
        flex: 1; /* 남은 공간 모두 차지 */
        margin: 0 !important;
        height: 48px;
    }
    
    /* 장바구니 버튼 스타일 (아이콘형) */
    .fixed-action-area #actionCart {
        background-color: #fff !important;
        color: #333 !important;
        border: 1px solid #ddd !important;
    }


    /* 2. 옵션 래퍼(.product-option-wrapper)를 하단 시트로 변신시킴 */
    .product-option-wrapper {
        /* 평소엔 숨기지 않고 본문에 있다가, JS로 클래스 붙으면 고정됨 */
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    /* 클래스 'mobile-sheet-active'가 붙으면 하단에서 튀어나오는 UI로 변경 */
    .product-option-wrapper.mobile-sheet-active {
        position: fixed;
        bottom: 69px; /* 하단바 높이(약 70px)만큼 띄움 */
        left: 0;
        width: 100%;
        max-height: 60vh; /* 화면 높이의 60%까지만 */
        overflow-y: auto; /* 내용 길면 스크롤 */
        background: #fff;
        z-index: 1500;
        /* border-top: 1px solid #333; 상단 강조 선 */
        box-shadow: 0 -100vh rgba(0,0,0,0.5); /* 화면 전체 어둡게 처리하는 딤드 효과 */
        margin: 0;
        /* border-radius: 12px 12px 0 0;*/
        
        /* 애니메이션 효과 */
        animation: slideUpOption 0.3s forwards;
        padding: 10px 20px 0px 20px;
    }
    
    /* 닫기 버튼 (옵션창 안에 추가될 X 버튼) */
    .sheet-close-btn {
        position: sticky; top: 0; right: 0;
        z-index: 10;
        width: 36px; height: 36px;
        margin-left: auto;
        font-size: 22px; line-height: 36px; text-align: center;
        cursor: pointer; color: #666; background: #fff;
        border-radius: 50%;
        display: none;
    }
    .product-option-wrapper.mobile-sheet-active .sheet-close-btn {
        display: block;
    }

    .ttery_product-detaildesign th, 
    .ttery_product-detaildesign td {
        padding: 4px 0;
        border: none !important; 
        text-align: left;
        vertical-align: middle;
    }
    .ttery_product-detail{
        padding:0 20px;
    }
    .ttery_product-detaildesign td span{
        font-size:14px;
    }
    .img_cont{
        max-width: 100%;
        padding: 0 10px;
    }
    .img_cont img{
        min-width: 0;
        margin: 20px auto;
    }
    .img_cont p {
        font-size: 14px;
        margin: 15px 0;
    }
    .img_cont h1 { font-size: 24px; }
    .img_cont h2 { font-size: 20px; }
    .img_cont h3 { font-size: 18px; }
}


/* 애니메이션 정의 */
@keyframes slideUpOption {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   추가 개선: 리뷰포인트, 배송비 등 강조 스타일
   ========================================================================== */

/* 리뷰포인트 표시 스타일 */
.ttery_product-detaildesign .sale_box.flex {
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
    color: #fff !important;
    padding: 6px 12px !important;
    border-radius: 15px !important;
    font-size: 13px !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.25);
    letter-spacing: -0.2px;
    margin: 0 !important;
}

/* 배송비 무료배송 강조 */
.ttery_product-detaildesign strong[style*="color:#3c763d"] {
    color: #4CAF50 !important;
    font-weight: 700;
    padding: 3px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    font-size: 14px !important;
}

/* 합배송 가능 강조 */
.ttery_product-detaildesign span[style*="color:#3c763d"] {
    color: #4CAF50 !important;
    font-weight: 600;
}

/* 배송비/배송정보 등 작은 텍스트 개선 */
.ttery_product-detaildesign span[style*="color:#777777"] {
    color: #888 !important;
    font-size: 13px !important;
    display: block;
    margin-top: 4px;
    line-height: 1.5;
}

/* 공급업체, 원산지 등 일반 정보 */
.ttery_product-detaildesign span[style*="color:#555555"] {
    color: #666 !important;
    font-weight: 400;
}

/* 테이블 전체에 부드러운 그림자 추가 */
.ttery_product-detaildesign {
    background: #fff;
    border-radius: 8px;
    padding: 10px 0;
    margin: 20px 0;
}

/* ==========================================================================
   쿠폰 팝업 스타일
   ========================================================================== */

/* 쿠폰 버튼이 있는 th를 relative로 설정 */
.ttery_product-detaildesign th:has(#couponListPopup) {
    position: relative;
}

/* 쿠폰 팝업 컨테이너 */
.coupon-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
    max-width: 400px;
}

/* 쿠폰 팝업 내용 */
.coupon-popup-content {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* 쿠폰 아이템 */
.coupon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.coupon-item:last-child {
    margin-bottom: 0;
}

.coupon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 쿠폰 왼쪽 영역 */
.coupon-left {
    flex: 1;
    color: #fff;
}

.coupon-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

.coupon-discount {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.coupon-remaining {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 쿠폰 오른쪽 영역 (다운로드 아이콘) */
.coupon-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-left: 16px;
}

.coupon-right svg {
    position: relative;
    z-index: 2;
}

/* 톱니 효과 (옵션) */
.notch {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
}

/* 스크롤바 스타일 */
.coupon-popup-content::-webkit-scrollbar {
    width: 6px;
}

.coupon-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.coupon-popup-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.coupon-popup-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 쿠폰이 다운로드된 상태 */
.coupon-item.downloaded {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.7;
}

.coupon-item.downloaded:hover {
    transform: none;
    box-shadow: none;
}

.coupon-item.downloaded .coupon-right {
    background: rgba(255, 255, 255, 0.3);
}

/* 다운로드 완료 체크마크 */
.coupon-item.downloaded .coupon-right {
    font-size: 24px;
    color: #fff;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .coupon-popup {
        min-width: 280px;
        max-width: 90vw;
    }
    
    .coupon-title {
        font-size: 14px;
    }
    
    .coupon-discount {
        font-size: 18px;
    }
    
    .coupon-item {
        padding: 14px;
    }
}
/* ==========================================================================
   CKEditor 추가 보완 - float 해제 및 clearfix
   ========================================================================== */

/* img_cont 전체 clearfix */
.img_cont::after {
    content: "";
    display: table;
    clear: both;
}

/* 모든 float 제거 */
.img_cont *[style*="float"] {
    float: none !important;
}

/* 에디터의 align 속성 무시 - 왼쪽 정렬로 */
.img_cont *[align="left"],
.img_cont *[align="right"],
.img_cont *[align="center"] {
    display: block !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    float: none !important;
}

/* 이미지와 figure는 왼쪽, 텍스트는 왼쪽 */
.img_cont *[align="left"]:not(img):not(figure),
.img_cont *[align="right"]:not(img):not(figure),
.img_cont *[align="center"]:not(img):not(figure) {
    text-align: left !important;
}

/* CKEditor의 wrapper div 정리 */
.img_cont div[class*="image"],
.img_cont div[class*="align"] {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    display: block !important;
    margin: 0 !important;
}

/* ==========================================================================
   인라인 스타일 margin/padding 강제 제거
   ========================================================================== */

/* 모든 요소의 인라인 margin-left, margin-right 제거 */
.img_cont *[style*="margin-left"],
.img_cont *[style*="margin-right"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* h1~h6의 인라인 margin 완전 무시 */
.img_cont h1[style*="margin"],
.img_cont h2[style*="margin"],
.img_cont h3[style*="margin"],
.img_cont h4[style*="margin"],
.img_cont h5[style*="margin"],
.img_cont h6[style*="margin"] {
    margin: 40px 0 20px 0 !important;
}

/* p 태그의 인라인 margin 완전 무시 */
.img_cont p[style*="margin"] {
    margin: 20px 0 !important;
}

/* 인라인 padding도 제거 */
.img_cont *[style*="padding-left"],
.img_cont *[style*="padding-right"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 상품 스토리 스타일 */

.story_area {
    padding: 20px 0;
  }
  
  .product-story-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 40px 30px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }
  
  .story-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
  }
  
  .story-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: fadeInDown 0.6s ease-out;
  }
  
  .story-header h3 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
    margin: 0;
    animation: fadeInUp 0.6s ease-out;
  }
  
  .story-content {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    word-wrap: break-word;
    animation: fadeIn 0.8s ease-out;
  }
  
  /* 이모지 강조 */
  .story-content .emoji {
    font-size: 1.5em;
    display: inline-block;
    margin: 0 4px;
    vertical-align: middle;
    animation: bounce 0.5s ease-in-out;
  }
  
  /* 스토리 이미지 */
  .story-images {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }

  .story-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    max-width: 320px;
    flex: 1;
    min-width: 200px;
  }

  .story-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
  }

  .no-story {
    text-align: center;
    color: #999;
    font-size: 15px;
    padding: 40px 0;
  }
  
  /* 애니메이션 */
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes bounce {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
  }
  
  /* 모바일 최적화 */
  @media (max-width: 768px) {
    .product-story-container {
      padding: 30px 20px;
      border-radius: 12px;
    }

    .story-icon {
      font-size: 40px;
    }

    .story-header h3 {
      font-size: 20px;
    }

    .story-content {
      font-size: 15px;
      line-height: 1.7;
    }

    .story-content .emoji {
      font-size: 1.3em;
    }

    .story-images {
      flex-direction: column;
      align-items: center;
    }

    .story-img-wrap {
      max-width: 100%;
      min-width: unset;
    }
  }
  
  @media (max-width: 480px) {
    .product-story-container {
      padding: 25px 15px;
    }
    
    .story-icon {
      font-size: 36px;
    }
    
    .story-header h3 {
      font-size: 18px;
    }
    
    .story-content {
      font-size: 14px;
    }
  }
  
  /* 탭 메뉴 호버/활성 - 통합 CSS에서 관리 */
/* ==========================================================================
   함께 보는 상품 (Related Products Swiper)
   ========================================================================== */
   .related-products-section {
    padding: 60px 0 80px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.related-products-inner {
    max-width: var(--w-container, 1380px);
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.related-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.5px;
}

/* 네비게이션 */
.related-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.related-paging {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    letter-spacing: 1px;
    min-width: 60px;
    text-align: center;
}
.related-prev,
.related-next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}
.related-prev:hover,
.related-next:hover {
    border-color: #333;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.related-prev.swiper-button-disabled,
.related-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
    box-shadow: none;
}

/* 카드 */
.related-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}
.related-card:hover {
    transform: translateY(-4px);
}

/* 썸네일 */
.related-thumb {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    margin-bottom: 12px;
}
.related-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.related-card:hover .related-thumb img {
    transform: scale(1.04);
}

/* 품절 오버레이 */
.related-soldout {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.related-soldout span {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    border: 1px solid #aaa;
    padding: 4px 10px;
    border-radius: 3px;
    background: #fff;
}

/* 상품 정보 */
.related-info {
    padding: 0 2px;
}
.related-name {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 6px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 39px;
}
.related-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.related-discount {
    font-size: 16px;
    font-weight: 800;
    color: #fa622f;
}
.related-price {
    font-size: 16px;
    font-weight: 800;
    color: #111;
}
.related-original {
    display: block;
    font-size: 13px;
    color: #aaa;
    text-decoration: line-through;
    margin-top: 2px;
}

/* 반응형 */
@media (max-width: 768px) {
    .related-products-section {
        padding: 40px 0 60px;
    }
    .related-header h2 {
        font-size: 18px;
    }
    .related-name {
        font-size: 13px;
        min-height: 36px;
    }
    .related-discount,
    .related-price {
        font-size: 14px;
    }
}