/* ============================================================
   김치광장 - 상품 상세 페이지 전용 CSS (product_view.css)
   ============================================================ */


/* ============================================================
   상품 상세 본문 컨테이너
   ============================================================ */
.product-detail {
    padding: 40px 0 60px;
}


/* ============================================================
   상단 2열 레이아웃 — 좌(이미지) / 우(정보)
   ============================================================ */
.detail-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 50px;
    margin-bottom: 60px;
}


/* ============================================================
   좌측 — 상품 이미지 갤러리
   ============================================================ */
.detail-gallery {
    position: sticky;
    top: 120px;
}

/* 메인 이미지 박스 */
.detail-main-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #eeeeee;
    margin-bottom: 12px;
}

.detail-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

/* PC 호버 시 줌 — 모바일에서는 hover 가 없어 자동 무시 */
@media (hover: hover) {
    .detail-main-img:hover img {
        transform: scale(1.6);
    }
}

/* 메인 이미지 위 할인율 뱃지 */
.detail-img-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    background: #6b1210;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* 썸네일 가로 리스트 */
.detail-thumb-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-thumb-list li {
    width: calc(25% - 6px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #fafafa;
}

.detail-thumb-list li.is-active {
    border-color: #292829;
}

.detail-thumb-list li:hover {
    border-color: #cccccc;
}

.detail-thumb-list li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ============================================================
   우측 — 상품 정보
   ============================================================ */
.detail-info {
    padding-top: 4px;
    min-width: 0;
}

/* 카테고리 태그 */
.detail-cat-tag {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #6b1210;
    background: #f9f0ef;
    padding: 4px 10px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

/* 상품명 */
.detail-product-name {
    font-size: 26px;
    font-weight: 700;
    color: #292829;
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: keep-all;
}

/* 짧은 요약 설명 */
.detail-summary {
    font-size: 14px;
    color: #777777;
    line-height: 1.6;
    margin-top: 8px;
    word-break: keep-all;
}

/* 구분선 */
.detail-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 22px 0 18px;
}


/* ============================================================
   가격 영역 (소비자가 / 판매가 / 할인 뱃지)
   ============================================================ */
.detail-price-block {
    margin-bottom: 22px;
}

.price-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.price-consumer {
    color: #aaaaaa;
    text-decoration: line-through;
    font-size: 15px;
}

.price-sale-main {
    font-size: 30px;
    font-weight: 800;
    color: #6b1210;
    letter-spacing: -0.5px;
}

.discount-badge {
    display: inline-block;
    background: #6b1210;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    line-height: 1.2;
}


/* ============================================================
   상세 정보 테이블 (배송/원산지/제조사 등)
   ============================================================ */
.detail-price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 22px;
    border-top: 1px solid #f0f0f0;
}

.detail-price-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.detail-price-table td {
    padding: 12px 0;
    font-size: 14px;
    vertical-align: middle;
}

.detail-price-table .label {
    color: #888888;
    width: 100px;
    font-weight: 400;
}

/* 배송정보 */
.detail-shipping-info {
    color: #555555;
}

.detail-shipping-info strong {
    color: #292829;
    font-weight: 700;
    margin-right: 8px;
}

.detail-shipping-info .ship-note {
    font-size: 14px;
    color: #888888;
}

.detail-meta {
    color: #555555;
}


/* ============================================================
   수량 + 합계 금액
   ============================================================ */
.detail-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0;
    padding: 18px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

/* 수량 조절 박스 */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #cccccc;
    background: #ffffff;
}

.btn-qty-minus,
.btn-qty-plus {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    cursor: pointer;
    background: #ffffff;
    border: none;
    transition: background 0.15s;
}

.btn-qty-minus:hover,
.btn-qty-plus:hover {
    background: #f5f5f5;
    color: #292829;
}

.btn-qty-minus .material-icons,
.btn-qty-plus .material-icons {
    font-size: 18px;
}

