/* ===== cp.css ===== */
.shop-main {
    flex-grow: 1;
    min-width: 0; 
    width: 100%;
}

/* 레거시 샵 레이아웃(.shop-main) 전용 — 메인 개편 그리드는 main-renewal.css */
.shop-main #product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.shop-main .product-card {
    display: block;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-main .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.shop-main .product-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f4f4f5;
    overflow: hidden;
}

.shop-main .product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-main .product-image-wrap .media-no-image {
    width: 100%;
    height: 100%;
}

.shop-main .product-wish-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #ccc;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shop-main .product-wish-btn.is-wished {
    color: #e11d48;
}

.shop-main .product-info {
    padding: 12px 12px 14px;
}

.shop-main .product-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    min-height: 40px;
    word-break: break-all;
}

.shop-main .product-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.shop-main .product-price-krw {
    font-weight: 800;
    font-size: 17px;
    color: var(--brand-text, #111);
    display: block;
    width: 100%;
}

.shop-main .product-price-cny {
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-muted, #888);
    display: block;
    width: 100%;
    margin-top: 2px;
}

.product-item {
    background: #fff; border: 1px solid #eee; border-radius: 8px;
    overflow: hidden; display: flex; flex-direction: column; height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.product-image { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: #f4f4f5; }
.product-image img.product-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 목록·상세 공통: 이미지 없음 */
.media-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    background: #f4f4f5;
}
.media-no-image__icon {
    flex-shrink: 0;
    opacity: 0.88;
}
.media-no-image__label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: #64748b;
}
.media-no-image--modal .media-no-image__label {
    margin-top: 10px;
    font-size: 14px;
}
.main-media-box.main-media-box--empty {
    border: 1px solid #eceef2;
}

/* 상품 제목: 글자 전체 노출 설정 */
.product-title {
    padding: 12px 10px 5px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    
    display: block !important;
    height: auto !important;        /* 고정 높이 제거 */
    min-height: 42px;               /* 최소 높이만 유지 */
    overflow: visible !important;
    
    /* [센스 추가] 단어 단위가 아닌 글자 단위로 줄바꿈 (중국어/긴 단어 짤림 방지) */
    word-break: break-all; 
    white-space: normal;
    
    /* 말줄임표 기능 완전 삭제 */
    -webkit-line-clamp: unset !important;
    text-overflow: clip !important;
}

.product-price {
    margin-top: auto; /* 제목이 길어져도 가격은 항상 카드 최하단에 정렬 */
    padding: 10px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.price-krw { font-size: 18px; font-weight: 700; color: var(--brand-primary); }
.price-cny { font-size: 12px; color: #999; }

/* ===== 모바일 상품 목록 (2열) ===== */
@media (max-width: 768px) {
    .shop-main #product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-title { 
        font-size: 13px; 
        /* [중요] 모바일에서도 높이를 자동으로 늘어나게 수정 */
        height: auto !important; 
        min-height: 38px; 
        padding: 8px 8px 4px;
    }
    
    .price-krw { font-size: 15px; }
    .price-cny { font-size: 11px; }
}

/* ===== 상세 모달 스타일 ===== */
.detail-modal {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: block;
}

/* detail-grid는 common.css에서 관리 */

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* detail-media는 common.css에서 관리 */

.main-media-box {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
}

.gallery-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.gallery-image:hover {
    border-color: var(--brand-primary);
}

.gallery-item.video-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    flex-shrink: 0;
}
.gallery-item.video-thumb:hover {
    border-color: var(--brand-primary);
}
.gallery-item.video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-item.video-thumb .video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 5px 8px;
    border-radius: 50%;
    font-size: 10px;
}

