:root {
    --bs-body-font-size: 16px;
}


/* CLO 미니샵 공통 스타일 (스캐폴딩) */
/* 헤더 3열 grid - [좌: 뒤로가기] [중앙: 서브페이지명] [우: 마이페이지] */
.clo-header, .clo-header-mo {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    min-height: 52px;
    background: #fff;
}
.clo-icon-btn, .clo-icon-slot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    text-decoration: none; color: #111;
}
.clo-icon-btn img { display: block; }
.clo-sub-title {
    text-align: center;
    font-weight: 700;
    font-size: 17px;
    color: #111;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 0 4px;
}
/* clo-main 이 viewport 남은 높이 채움 — 헤더(52) + 모바일 탭바(56) 제외 */
.clo-main {
    min-height: calc(100vh - 52px - 56px);
    background: #fff;
}
.clo-footer { padding: 16px; border-top: 1px solid #eee; color: #888; }
.clo-copy { font-size: 12px; }
.clo-tab-txt { font-size: 14px; }

/* 모바일 하단 고정 탭바 */
.clo-footer-mo {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: #fff; border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom); /* iOS 홈 인디케이터 영역 */
}
.is-mobile .clo-main { padding-bottom: 64px; } /* 고정 탭바에 본문 안 가리게 */
.clo-tabbar { display: flex; height: 56px; }
.clo-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; text-decoration: none; color: #555; font-size: 11px;
}
.clo-tab-ico { font-size: 20px; line-height: 1; }

/* 상품 리스트 — 모바일/PC 동일 2-col grid */
.clo-goods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 1rem;
    padding: 1rem;
}
.clo-goods-item {
    display: block;
    text-decoration: none;
    color: inherit;
}
.clo-goods-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 4px;
}
.clo-goods-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.clo-goods-soldout {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff; font-weight: 700;
}
.clo-goods-info { padding-top: 8px; }
.clo-goods-title {
    line-height: 1.35; 
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.clo-goods-market-row { margin-top: 4px; font-size: 12px; }
.clo-goods-market { color: #999; text-decoration: line-through; margin-right: 6px; }
.clo-goods-free { color: #0d6efd; font-weight: 600; }
.clo-goods-price-row { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; }
.clo-goods-percent { color: #e83e3e; font-weight: 700; }
.clo-goods-price { font-weight: 700; color: #111; }
.clo-goods-market::after { content: "원"; }
.clo-goods-price .won { font-weight: normal; margin-left: 2px; }

/* 캠페인 메인 페이지 (clo/default.asp) — 배너·정렬/필터 툴바·더보기 */
.clo-campaign-banner { width: 100%; margin: 0 0 1rem 0; }
.clo-campaign-banner img { width: 100%; display: block; }
.clo-campaign-sub { padding: 8px 1rem; color: #666; }
.clo-empty { padding: 60px 1rem; text-align: center; color: #888; }

.clo-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}
.clo-sort-tabs { display: flex; gap: 12px; }
.clo-sort-tabs .tab { color: #555; cursor: pointer; padding: 4px 0; }
.clo-sort-tabs .tab.active { color: #d33; font-weight: bold; border-bottom: 2px solid #d33; }
.clo-filter-btn { border: none; border-radius: 16px; background: #fff; cursor: pointer; }
.clo-filter-btn.has-filter { border-color: #d33; color: #d33; }
.clo-total { padding: 0 1rem 8px 1rem; color: #666; }

.clo-more-wrap { padding: 16px; text-align: center; }
.clo-more-btn { padding: 10px 30px; border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; }

/* PC 레이아웃 — 모바일 UI를 가운데 정렬, 좌우 여백 회색 (CokePLAY 패턴) */
:root { --clo-pc-width: 500px; }

/* hover/pointer 조건 필수 — min-width 단독이면 갤럭시 폴드 펼침/태블릿처럼 CSS 뷰포트가 501px 넘는 실기기 터치 화면까지 PC 프레임(500px)으로 잘려버림 */
@media (min-width: 501px) and (hover: hover) and (pointer: fine) {
    html, body.clo { min-height: 100vh; }
    body.clo {
        margin: 0;
        background-color: #f7f7f7;   /* 좌우 회색 사이드 */
    }
    body.clo .clo-header,
    body.clo .clo-header-mo,
    body.clo .clo-main,
    body.clo .clo-footer {
        max-width: var(--clo-pc-width);
        margin-left: auto;
        margin-right: auto;
        background-color: #fff;       /* 가운데 mobile UI 흰 배경 */
        -webkit-box-shadow: 0 0 0 1px #ebebeb;
        box-shadow: 0 0 0 1px #ebebeb;
    }
    /* 모바일 하단 고정 탭바 — fixed라 margin auto 안 먹음, left/transform 으로 가운데 */
    body.clo .clo-footer-mo {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: var(--clo-pc-width);
        max-width: var(--clo-pc-width);
    }
    /* 아래에서 올라오는 필터 offcanvas — PC 프레임 폭(500px)으로 가운데.
       슬라이드용 transform(translateY)은 건드리지 않으려고 left+음수 margin 으로 정렬 */
    body.clo .offcanvas-bottom {
        right: auto;
        left: 50%;
        width: var(--clo-pc-width);
        max-width: var(--clo-pc-width);
        margin-left: calc(var(--clo-pc-width) / -2);
    }
}

/* 잘못된 경로 페이지 */
.clo-error { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.clo-error-box { text-align: center; }
.clo-error-title { font-size: 20px; font-weight: 700; }
.clo-error-desc { color: #888; }
.clo-error-home { display: inline-block; margin-top: 16px; padding: 8px 20px; border: 1px solid #333; border-radius: 4px; text-decoration: none; color: #333; }