.qty-input {
    width: 52px;
    height: 38px;
    text-align: center;
    font-size: 15px;
    border: none;
    border-left: 1px solid #cccccc;
    border-right: 1px solid #cccccc;
    outline: none;
    color: #292829;
    font-family: inherit;
    -moz-appearance: textfield;
}

/* Chrome/Safari/Edge 의 number 스피너 제거 */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 합계 금액 */
.detail-total {
    text-align: right;
}

.detail-total .total-label {
    font-size: 14px;
    color: #888888;
    display: block;
    margin-bottom: 4px;
}

.detail-total .total-price {
    font-size: 26px;
    font-weight: 800;
    color: #292829;
    letter-spacing: -0.5px;
}


/* ============================================================
   구매 버튼 영역 (PC)
   ============================================================ */
.detail-buy-btns {
    display: grid;
    grid-template-columns: 52px 1fr 1fr;
    gap: 8px;
    margin-top: 20px;
}

/* 관심상품(하트) */
.btn-wish-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cccccc;
    color: #888888;
    cursor: pointer;
    background: #ffffff;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-wish-detail:hover {
    border-color: #6b1210;
    color: #6b1210;
}

.btn-wish-detail.is-wished {
    border-color: #6b1210;
    color: #ffffff;
    background: #6b1210;
}

.btn-wish-detail .material-icons {
    font-size: 22px;
}

/* 장바구니 버튼 */
.btn-basket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0;
    background: #ffffff;
    color: #292829;
    border: 1px solid #292829;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.btn-basket:hover {
    background: #292829;
    color: #ffffff;
}

.btn-basket .material-icons {
    font-size: 18px;
}

/* 바로구매 버튼 */
.btn-buy-now {
    padding: 14px 0;
    background: #6b1210;
    color: #ffffff;
    border: 1px solid #6b1210;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-buy-now:hover {
    background: #4a0c0a;
}


/* ============================================================
   상품 상세 정보 탭
   ============================================================ */
.detail-tabs {
    border-top: 2px solid #292829;
    margin-top: 0;
}

.detail-tab-btns {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.detail-tab-btns::-webkit-scrollbar {
    display: none;
}

.detail-tab-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 16px 12px;
    font-size: 15px;
    font-weight: 500;
    color: #888888;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    background: none;
    font-family: inherit;
    white-space: nowrap;
}

.detail-tab-btn.is-active {
    color: #292829;
    font-weight: 700;
    border-bottom-color: #292829;
}

.detail-tab-btn:hover {
    color: #292829;
}

/* 탭 버튼의 카운트 배지 — "상품후기 [3]" 처럼 갯수 표시 */
.tab-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    background: #c8c8c8;
    color: #ffffff;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
    transition: background 0.15s;
}

/* 활성 탭의 배지는 짙은 색으로 */
.detail-tab-btn.is-active .tab-count-badge {
    background: #292829;
}

/* 탭 콘텐츠 패널 */
.detail-tab-panel {
    display: none;
    padding: 40px 0;
}

.detail-tab-panel.is-active {
    display: block;
}

/* 상품 상세 — DB의 detail_pc HTML 출력 영역 */
.detail-content-html {
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.7;
    color: #333333;
    font-size: 15px;
}

.detail-content-html img {
    max-width: 100%;
    height: auto;
}

.detail-content-html p {
    margin-bottom: 14px;
}

/* 상세 이미지 fallback */
.detail-content-img {
    max-width: 860px;
    margin: 0 auto;
}

.detail-content-img img {
    width: 100%;
    height: auto;
    margin-bottom: 12px;
}

/* 상품 정보 테이블 */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-top: 1px solid #292829;
    margin-bottom: 24px;
}

.info-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.info-table th {
    width: 200px;
    padding: 14px 18px;
    background: #fafafa;
    font-weight: 500;
    color: #292829;
    text-align: left;
    border-right: 1px solid #e0e0e0;
    vertical-align: top;
}

.info-table td {
    padding: 14px 18px;
    color: #555555;
    line-height: 1.5;
}

/* 여러 줄 표기 셀 — 원재료/영양성분/주의사항 */
.info-table td.info-multiline {
    white-space: pre-line;
}