.detail-info {
    padding: 0 10px;
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-title {
    flex: 1;
    min-width: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
    word-break: break-all;
}

.detail-title-translate-toggle {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 6px 10px;
    font-size: 12px;
}

.detail-title-translate-toggle .product-translate-toggle__icon {
    width: 16px;
    height: 16px;
    font-size: 9px;
}

.attr-box {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.attr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.attr-label {
    font-size: 13px;
    color: #666;
}

.attr-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.address-row {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.address-label {
    font-size: 13px;
    color: #666;
}

.address-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.price-box {
    background: #fff5f5;
    border: 1px solid #ffdddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ffeaea;
}

.price-row:last-child {
    border-bottom: none;
}

.price-label {
    font-size: 14px;
    color: #666;
}

.price-value {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.price-cny {
    font-size: 13px;
    color: #999;
    margin-left: 5px;
}
/* 단일상품 옵션 */
.cart-items {
    display: grid;
    grid-template-columns: 50px 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}
.cart-item-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.cart-items-stock {
    font-size: 13px;
    color: #28a745;
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
}
.quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* 단일 상품 끝 */
/* SKU 옵션 */
.sku-section {
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 10px;
}

.sku-options-1688 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sku-1688-group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.sku-1688-group-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: none;
    padding: 6px 10px 6px 6px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.sku-1688-group-tab:hover {
    border-color: #ced4da;
}

.sku-1688-group-tab.is-active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
    background: var(--brand-primary-light);
}

.sku-1688-group-tab-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f0f0f0 center/cover no-repeat;
    flex-shrink: 0;
}

.sku-1688-group-tab-img--text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.sku-1688-group-tab-label {
    font-size: 13px;
    line-height: 1.3;
    color: #444;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: anywhere;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sku-1688-group-tab.is-active .sku-1688-group-tab-label {
    color: var(--brand-primary);
    font-weight: 700;
}

.sku-1688-row {
    display: grid;
    grid-template-columns: 50px 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.sku-1688-row[hidden],
.sku-1688-row.is-sku-group-hidden {
    display: none !important;
}

.sku-section--grouped .sku-1688-row--grouped {
    grid-template-columns: 1fr auto auto auto;
}

.sku-1688-img {
    width: 50px;
    height: 50px;
    background: #ddd;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.sku-1688-img.sku-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.sku-1688-img.sku-no-image::after {
    content: '📦';
    font-size: 24px;
}

.sku-1688-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.sku-1688-price {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.sku-1688-stock {
    font-size: 13px;
    color: #28a745;
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
}

.sku-1688-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #333;
}

.qty-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.sku-qty-display {
    width: 52px;
    min-width: 52px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    padding: 0 6px;
    line-height: 28px;
    box-sizing: border-box;
}

input.sku-qty-display {
    appearance: textfield;
    -moz-appearance: textfield;
}

input.sku-qty-display::-webkit-outer-spin-button,
input.sku-qty-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input.sku-qty-display:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.12);
}

@media (max-width: 768px) {
    .sku-1688-group-tab {
        padding: 5px 8px 5px 5px;
        gap: 6px;
    }
    .sku-1688-group-tab-img {
        width: 32px;
        height: 32px;
    }
    .sku-1688-group-tab-label {
        font-size: 12px;
        max-width: 96px;
    }
    .sku-1688-row {
        grid-template-columns: 40px 1fr auto;
        gap: 8px;
        padding: 10px;
    }
    .sku-section--grouped .sku-1688-row--grouped {
        grid-template-columns: 1fr auto;
    }
    .sku-section--grouped .sku-1688-stock {
        grid-column: 1 / -1;
        text-align: left;
    }
    .sku-1688-img { width: 40px; height: 40px; }
    .sku-1688-name { font-size: 12px; }
    .sku-1688-price { font-size: 12px; }
    .sku-1688-stock { font-size: 11px; min-width: 40px; }
    .sku-1688-qty { gap: 4px; }
    .qty-btn { width: 24px; height: 24px; font-size: 14px; }
    .sku-qty-display { width: 44px; min-width: 44px; height: 24px; font-size: 13px; line-height: 24px; }
}

.cart-actions-1688 {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--brand-primary);
}

.cart-total-1688 {
    font-size: 18px;
    text-align: right;
    margin-bottom: 15px;
}

.cart-total-1688 strong {
    color: var(--brand-primary);
    font-size: 24px;
}

.total-price-main .price-value {
    font-size: 18px;
}

#total_price_display {
    font-size: 20px !important;
}

.total-price-sub .price-label,
.total-price-grand .price-label {
    font-size: 13px;
    color: #666;
}

.total-price-sub .price-value {
    font-size: 16px;
    color: #333;
}

.total-price-grand .price-value {
    font-size: 18px;
    color: var(--brand-primary);
    font-weight: 700;
}

.action-buttons-1688 {
    display: flex;
    gap: 15px;
}

.cart-btn, .buy-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-btn {
    background: #fff;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}

.cart-btn:hover {
    background: #fff5f5;
}

.buy-btn {
    background: var(--brand-primary);
    color: #fff;
}

.buy-btn:hover {
    background: #d63651;
}

/* 무료배송 표시 */
.price-row .attr-value[style*="green"] {
    background: #d4edda;
    color: #155724 !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* 선택 요약 박스 */
.selected-summary-box {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.summary-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 15px;
    color: #333;
}

.summary-totals {
    border-top: 2px solid var(--brand-primary);
    padding-top: 12px;
    margin-top: 12px;
}

.grand-total-row {
    font-weight: bold;
    font-size: 18px;
}

.grand-total-row .attr-value {
    color: var(--brand-primary);
    font-size: 22px;
}

/* 선택된 SKU 목록 */
.selected-sku-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.selected-sku-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.selected-sku-no-img {
    background: #f0f0f0;
}

.selected-sku-name {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.selected-sku-price {
    font-size: 13px;
    color: #666;
}

.selected-sku-total {
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

/* 배송비 표시 */
.shipping-free {
    color: green;
    font-weight: 600;
}

.shipping-cny {
    font-size: 12px;
    color: #999;
}

.shipping-none {
    color: #999;
}

.intl-shipping-note-row {
    align-items: flex-start !important;
    border-bottom: none !important;
    padding-top: 2px !important;
    padding-bottom: 8px !important;
}

.intl-shipping-note {
    display: block;
    width: 100%;
    font-size: 11px;
    line-height: 1.45;
    color: #8a8a8a;
    font-weight: 400;
    white-space: normal;
    word-break: keep-all;
}

.orig-data-box {
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}


.cart-item-qty-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}