/* ============================================================
   식품 표시정보 — 안내문구, 섹션 헤더, 빈값, 배지
   ============================================================ */

/* 상단 안내 문구 (법적 근거 안내) */
.info-guide {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    margin-bottom: 22px;
    background: #fff8e7;
    border-left: 3px solid #f0a91e;
    color: #6a4c00;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 2px;
}

.info-guide .material-icons {
    font-size: 20px;
    color: #f0a91e;
    flex-shrink: 0;
}

/* 섹션 헤더 (기본 정보 / 제조 및 유통 정보 등) */
.info-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #292829;
    margin: 28px 0 10px;
    padding-left: 10px;
    border-left: 3px solid #292829;
    line-height: 1.2;
}

.info-section-title:first-of-type {
    margin-top: 0;
}

/* 값이 비었을 때 안내 텍스트 */
.info-empty {
    color: #aaaaaa;
    font-size: 14px;
    font-style: normal;
}

/* 배지 (알레르기/GMO/수입식품 표시) */
.info-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

/* 경고 배지 — 알레르기, GMO 포함 */
.info-badge-warn {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6c0;
}

/* 정상 배지 — GMO 미해당 */
.info-badge-ok {
    background: #eaf6ec;
    color: #1e7a36;
    border: 1px solid #c2e1c8;
}

/* 정보 배지 — 수입식품 표시 */
.info-badge-info {
    background: #eaf2fc;
    color: #1d5db5;
    border: 1px solid #c5d8f0;
}

/* 하단 면책/안내 문구 */
.info-disclaimer {
    margin-top: 18px;
    padding: 14px 18px;
    background: #f7f7f7;
    border: 1px solid #ececec;
    color: #6c6c6c;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 2px;
}

/* 리뷰/Q&A 빈 상태 */
.empty-review {
    text-align: center;
    padding: 80px 20px;
    color: #888888;
    font-size: 14px;
    line-height: 1.6;
}

.empty-review .material-icons {
    font-size: 56px;
    display: block;
    margin: 0 auto 14px;
    color: #d0d0d0;
}

/* ============================================================
   상품 후기 — 헤더 (평균 별점 + 작성 버튼)
   ============================================================ */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.review-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.review-avg-num {
    font-size: 24px;
    font-weight: 700;
    color: #292829;
    line-height: 1;
}

.review-avg-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.review-total-count {
    font-size: 14px;
    color: #6c6c6c;
}

/* 후기 작성 버튼 */
.btn-review-write {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #292829;
    color: #ffffff;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-review-write:hover {
    background: #555555;
}

.btn-review-write .material-icons {
    font-size: 18px;
}

/* ============================================================
   별점 표시 (출력용 부분 채움 별)
   ------------------------------------------------------------
   .star-cell 안에 빈별(.star-bg, 회색)과 채워진별(.star-fill, 노랑)을
   겹치고, .star-fill 의 width(%)로 부분 채움을 표현한다.
   ============================================================ */
.star-cell {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.star-cell .star-bg,
.star-cell .star-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    line-height: 1;
}

.star-cell .star-bg {
    width: 100%;
    color: #d8d8d8;
}

.star-cell .star-fill {
    color: #f5b400;
}

.star-cell .material-icons {
    font-size: 18px;
    line-height: 1;
}

/* ============================================================
   후기 목록
   ============================================================ */
.review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #292829;
}

.review-item {
    display: flex;
    gap: 18px;
    padding: 20px 8px;
    border-bottom: 1px solid #ececec;
    align-items: stretch;
}

/* 좌측 이미지 영역 */
.review-img-thumb {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.review-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 이미지 없음 — 빈 아이콘 */
.review-img-thumb.is-empty {
    color: #c8c8c8;
}

.review-img-thumb.is-empty .material-icons {
    font-size: 48px;
}

/* 우측 본문 영역 */
.review-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 우측 상단 — 별점 + 수정/삭제 */
.review-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.review-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.review-rating-num {
    font-size: 14px;
    color: #6c6c6c;
    margin-left: 4px;
}

/* 본인 글에만 노출되는 액션 버튼 */
.review-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.review-actions button {
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    color: #555555;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.review-actions button:hover {
    background: #f5f5f5;
    border-color: #999999;
}

.review-actions .btn-review-delete:hover {
    color: #c0392b;
    border-color: #c0392b;
}

/* 우측 중간 — 후기 내용 */
.review-content {
    flex: 1;
    margin: 0 0 10px;
    color: #292829;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

/* 우측 하단 — 작성자 + 날짜 */
.review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    color: #888888;
    font-size: 14px;
}

.review-author {
    font-weight: 500;
    color: #555555;
}

.review-date {
    color: #999999;
}

.review-edited {
    color: #b0b0b0;
    font-size: 14px;
    margin-left: 4px;
}

/* ============================================================
   페이지네이션
   ============================================================ */
.review-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 26px 0 6px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: #555555;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.page-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #999999;
}

.page-btn.is-active {
    background: #292829;
    border-color: #292829;
    color: #ffffff;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn .material-icons {
    font-size: 18px;
}

/* ============================================================
   후기 작성/수정 모달
   ============================================================ */
.review-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.review-modal.is-open {
    display: flex;
}

.review-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.review-modal-box {
    position: relative;
    width: 92%;
    max-width: 560px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    animation: reviewModalIn 0.2s ease-out;
}

@keyframes reviewModalIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.review-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #ececec;
}

.review-modal-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #292829;
}

.review-modal-close {
    background: transparent;
    border: 0;
    color: #888888;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
}

.review-modal-close:hover {
    color: #292829;
    background: #f5f5f5;
}

/* ────────────────────────────────────────────────
   모달 내 폼
   ──────────────────────────────────────────────── */
.review-form {
    padding: 22px;
}

.review-form-row {
    margin-bottom: 18px;
}

.review-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #292829;
    margin-bottom: 8px;
}

/* 별점 입력 */
.review-rating-input {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.review-rating-input .rating-star {
    background: transparent;
    border: 0;
    padding: 2px;
    cursor: pointer;
    color: #d8d8d8;
    line-height: 0;
    transition: color 0.1s, transform 0.1s;
}

.review-rating-input .rating-star:hover {
    transform: scale(1.1);
}

.review-rating-input .rating-star .material-icons {
    font-size: 30px;
}

.review-rating-input .rating-star.is-on {
    color: #f5b400;
}

/* 호버 시 미리보기 (확정보다 살짝 옅게) */
.review-rating-input:hover .rating-star.is-on {
    color: #d8d8d8;
}

.review-rating-input .rating-star.is-hover {
    color: #f5b400;
}

.rating-value-text {
    font-size: 14px;
    color: #555555;
    margin-left: 8px;
    min-width: 32px;
}

.rating-clear-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: #888888;
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
}

.rating-clear-btn:hover {
    background: #f5f5f5;
    color: #292829;
}

.rating-clear-btn .material-icons {
    font-size: 16px;
}

/* 텍스트 입력 + 글자수 카운터 */
.review-textarea-wrap {
    position: relative;
}

.review-textarea-wrap textarea {
    width: 100%;
    padding: 12px 14px 28px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    min-height: 120px;
    color: #292829;
}

.review-textarea-wrap textarea:focus {
    outline: none;
    border-color: #292829;
}

.review-char-counter {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 14px;
    color: #999999;
    pointer-events: none;
}

/* 이미지 업로드 */
.review-image-upload {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-image-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px dashed #b0b0b0;
    border-radius: 4px;
    color: #555555;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-image-pick:hover {
    background: #f5f5f5;
    border-color: #292829;
    border-style: solid;
}

.btn-image-pick .material-icons {
    font-size: 20px;
}

.review-image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.review-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-image-remove .material-icons {
    font-size: 16px;
}

.review-image-hint {
    width: 100%;
    margin: 6px 0 0;
    font-size: 14px;
    color: #999999;
}

/* 폼 액션 (취소/등록) */
.review-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.btn-review-cancel,
.btn-review-submit {
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-review-cancel {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #555555;
}

.btn-review-cancel:hover {
    background: #f5f5f5;
}

.btn-review-submit {
    background: #292829;
    color: #ffffff;
}

.btn-review-submit:hover:not(:disabled) {
    background: #555555;
}

.btn-review-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ============================================================
   연관 상품 — 자체 카드 디자인 (목록 페이지와 독립)
   ============================================================ */
.related-products {
    padding: 40px 0 60px;
    border-top: 1px solid #e0e0e0;
}

.related-products .section-title {
    text-align: left;
    margin-bottom: 24px;
}

.related-products .section-title .txt02 {
    font-size: 22px;
    font-weight: 700;
    color: #292829;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.related-card {
    background: #ffffff;
}

.related-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #eeeeee;
    margin-bottom: 12px;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-thumb:hover img {
    transform: scale(1.05);
}

.related-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    background: #6b1210;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.related-info {
    padding: 0 4px;
}

.related-name {
    display: block;
    font-size: 14px;
    color: #292829;
    line-height: 1.5;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: keep-all;
}

.related-name:hover {
    color: #6b1210;
}

.related-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.related-consumer {
    color: #aaaaaa;
    text-decoration: line-through;
    font-size: 14px;
}

.related-sale {
    color: #292829;
    font-weight: 700;
    font-size: 16px;
}


/* ============================================================
   모바일 전용 하단 고정 구매 바
   ============================================================ */
.mobile-buy-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 10px 12px;
    gap: 8px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.mb-wish {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ffffff;
    border: 1px solid #cccccc;
    color: #888888;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.mb-wish.is-wished {
    border-color: #6b1210;
    background: #6b1210;
    color: #ffffff;
}

.mb-wish .material-icons {
    font-size: 24px;
}

.mb-cart {
    flex: 1;
    height: 50px;
    background: #ffffff;
    color: #292829;
    border: 1px solid #292829;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.mb-buy {
    flex: 1;
    height: 50px;
    background: #6b1210;
    color: #ffffff;
    border: 1px solid #6b1210;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}


/* ============================================================
   반응형
   ============================================================ */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .detail-top {
        gap: 32px;
    }

    .detail-gallery {
        top: 90px;
    }

    .detail-product-name {
        font-size: 22px;
    }

    .price-sale-main {
        font-size: 26px;
    }

    .related-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .product-detail {
        padding: 24px 0 100px; /* 하단 고정바 영역 확보 */
    }

    /* 상단 1열 — 이미지 위, 정보 아래 */
    .detail-top {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 32px;
    }

    /* 갤러리 sticky 해제 */
    .detail-gallery {
        position: static;
    }

    /* 호버 줌 비활성 — 터치 환경 */
    .detail-main-img img {
        transform: none !important;
    }

    .detail-product-name {
        font-size: 18px;
    }

    .detail-summary {
        font-size: 14px;
    }

    .price-sale-main {
        font-size: 24px;
    }

    .detail-total .total-price {
        font-size: 22px;
    }

    /* 모바일에서는 PC 구매 버튼 영역을 하단 고정 바로 대체 */
    .detail-buy-btns {
        display: none;
    }

    /* 하단 고정 구매바 노출 */
    .mobile-buy-bar {
        display: flex;
    }

    /* 탭 버튼 */
    .detail-tab-btn {
        font-size: 14px;
        min-width: 100px;
        padding: 14px 8px;
    }

    .detail-tab-panel {
        padding: 24px 0;
    }

    /* 정보 테이블 — 모바일에서 좌측 너비 축소 */
    .info-table th {
        width: 110px;
        padding: 12px;
        font-size: 14px;
    }

    .info-table td {
        padding: 12px;
        font-size: 14px;
    }

    /* 식품 표시정보 — 모바일 보강 */
    .info-guide {
        padding: 12px 14px;
        font-size: 14px;
    }

    .info-section-title {
        font-size: 15px;
        margin: 24px 0 8px;
    }

    .info-disclaimer {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* 연관 상품 2열 */
    .related-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .related-products .section-title .txt02 {
        font-size: 18px;
    }

    /* 가격 테이블 라벨 너비 */
    .detail-price-table .label {
        width: 80px;
        font-size: 14px;
    }

    /* ────────────────────────────────────────────────
       상품 후기 — 모바일 보강
       ──────────────────────────────────────────────── */
    .review-header {
        padding: 14px;
    }

    .review-avg-num {
        font-size: 20px;
    }

    .btn-review-write {
        padding: 9px 14px;
        font-size: 14px;
    }

    /* 후기 카드 — 이미지 좀 작게 */
    .review-img-thumb {
        flex: 0 0 90px;
        width: 90px;
        height: 90px;
    }

    .review-img-thumb.is-empty .material-icons {
        font-size: 38px;
    }

    .review-item {
        gap: 12px;
        padding: 16px 4px;
    }

    /* 모달 — 폭/패딩 축소 */
    .review-modal-box {
        width: 96%;
        max-height: 94vh;
    }

    .review-form {
        padding: 16px;
    }

    .review-rating-input .rating-star .material-icons {
        font-size: 26px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .detail-product-name {
        font-size: 17px;
    }

    .price-sale-main {
        font-size: 22px;
    }

    .detail-quantity {
        flex-direction: row;
        align-items: center;
    }

    .qty-input {
        width: 44px;
    }

    /* 연관 상품 폰트 축소 */
    .related-name {
        font-size: 14px;
    }

    .related-sale {
        font-size: 15px;
    }

    /* 후기 — 더 작은 화면에서 이미지 한 단계 더 축소 */
    .review-img-thumb {
        flex: 0 0 80px;
        width: 80px;
        height: 80px;
    }

    .review-actions button {
        padding: 3px 8px;
        font-size: 14px;
    }

    .review-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}


/* ============================================================
   장바구니 담기 확인 모달
   ------------------------------------------------------------
   상품 상세에서 장바구니 버튼 클릭 시 노출되는 가벼운 confirm 모달
   ============================================================ */
.cart-confirm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cart-confirm-modal.is-open {
    display: flex;
}

.cart-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cart-confirm-box {
    position: relative;
    width: 92%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: cartConfirmIn 0.2s ease-out;
}

@keyframes cartConfirmIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* 우측 상단 X 닫기 */
.cart-confirm-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 0;
    color: #888888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    z-index: 1;
}

.cart-confirm-close:hover {
    color: #292829;
    background: #f5f5f5;
}

/* 본문 (아이콘 + 메시지) */
.cart-confirm-body {
    padding: 36px 24px 24px;
    text-align: center;
}

.cart-confirm-icon .material-icons {
    font-size: 56px;
    color: #4caf50;
    line-height: 1;
}

.cart-confirm-title {
    margin: 12px 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #292829;
}

.cart-confirm-text {
    margin: 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
}

/* 액션 버튼 (계속 쇼핑 / 장바구니 이동) */
.cart-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #ececec;
}

.cart-confirm-actions button {
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 0;
    cursor: pointer;
    background: #ffffff;
    color: #555555;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.cart-confirm-actions .btn-keep-shopping:hover {
    background: #f5f5f5;
    color: #292829;
}

.cart-confirm-actions .btn-go-basket {
    background: #6b1210;
    color: #ffffff;
    font-weight: 600;
}

.cart-confirm-actions .btn-go-basket:hover {
    background: #8a1a18;
}

.cart-confirm-actions .btn-go-basket .material-icons {
    font-size: 18px;
}

/* 모바일 — 버튼 세로 배치 */
@media (max-width: 480px) {
    .cart-confirm-body {
        padding: 28px 20px 20px;
    }

    .cart-confirm-actions {
        grid-template-columns: 1fr;
    }

    .cart-confirm-actions .btn-keep-shopping {
        border-bottom: 1px solid #ececec;
    }
}
